dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.91k stars 4.01k forks source link

vstemplate file reference not found #44650

Open Shrp77AS opened 4 years ago

Shrp77AS commented 4 years ago

I installed the .Net Compiler SDK in the latest (5/28/2020) version of the VS Installer (running 2019 Pro).

When I try to create an Analyzer with Code Fix (.Net Standard) project, I get an error message:

The vstemplate file references a project file 'C:\Users\axxxxxxx.YYYYYYYYYYYYYY\AppData\Local\Microsoft\VisualStudio\16.0_88b5b846\VCT\301b61edb0c5c9d2311f6aa0344af430\~PC\CSharpDiagnostic\CSharp\Extensibility\1033\CSharpDiagnostic.zip\ProjectTemplates\CSharp\Diagnostic\Analyzer\DiagnosticAnalyzer.vstemplate' that does not exist.

I have tried enabling long file paths in both registry and gpedit, and I can run "type " in a dos prompt and get the content - yet VS2019 always fails at that point...

Any ideas?

sharwell commented 4 years ago

@mavasani have we deprecated the extension in the gallery yet?

mavasani commented 4 years ago

Which extension?

sharwell commented 4 years ago

@mavasani The above message occurs when https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.NETCompilerPlatformSDK is installed.

sharwell commented 4 years ago

I misread this issue originally. The problem is the username axxxxxxx.YYYYYYYYYYYYYY causes the full path to exceed MAX_PATH characters.

sharwell commented 4 years ago

@AmadeusW Do you know if there's anything we can do here other than keep making the template names shorter?

Shrp77AS commented 4 years ago

Is there any way to control where the extensions are installed?

sharwell commented 4 years ago

@Shrp77AS The extension is actually installed in a different location with a much shorter path. The path shown above is a cache directory where templates get extracted to. I'm not sure if it's possible to change the path, but I'm hoping someone who works on the core editor will be able to point us in the right direction.

Shrp77AS commented 4 years ago

I ended up renaming the user folder in Windows 10 - and spending close to a day changing the registry and reinstalling apps... but at least now the project template works... If VS would work with long path names or you could choose where to place the cache 🤞