Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyzer Template is ... broken #583

Closed
BillWagner opened this issue Aug 10, 2020 · 12 comments
Closed

Analyzer Template is ... broken #583

BillWagner opened this issue Aug 10, 2020 · 12 comments

Comments

@BillWagner
Copy link
Member

@StevenTCramer commented on Sat Aug 08 2020

Can't create new Analyzer project

First I try to create from empty folder and get:

image

So I create a sln and try to add new project and then get

image

Yet it does create 5 projects NOT the 3 referenced here. And they don't complie and look like:

image

C:\git\temp\MakeConst> dotnet --version
3.1.302
Microsoft Visual Studio Enterprise 2019
Version 16.7.0
VisualStudio.16.Release/16.7.0+30330.147
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Enterprise

ASP.NET and Web Tools 2019   16.7.532.28833
ASP.NET and Web Tools 2019

ASP.NET Core Razor Language Services   16.1.0.2035807+72d099b977d3a85e65fa3b0614ca8cfc803fef02
Provides languages services for ASP.NET Core Razor.

ASP.NET Web Frameworks and Tools 2019   16.7.532.28833
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   16.7.532.28833
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   16.7.532.28833
Azure Functions and Web Jobs Tools

C# Tools   3.7.0-6.20375.2+34202cc2f3e869fd70a26d8237f4552cf9e192cf
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30701.1

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager   2.1.79+ge3567815aa.RR
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

NuGet Package Manager   5.7.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Snapshot Debugging Extension   1.0
Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.62007.09200
Microsoft SQL Server Data Tools

Syntax Visualizer   1.0
An extension for visualizing Roslyn SyntaxTrees.

TypeScript Tools   16.0.20702.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.7.0-6.20375.2+34202cc2f3e869fd70a26d8237f4552cf9e192cf
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.10.0.0 for F# 4.7   16.7.0-beta.20361.3+3ef6f0b514198c0bfa6c2c09fefe41a740b024d5
Microsoft Visual F# Tools 10.10.0.0 for F# 4.7

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions (Preview)   1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

So it seems the template is broken and the docs are out of date or I have managed to somehow do this wrong. :)

Thanks.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.


@garfbradaz commented on Sun Aug 09 2020

Same issue reported here:

dotnet/docs#19876

Except mine dont creating the project's at all.


@BillWagner commented on Mon Aug 10 2020

ping @jmarolf

I think this is an error with the template. Should I move this to the roslyn repo?


@jmarolf commented on Mon Aug 10 2020

please move this to the dotnet/roslyn-sdk repo

@sharwell
Copy link
Member

sharwell commented Aug 10, 2020

First I try to create from empty folder and get [path error...]

This was fixed by #581.

So I create a sln and try to add new project and then get [file not found error...]

I believe this is caused by the path being too long. Can you tell me the total number of characters appearing in the value for %USERPROFILE%? For every character we shorten the longest names, one additional character can appear in this path.

Yet it does create 5 projects NOT the 3 referenced here

Five projects is the expected result. If the documentation says otherwise then it will need to be updated.

And they don't compile ...

@StevenTCramer can you provide more details about this error? Edit: I see from the image that two files failed to be created by the template. If these files are missing then the references to them from CSharpCodeRefactoringVerifier1.cs** and **VisualBasicCodeRefactoringVerifier1.cs will be broken.

@MisinformedDNA
Copy link

I'm using VS2019 16.7.1 and I got further, but I needed to add an additional NuGet package source to "https://dotnet.myget.org/F/roslyn-analyzers/api/v3/index.json" to get the Test project to build.

@MisinformedDNA
Copy link

And the defaults tests are failing:

Message:
Test method Analyzer1.Test.Analyzer1UnitTest.TestMethod1 threw exception:
NuGet.Packaging.Core.PackagingException: The package is missing the required nuspec file. Path: C:\Users\XXXX\AppData\Local\Temp\test-packages\NETStandard.Library.2.0.3
Stack Trace:
PackageFolderReader.GetNuspecFile()
PackageReaderBase.GetNuspec()
PackageReaderBase.get_NuspecReader()
PackageReaderBase.GetFrameworkItems()
PackageReaderBase.GetFrameworkItemsAsync(CancellationToken cancellationToken)

Also tested in 16.8.0 Preview 1.

@sharwell
Copy link
Member

sharwell commented Aug 18, 2020

I'm using VS2019 16.7.1 and I got further, but I needed to add an additional NuGet package source ...

This file is added by the template, but you may need to restart Visual Studio after creating the new project for it to take effect.

NuGet.Packaging.Core.PackagingException: The package is missing the required nuspec file.

This can happen if the %TEMP%\test-packages folder contains incomplete data for a package. Deleting the folder should fix it. Ideally, the test would recover automatically from this situation; consider filing a new issue for it.

@StevenTCramer
Copy link

@sharwell I'm on VS2019 Version 16.8.0 Preview 1.0 now and still get the

Microsoft Visual Studio

The path is not of a legal form.

OK

So curious what version has this been fixed in? Maybe not shipped yet?

@sharwell
Copy link
Member

@StevenTCramer it should be fixed in 16.8 Preview 2.

@sharwell
Copy link
Member

I'm going to close this issue, as the primary problem related to invalid paths has been resolved. I believe there are a couple additional issues that people have experienced so I'll try to move those to new issues.

@MichaRotstein
Copy link

I just tried again to create C# analyzer codefix project with the new Version 16.8.0 Preview 2.0
I get:

image

Any help ?

@sharwell
Copy link
Member

@MichaRotstein can you file a separate issue for that error? I believe it's caused by path lengths (#583 (comment))

@MichaRotstein
Copy link

thanks I opened #601

@akmetainfo
Copy link

Still an issue for me in VS2019 16.7.7

As workaround you can create empty solution first, then add new project from template.​

@sharwell
Copy link
Member

sharwell commented Nov 6, 2020

@akmetainfo This should be fixed in the 16.8 releases. See #583 (comment) above. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants