<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using NamedTraceConfiguration in Pro SDK CoreHost (Headless) Application with a Utility Network in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-namedtraceconfiguration-in-pro-sdk-corehost/m-p/1356651#M10790</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created named trace configurations in our utility network service from ArcGIS Pro. I can use them successfully in Pro, but when I attempt to use them from a Pro SDK CoreHost app, they don’t work.&lt;/P&gt;&lt;P&gt;The named trace configuration object is retrieved, and I can see its settings during runtime, and then I can create a tracer with it, and then I can plug the NTC into a trace argument, and I can see its settings as part of the trace argument, but when I plug that trace argument into the tracer I created with the NTC, and then run the trace, I get an &lt;U&gt;&lt;STRONG&gt;&lt;EM&gt;empty&lt;/EM&gt;&lt;/STRONG&gt;&lt;/U&gt; result.&lt;/P&gt;&lt;P&gt;This is the approach I am using to retrieve the NTC, create a tracer with it, and then run the trace in code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private void TraceUtilityNetworkUsingNamedTraceConfiguration(UtilityNetwork utilityNetwork, NamedTraceConfiguration namedTraceConfiguration, Element startElement)
{
  // Get the trace manager from the utility network
  using (TraceManager traceManager = utilityNetwork.GetTraceManager())
  {
    // Get a tracer from the trace manager using the named trace configuration
    Tracer upstreamTracer = traceManager.GetTracer(namedTraceConfiguration);

    // Trace argument holding the trace input parameters
    TraceArgument upstreamTraceArgument = new TraceArgument(namedTraceConfiguration, new List&amp;lt;Element&amp;gt; { startElement });

    // Trace results 
    IReadOnlyList&amp;lt;Result&amp;gt; upstreamTraceResults = upstreamTracer.Trace(upstreamTraceArgument);
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This approach is not working in my CoreHost application.&lt;/P&gt;&lt;P&gt;Help? Suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jan 2024 19:43:27 GMT</pubDate>
    <dc:creator>DrewNemecekIp</dc:creator>
    <dc:date>2024-01-11T19:43:27Z</dc:date>
    <item>
      <title>Using NamedTraceConfiguration in Pro SDK CoreHost (Headless) Application with a Utility Network</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-namedtraceconfiguration-in-pro-sdk-corehost/m-p/1356651#M10790</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created named trace configurations in our utility network service from ArcGIS Pro. I can use them successfully in Pro, but when I attempt to use them from a Pro SDK CoreHost app, they don’t work.&lt;/P&gt;&lt;P&gt;The named trace configuration object is retrieved, and I can see its settings during runtime, and then I can create a tracer with it, and then I can plug the NTC into a trace argument, and I can see its settings as part of the trace argument, but when I plug that trace argument into the tracer I created with the NTC, and then run the trace, I get an &lt;U&gt;&lt;STRONG&gt;&lt;EM&gt;empty&lt;/EM&gt;&lt;/STRONG&gt;&lt;/U&gt; result.&lt;/P&gt;&lt;P&gt;This is the approach I am using to retrieve the NTC, create a tracer with it, and then run the trace in code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private void TraceUtilityNetworkUsingNamedTraceConfiguration(UtilityNetwork utilityNetwork, NamedTraceConfiguration namedTraceConfiguration, Element startElement)
{
  // Get the trace manager from the utility network
  using (TraceManager traceManager = utilityNetwork.GetTraceManager())
  {
    // Get a tracer from the trace manager using the named trace configuration
    Tracer upstreamTracer = traceManager.GetTracer(namedTraceConfiguration);

    // Trace argument holding the trace input parameters
    TraceArgument upstreamTraceArgument = new TraceArgument(namedTraceConfiguration, new List&amp;lt;Element&amp;gt; { startElement });

    // Trace results 
    IReadOnlyList&amp;lt;Result&amp;gt; upstreamTraceResults = upstreamTracer.Trace(upstreamTraceArgument);
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This approach is not working in my CoreHost application.&lt;/P&gt;&lt;P&gt;Help? Suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 19:43:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-namedtraceconfiguration-in-pro-sdk-corehost/m-p/1356651#M10790</guid>
      <dc:creator>DrewNemecekIp</dc:creator>
      <dc:date>2024-01-11T19:43:27Z</dc:date>
    </item>
  </channel>
</rss>

