OfficeDev/teams-toolkit

Cannot create new Teams apps with Teams Toolkit in Visual Studio Community 17.10.2

Closed this issue · 8 comments

adr15 commented

When trying to create a new Teams app using Teams Toolkit in Visual Studio, I'm always getting a message "The system cannot find the path specified. (Exception from HRESULT: 0x80070003)". The project is created but incomplete.

I've encountered this issue after updating the last version of VS (17.10.2) - but not sure this is the issue.
I've reinstalled VS and the operating system, the behavior is the same.

I've installed same VS Community 17.10.2 with Microsoft Teams development tools options from scratch on a new computer - the same behavior.

Until some weeks ago I've used Teams Toolkit with no issues.

In VS log the full record is:

3081 2024/06/15 20:43:19.971 Error Template provider aggregator System.IO.DirectoryNotFoundException: The system cannot find the path specified. (Exception from HRESULT: 0x80070003) at Microsoft.VisualStudio.CommonIDE.Solutions.Interop.IVsNativeEnvironmentInternal.WizLoadAndRunFile(String pwszWizard, String pwszDestination, Boolean bCloseSolution, Boolean bRunSilent, Array psaCustomParams, String pwszFrameworkVersion) at Microsoft.VisualStudio.CommonIDE.Solutions.Dte.DteSolution.<AddFromTemplateExAsync>d__248.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.CommonIDE.Solutions.Dte.DteSolution.<AddFromTemplateExAsync>d__248.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.CommonIDE.Solutions.Dte.DteSolution.<AddFromTemplateExAsync>d__248.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 Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() at Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread() at Microsoft.VisualStudio.CommonIDE.Solutions.Dte.DteSolution.AddFromTemplateEx(String FileName, String Destination, String ProjectName, String SolutionName, Boolean Exclusive, UInt32 Options) at Microsoft.VisualStudio.CommonIDE.Solutions.Dte.DteSolution.<>c__DisplayClass25_0.<EnvDTE100.Solution4.AddFromTemplateEx>b__0() at Microsoft.VisualStudio.NewProjectDialog.LegacyVsTemplateProvider.GetInstantiationResult(CreateProjectResult result) at Microsoft.VisualStudio.NewProjectDialog.LegacyProjectTemplateProvider.<InstantiateTemplateAsync>d__10.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 Microsoft.VisualStudio.TemplateProviders.TemplateProviderSupport.ExceptionLoggingTemplateProviderDecorator.<InstantiateTemplateAsync>d__9.MoveNext() 3082 2024/06/15 20:43:20.172 Error SccDisplayInformation.SolutionOptions Unable to load solution user option 'SccProvider.Solution.LoadCount' 3083 2024/06/15 20:43:20.176 Error SccDisplayInformation.SolutionOptions Unable to load solution user option 'SccProvider.Solution.LastBranch'

Hi @adr15, thanks for reporting. Could you provide more information about the following questions?

  1. Do you try to create other templates, such as a console app?
  2. What template of Teams do you try to create?
  3. Can you run the commands on the older project?
adr15 commented

Hi @adr15, thanks for reporting. Could you provide more information about the following questions?

  1. Do you try to create other templates, such as a console app?
  2. What template of Teams do you try to create?
  3. Can you run the commands on the older project?

1 - any other template works, except the ones created with Teams Toolkit
2- Echo and AI ChatBot
3 - Yes, if I open old projects they work with no problems

Thank you. Can you check if there is a folder Microsoft.TeamsFx.Sdk under %VS_Installer_Path%/MSBuild/Sdks and there are some files under Microsoft.TeamsFx.Sdk/Sdk? Seem like:

image

By the way, where do you find the VS logs? I hope to reproduce the issue and see the log.

adr15 commented

Thank you. Can you check if there is a folder Microsoft.TeamsFx.Sdk under %VS_Installer_Path%/MSBuild/Sdks and there are some files under Microsoft.TeamsFx.Sdk/Sdk? Seem like:

image

By the way, where do you find the VS logs? I hope to reproduce the issue and see the log.

Yes, I have the folder and and the files.

I'll try later to generate another log file and get back with location deleted the other file and don't remember were it was

That's strange. I am not sure why it happened on your machine, but there is an environment that can control the template content. You can try to set system environment TEAMSFX_NEW_PROJECT_TYPE to false and try to create a new Teams App project again. Remember you need close the Visual Studio installer and Visual Studio instance after changing the environment.

Hope it can help you. Thanks!

I had the same error message resulting in an incompletely created new project working in 17.10.3. I was able to work around it by running VS as administrator.

adr15 commented

After updating Visual Studio to last version 17.0.4 the problems seems solved - I don't have this behavior anymore. I think the problem was related to Visual Studio, not to Teams Toolkit.
Thank you for support and prompt replies !