You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since latest VS 2017 update (15.6.2) referencing Autofac 4.6.2 from netcoreapp2.0 package gives NU1701 warning on build:
warning NU1701: Package 'Autofac 4.6.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.
This is also true for visual studio generated docker images for ASP.NET Core 2.0.
It seems that this warning is "safe to ignore", assuming Autofac uses very small subset of .NET APIs, but there are many build envirinments or policies that enforces full NoWarn builds with no exceptions.
This issue is related to #867 , #889 and this PR: #868 .
The text was updated successfully, but these errors were encountered:
tillig
changed the title
Release netstandard2.0 version of Autofac packages family.
NU1701 warning when referencing Autofac 4.6.2 from netcoreapp2.0 project
Mar 19, 2018
Updated the title to reflect the issue rather than the proposed solution.
At first blush this seems like a NuGet bug. netstandard1.1 is 100% compatible with netcoreapp2.0 so if it's being restored using some sort of net461 then NuGet isn't restoring using the right target framework.
#867 isn't related here unless the reason NuGet is failing is due to the .NET Core SDK build tooling from the 1.1.0 SDK. Note the .NET Core SDK is not related to the netstandard1.1 being targeted, one of the reasons the SDK is now separately versioned from the .NET Core runtimes.
#889 also doesn't relate because the proposal is effectively to target netstandard2.0as well asnetstandard1.1 simply to avoid transitive dependencies some people find distasteful.
Given the exact project file posted above I am unable to reproduce this issue. No warnings appear, everything builds fine both in Visual Studio 2017 15.6.2 and from dotnet build in the application folder.
I would recommend:
Delete your .vs folder, the bin folder, and the obj folder from the source location.
Clear out your temp files folder.
Flush your NuGet cache: nuget locals all -clear
...then try again. Many times these sorts of things pop up after a VS upgrade due to something stale getting cached incorrectly. Flushing cached areas can sort it out.
Since latest VS 2017 update (15.6.2) referencing Autofac 4.6.2 from netcoreapp2.0 package gives NU1701 warning on build:
warning NU1701: Package 'Autofac 4.6.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.
This is also true for visual studio generated docker images for ASP.NET Core 2.0.
It seems that this warning is "safe to ignore", assuming Autofac uses very small subset of .NET APIs, but there are many build envirinments or policies that enforces full NoWarn builds with no exceptions.
Example of csproj:
This issue is related to #867 , #889 and this PR: #868 .
The text was updated successfully, but these errors were encountered: