_From @Tornhoof on October 19, 2017 7:56_
Upgrading to .NET 4.7.1 with the new SDK format results in multiple library redirect warnings for system libraries (e.g. System.IO). Targeting .NET 4.7 does not have this problem.
There was a conflict between "System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
"System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
References which depend on "System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.runtime\4.3.0\ref\net462\System.Runtime.dll].
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.runtime\4.3.0\ref\net462\System.Runtime.dll
Project file item includes which caused reference "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.runtime\4.3.0\ref\net462\System.Runtime.dll".
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.runtime\4.3.0\ref\net462\System.Runtime.dll
References which depend on "System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\Facades\System.Runtime.dll].
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.codeanalysis.common\2.3.1\lib\netstandard1.3\Microsoft.CodeAnalysis.dll
Project file item includes which caused reference "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.codeanalysis.common\2.3.1\lib\netstandard1.3\Microsoft.CodeAnalysis.dll".
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.razor\2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.codeanalysis.common\2.3.1\lib\netstandard1.3\Microsoft.CodeAnalysis.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.codeanalysis.csharp\2.3.1\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.razorpages\2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.RazorPages.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.razor.extensions\2.0.0\lib\net46\Microsoft.AspNetCore.Mvc.Razor.Extensions.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc\2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.taghelpers\2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.TagHelpers.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.localization\2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.Localization.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.codeanalysis.razor\2.0.0\lib\net46\Microsoft.CodeAnalysis.Razor.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.codeanalysis.csharp\2.3.1\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll
Project file item includes which caused reference "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.codeanalysis.csharp\2.3.1\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll".
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.razor\2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.codeanalysis.csharp\2.3.1\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.razorpages\2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.RazorPages.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.razor.extensions\2.0.0\lib\net46\Microsoft.AspNetCore.Mvc.Razor.Extensions.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc\2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.taghelpers\2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.TagHelpers.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.localization\2.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.Localization.dll
C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.codeanalysis.razor\2.0.0\lib\net46\Microsoft.CodeAnalysis.Razor.dll
There are warnings for the following libraries
System.ValueTuple,
System.Runtime,
System.IO,
System.Reflection,
System.Security.Cryptography,
System.Linq,
System.Runtime.Extensions,
System.Runtime.InteropServices,
System.IO.FileSystem,
System.IO.FileSystem.Primitives,
System.Xml.ReaderWriter,
System.Security.Cryptography.Primitives,
System.Linq.Expressions,
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
Add a few unit tests
No build warnings
Redirect warnings
_Copied from original issue: dotnet/project-system#2905_
_From @jackowild on October 19, 2017 10:55_
I am also having this problem. It can be reproduced even easier by simply creating a new "ASP.NET Core Web Application" project targeting net471, and then building it without making any changes.
@dsplaisted Does this look familiar?
Also tagging @terrajobst
_From @bburman on October 25, 2017 14:21_
I'm experiencing this as well. Any recommendations or workarounds for this short of going back to .NET Framework 4.7 or suppressing the warnings? I can add assembly redirects in a config file, but it doesn't get rid of the compiler warnings.
_From @Tornhoof on October 25, 2017 14:55_
I don't know any other workaround for it. I went back to 4.7 after the numerous errors with 4.7.1.
Also experiencing this problem. Any workaround would be greatly appreciated, since it currently prevents us from migrating to .NET 4.7.1.
@tornhoof @jackowild @bburman @alphaleonis Can you try this with Visual Studio 2017 Update 5 Preview 2 or later? I think this has already been fixed. Let us know if that fixes the issue or not for you.
Thanks!
Yeah, my test project builds without those warnings in VS 15.5 Preview 2.
Thanks
@dsplaisted I tested this in VS 2017 15.5 Preview 2 and indeed it seems the problem has been solved here.
@dsplaisted Works like a champ in VS 2017 Update 5 Preview 2! Thanks much!
Closing as this was fixed for 15.5 Preview2.
So please confirm, this is up to Visual Studio 2017 ?
Because I have:
dotnet new webapi
edit .csproj and put net471
dotnet build
same warning MSB3277 in output.
How would VS update help on this?
Is it safe to ignore this warning?
https://stackoverflow.com/questions/28097981/can-the-new-asp-net-5-asp-net-mvc-6-project-type-target-regular-net
And yet that promise is still encumbered by this madness. I have all of the problems above popping up, and no solutions were given, and yet it's March of 2018 now. It's simply maddening.
agreed, a failure, to say the least.
Most helpful comment
https://stackoverflow.com/questions/28097981/can-the-new-asp-net-5-asp-net-mvc-6-project-type-target-regular-net
And yet that promise is still encumbered by this madness. I have all of the problems above popping up, and no solutions were given, and yet it's March of 2018 now. It's simply maddening.