Getting "STG_E_FILENOTFOUND" when creating project using project template wizard
Asked Answered
A

2

7

I am trying to create a VSIX project for creating multi-project template using Wizard but I am getting exception on

this.dte.Solution.AddFromTemplate(Path.Combine(this.templateDirectory, "WebTemplate\\UI.vstemplate"), Path.Combine(this.solutionDirectory,  this.projectName), this.projectName, false);  

Exception is

"could not be found. (Exception from HRESULT: 0x80030002 (STG_E_FILENOTFOUND))"

Stack trace is:

at EnvDTE.SolutionClass.AddFromTemplate(String FileName, String Destination, String ProjectName, Boolean Exclusive)

at TemplateWizard.RootWizard.ProjectFinishedGenerating(Project project)

Aftersensation answered 8/2, 2018 at 1:26 Comment(0)
F
0

I struck this trying to use a project template that I had created in VS2019, to create a project in VS2022. I got around it by opening the solution in VS2019 which is still on my machine, and adding the project there.

You can unzip the template and open the template manifest to check that all the files referenced are indeed in the template. I did this, and it wasn't the problem.

Finegan answered 12/8, 2022 at 12:2 Comment(0)
C
0

Close ALL the windows as they may prevent changes.

Visual Studio has a cache for templates. This cache can be found in the link. Please delete the cache and the initial templates that were added in the ProjectTemplate folder of the visual studio folder.

I also ran these 2 commands in the Developer Command Prompt of Visual studio (probably not necessary but I tried with everything I found on the internet).

  • devenv /installvstemplates
  • devenv /updateconfiguration

Now check if you can find the templates again. They should not be there if everything was delete and the cache is clean.

Add the template again and maybe run the commands above. Now try and find the template.

Canister answered 12/9, 2022 at 14:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.