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

[DCR]: Improve NU5128 warning text #11354

Open
anangaur opened this issue Nov 1, 2021 · 0 comments
Open

[DCR]: Improve NU5128 warning text #11354

anangaur opened this issue Nov 1, 2021 · 0 comments
Labels
Area:ErrorHandling warnings and errors/log messages & related error codes. Functionality:Pack Priority:2 Issues for the current backlog. Type:DCR Design Change Request

Comments

@anangaur
Copy link
Member

anangaur commented Nov 1, 2021

NuGet Product(s) Affected

NuGet.exe, MSBuild.exe, dotnet.exe

Current Behavior

Customer reported the following:

The solution was even simpler:

<PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <LangVersion>latest</LangVersion>
    <Nullable>enable</Nullable>
    <IsRoslynComponent>true</IsRoslynComponent>
    <NoWarn>NU5128</NoWarn>
</PropertyGroup>

Anyway, since you planned not to "fix" this, it would be nicer to add to the warning message that it can be safely ignored when packaging an analyzer.


I created a C# code generator which is effectively an analyzer, so there is no binary to "deploy".

Upon compiling with pack, NuGet complains with those two warnings:
warning NU5128: Some target frameworks declared in the dependencies group of the nuspec and the lib/ref folder do not have exact matches in the other location. Consult the list of actions below:
warning NU5128: - Add lib or ref assemblies for the netstandard2.0 target framework

I read these are well-known false positives in analyzer projects.
Anyway, they are annoying. Does anyone know how can I get rid of them? I am trying not to take any drastic action like "-NoPackageAnalysis"
Note: I am have no "nuspec" but all the nuget info are inside the csproj.

Desired Behavior

Add additional text to the warning message indicating this can be suppressed while packing a analyzer.

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:ErrorHandling warnings and errors/log messages & related error codes. Functionality:Pack Priority:2 Issues for the current backlog. Type:DCR Design Change Request
Projects
None yet
Development

No branches or pull requests

3 participants