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

Nuget restore build task ignores NoWarn usage #5494

Closed
tjrobinson opened this issue Sep 28, 2017 · 2 comments
Closed

Nuget restore build task ignores NoWarn usage #5494

tjrobinson opened this issue Sep 28, 2017 · 2 comments
Assignees

Comments

@tjrobinson
Copy link

I have a solution which targets both net462 and netstandard2.0 and uses the .NET Core SDK 2.0.

During the Nuget restore step I'm getting multiple errors like the below:

2017-09-27T16:33:06.4694242Z Errors in d:\a\1\s\src\Empactis.Data.Querying\Empactis.Data.Querying.csproj
2017-09-27T16:33:06.4694242Z     Package Irony 0.9.1 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Irony 0.9.1 supports: net40 (.NETFramework,Version=v4.0)
2017-09-27T16:33:06.4694242Z     One or more packages are incompatible with .NETStandard,Version=v2.0.

These errors are suppressed in the .csproj file by using the NoWarn option, for example:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
    <NoWarn>NU1701,NU1702</NoWarn>
  </PropertyGroup>

Adding the NoWarn prevents these errors when restoring packages and building from Visual Studio but not when running in VSTS.

How can I ignore these Nuget restore errors? They are really only warnings.

https://docs.microsoft.com/en-us/nuget/reference/errors-and-warnings#nu1701

This possibly relates to:

dotnet/project-system#2804
NuGet/Home#5712
NuGet/Home#5769

@satbai
Copy link
Contributor

satbai commented Sep 28, 2017

Hi @tjrobinson, thank you for reporting this issue.

This is a bug with NuGet version 4.0.0 that we use as a default version in the NuGet restore task. The bug is fixed in version 4.3.0, so what you can do is to use the NuGet Tool Installer task to change the version of NuGet to 4.3.0 and run it before the NuGet restore task. Please let us know if you still experience issues after doing this.

Thanks!

@tjrobinson
Copy link
Author

@satbai Thank you, that has resolved the issue!

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

No branches or pull requests

4 participants