<?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 Re: Issue with await Project.CreateAsync(cps); in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219364#M8841</link>
    <description>&lt;P&gt;It appears that&amp;nbsp;&lt;SPAN&gt;UnpackProjectPackage&amp;nbsp;is failing.&amp;nbsp; Once a template is chosen, ArcGIS Pro is trying to 'unzip' the new ArcGIS Pro project file (from the template) in the destination location path.&amp;nbsp; In order to determine what went wrong you should log both defaultName and DefaultFolder() when CreateAsync fails.&amp;nbsp; And we need the value for&amp;nbsp;GetDefaultMapTemplate() too in order to see if the template file exists.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am trying to duplicate this issue, what version of Pro are you using?&lt;/P&gt;</description>
    <pubDate>Thu, 06 Oct 2022 17:17:32 GMT</pubDate>
    <dc:creator>Wolf</dc:creator>
    <dc:date>2022-10-06T17:17:32Z</dc:date>
    <item>
      <title>Issue with await Project.CreateAsync(cps);</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219352#M8840</link>
      <description>&lt;P&gt;This line of code has been working for a couple years now.&amp;nbsp; But I am having some recent issues with users with creating a blank project.&amp;nbsp; This only happens on some machines and not others.&amp;nbsp; Wonder if anyone might have better insight into error log.&amp;nbsp; I have made sure all of the paths are valid and the user has write permissions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var cps = new CreateProjectSettings()
                    {
                        Name = defaultName,
                        LocationPath = DefaultFolder(),
                        TemplatePath = GetDefaultMapTemplate(),
                        CreateNewProjectFolder = true
                    };

                    ProMapBlackLogWriter.Log.Debug("NewBlankProject - CreateAsync");
                    var newProject = await Project.CreateAsync(cps); //This Fails with log.  And has not happened before.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Message = ProjectService::UnpackProjectPackage Failed&lt;/P&gt;&lt;P&gt;Log happens at&amp;nbsp; var newProject = await Project.CreateAsync(cps);&lt;/P&gt;&lt;P&gt;Stack Trace = at ArcGIS.Desktop.Core.CoreModule.&amp;lt;InternalCreateProjectAsync&amp;gt;d__36.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;at ArcGIS.Desktop.Core.Project.&amp;lt;CreateAsync&amp;gt;d__5.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()&lt;BR /&gt;at &amp;lt;CreateAsync&amp;gt;d__3.MoveNext() in code.cs:line 353&lt;BR /&gt;Oct 06 09:25:26 2022 ERROR - Message = ProjectService::UnpackProjectPackage Failed&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 14:41:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219352#M8840</guid>
      <dc:creator>MKa</dc:creator>
      <dc:date>2022-10-06T14:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with await Project.CreateAsync(cps);</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219364#M8841</link>
      <description>&lt;P&gt;It appears that&amp;nbsp;&lt;SPAN&gt;UnpackProjectPackage&amp;nbsp;is failing.&amp;nbsp; Once a template is chosen, ArcGIS Pro is trying to 'unzip' the new ArcGIS Pro project file (from the template) in the destination location path.&amp;nbsp; In order to determine what went wrong you should log both defaultName and DefaultFolder() when CreateAsync fails.&amp;nbsp; And we need the value for&amp;nbsp;GetDefaultMapTemplate() too in order to see if the template file exists.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am trying to duplicate this issue, what version of Pro are you using?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 17:17:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219364#M8841</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2022-10-06T17:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with await Project.CreateAsync(cps);</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219486#M8846</link>
      <description>&lt;P&gt;I am using pro 2.5.0 still as that is what our configuration program was built on.&amp;nbsp; The Names and folder paths all seem fine.&amp;nbsp; The user can write to all of those locations too.&amp;nbsp; On my computer the code works, which is what makes this difficult.&lt;/P&gt;&lt;P&gt;Here is the logging from that part of the code that we added to see and test the paths.&amp;nbsp; The OneDrive path works on my computer, as we thought that might have been it, but it wasn't.&lt;/P&gt;&lt;P&gt;DEBUG NewBlankProject - defaultName - ADA1_2022_3_010_TEST&lt;BR /&gt;DEBUG NewBlankProject - defaultFolder - C:\Users\USERNAME\OneDrive - Corteva\Documents\ArcGIS\Projects&lt;BR /&gt;DEBUG NewBlankProject - templatePath - C:\Program Files\ArcGIS\Pro\Resources\ProjectTemplates\Map.aptx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 17:22:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219486#M8846</guid>
      <dc:creator>MKa</dc:creator>
      <dc:date>2022-10-06T17:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with await Project.CreateAsync(cps);</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219499#M8847</link>
      <description>&lt;P&gt;There is one issue i ran into while testing this.&amp;nbsp; Apparently the given 'LocationPath' has to exist otherwise Pro will use the default project path.&amp;nbsp; You could change your code snippet a bit to prevent this problem:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var cps = new CreateProjectSettings()
{
  Name = defaultName,
  LocationPath = DefaultFolder(),
  TemplatePath = GetDefaultMapTemplate(),
  CreateNewProjectFolder = true
};
if (!System.IO.Directory.Exists(cps.LocationPath))
  System.IO.Directory.CreateDirectory(cps.LocationPath);
//ProMapBlackLogWriter.Log.Debug("NewBlankProject - CreateAsync");
var newProject = await Project.CreateAsync(cps); //This Fails with log.  And has not happened before&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 17:41:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219499#M8847</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2022-10-06T17:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with await Project.CreateAsync(cps);</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219508#M8848</link>
      <description>&lt;P&gt;We just tried that and it still failed.&amp;nbsp; The directory already exists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Stack Trace = at ArcGIS.Desktop.Core.CoreModule.&amp;lt;InternalCreateProjectAsync&amp;gt;d__36.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;at ArcGIS.Desktop.Core.Project.&amp;lt;CreateAsync&amp;gt;d__5.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()&lt;BR /&gt;at &amp;lt;NewBlankProject&amp;gt;d__3.MoveNext() in ViewModel.cs:line 373&lt;BR /&gt;NewBlankProject - Message = ProjectService::UnpackProjectPackage Failed&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 18:07:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219508#M8848</guid>
      <dc:creator>MKa</dc:creator>
      <dc:date>2022-10-06T18:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with await Project.CreateAsync(cps);</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219511#M8849</link>
      <description>&lt;P&gt;I will try with 2.5 and use your path values.&amp;nbsp; It looks like you are setting locationpath to the default project location.&amp;nbsp; On those machines where this doesn't work you can create a new project (using any template) from within Pro?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 18:13:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219511#M8849</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2022-10-06T18:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with await Project.CreateAsync(cps);</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219929#M8861</link>
      <description>&lt;P&gt;So the user could use the OOB template in pro and create a map project.&amp;nbsp; I used the same name of the file and location.&amp;nbsp; So they have all permissions and files.&amp;nbsp; Nothing seems to be corrupt.&amp;nbsp; Running out of ideas.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 16:17:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/issue-with-await-project-createasync-cps/m-p/1219929#M8861</guid>
      <dc:creator>MKa</dc:creator>
      <dc:date>2022-10-07T16:17:30Z</dc:date>
    </item>
  </channel>
</rss>

