This line of code has been working for a couple years now. But I am having some recent issues with users with creating a blank project. This only happens on some machines and not others. Wonder if anyone might have better insight into error log. I have made sure all of the paths are valid and the user has write permissions.
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.
Message = ProjectService::UnpackProjectPackage Failed
Log happens at var newProject = await Project.CreateAsync(cps);
Stack Trace = at ArcGIS.Desktop.Core.CoreModule.<InternalCreateProjectAsync>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ArcGIS.Desktop.Core.Project.<CreateAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at <CreateAsync>d__3.MoveNext() in code.cs:line 353
Oct 06 09:25:26 2022 ERROR - Message = ProjectService::UnpackProjectPackage Failed