<?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 How do I get the signed-in username in ArcGIS Pro in C#/.NET SDK? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-get-the-signed-in-username-in-arcgis-pro/m-p/1085880#M6980</link>
    <description>&lt;P&gt;Can anyone tell me how to get the signed-in username in ArcGIS Pro using C#/.NET SDK?&lt;/P&gt;</description>
    <pubDate>Wed, 04 Aug 2021 18:40:04 GMT</pubDate>
    <dc:creator>ScottLehto3</dc:creator>
    <dc:date>2021-08-04T18:40:04Z</dc:date>
    <item>
      <title>How do I get the signed-in username in ArcGIS Pro in C#/.NET SDK?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-get-the-signed-in-username-in-arcgis-pro/m-p/1085880#M6980</link>
      <description>&lt;P&gt;Can anyone tell me how to get the signed-in username in ArcGIS Pro using C#/.NET SDK?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 18:40:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-get-the-signed-in-username-in-arcgis-pro/m-p/1085880#M6980</guid>
      <dc:creator>ScottLehto3</dc:creator>
      <dc:date>2021-08-04T18:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the signed-in username in ArcGIS Pro in C#/.NET SDK?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-get-the-signed-in-username-in-arcgis-pro/m-p/1085888#M6981</link>
      <description>&lt;P&gt;You can get the signed in user name for the current active portal, but only when the user signed in.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;QueuedTask.Run(() =&amp;gt; {
  var portal = ArcGISPortalManager.Current.GetActivePortal();
  if (portal != null) {
    // make sure is signed in
    var IsSignedOn = portal.IsSignedOn();
    if (!IsSignedOn) portal.SignIn();
    var signOnUserName = portal.GetSignOnUsername();
    // ...
  }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 19:05:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-get-the-signed-in-username-in-arcgis-pro/m-p/1085888#M6981</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-08-04T19:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the signed-in username in ArcGIS Pro in C#/.NET SDK?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-get-the-signed-in-username-in-arcgis-pro/m-p/1085893#M6982</link>
      <description>&lt;P&gt;Side Question: Can you run QueuedTask.Run in the Module1.cs? I ask because I received advice to have my business logic in the Module.cs to stay organized.&lt;/P&gt;&lt;PRE&gt;QueuedTask.Run(() =&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 19:16:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-get-the-signed-in-username-in-arcgis-pro/m-p/1085893#M6982</guid>
      <dc:creator>ScottLehto3</dc:creator>
      <dc:date>2021-08-04T19:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the signed-in username in ArcGIS Pro in C#/.NET SDK?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-get-the-signed-in-username-in-arcgis-pro/m-p/1085941#M6983</link>
      <description>&lt;P&gt;You can call QueuedTask.Run anywhere.&amp;nbsp; Putting business logic into the Module class makes sense if you need access to your logic from various tools and buttons from within your add-in.&amp;nbsp; Also note that you can access your Module class (which is a singleton) from any other add-in or managed configuration through&amp;nbsp; FrameworkApplication.FindModule("MyAddIn_Module").&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your business logic make sure that you don't 'nest' calls to QueuedTask.Run, meaning that you should not call a function that calls QueuedTask.Run from within the context of another QueuedTask.Run action.&lt;/P&gt;&lt;P&gt;If you write re-usable functionality that is calling Pro API methods that require to run from within the context of QueuedTask.Run make sure to put the following comment in your summary description of your method:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This method must be called on the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;MCT&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The Pro API is using the same pattern for methods that need to run from the MCT.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 20:48:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-get-the-signed-in-username-in-arcgis-pro/m-p/1085941#M6983</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-08-04T20:48:29Z</dc:date>
    </item>
  </channel>
</rss>

