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

VS 2015 support for ns2.0 causes conflicts with ref assembly facades #1539

Closed
dasMulli opened this issue Aug 25, 2017 · 10 comments
Closed

VS 2015 support for ns2.0 causes conflicts with ref assembly facades #1539

dasMulli opened this issue Aug 25, 2017 · 10 comments
Labels
Milestone

Comments

@dasMulli
Copy link
Contributor

dasMulli commented Aug 25, 2017

Moving this out from dotnet/standard#467 (comment)

--

For Visual Studio 2015 there is a NuGet 3.6.0 VSIX at https://www.nuget.org/downloads that tells me to download the VS 2015 support from https://download.microsoft.com/download/0/F/D/0FD852A4-7EA1-4E2A-983A-0484AC19B92C/dotnet-standard-support-vs2015-2.0.0-win-x86.msi (though via an aka.ms link that I now no longer have in my clipboard)

However, giving this a try on that solution yields compile errors for conflicting references like this:

CSC : error CS1703: Multiple assemblies with equivalent identity have been imported: 'C:\Program Files (x86)\MSBuild\Microsoft\Microsoft.NET.Build.
Extensions\net461\ref\System.Xml.XmlSerializer.dll' and 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades
\System.Xml.XmlSerializer.dll'. Remove one of the duplicate references. [C:\Users\martin.ullrich\Downloads\TestNetStandardNugetPackage\TestNetStandar
dNugetPackage\TestNetStandardNugetPackage.csproj]

Same thing happens when creating a new .NET 4.6.1 console application in VS 2017 and adding a netstandard2.0 package (e.g. Microsoft.Extensions.Logging.Console).

Heres the diagnostic log of the build: msbuild.log.zip

cc @ericstj @dsplaisted - this is probably an sdk issue?

@dasMulli
Copy link
Contributor Author

From @ericstj

It looks like MSBuild is still adding the facades from the targeting pack. I haven't chased down the diff yet, but you should be able to workaround by setting ImplicitlyExpandDesignTimeFacades=false.

I believe the diff is this: dotnet/msbuild@40cd4d0

Indeed this is an SDK issue.

@dsplaisted
Copy link
Member

@terrajobst This is another issue with the .NET Standard facades you probably should be tracking

@dsplaisted dsplaisted modified the milestones: 2.0.x, 15.5 Oct 2, 2017
@livarcocc livarcocc modified the milestones: 2.1.0, 2.2.0 Nov 18, 2017
@MariusVolkhart
Copy link

I didn't know how to set ImplicitlyExpandDesignTimeFacades=false, so adding this for others who arrive here and need help.

You need to add <ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades> to a PropertyGroup in your .csproj file. This StackOverflow answer shows the final result.

@oflahero
Copy link

+1. thanks for sharing the knowledge - just saved me from NuGet/.netstandard/assembly redirect hell.

@asterixorobelix
Copy link

thanks for the suggestion @MariusVolkhart . Just so that other people know, that fix did not work for me

@livarcocc livarcocc modified the milestones: 2.1.3xx, 2.1.4xx Apr 16, 2018
@ericstj
Copy link
Member

ericstj commented May 17, 2018

@livarcocc any update? I think this is still blocking ns2.0 consumption in VS2015.

@livarcocc
Copy link
Contributor

It is marked for 2.1.4xx, which will ship with VS 15.8.

cc @dsplaisted

@Himanshu55007
Copy link

i ran into the same issue. What I did is just renamed the facades folder and it worked.

@mdownermindstream
Copy link

mdownermindstream commented Oct 5, 2018

Not sure if it helps, but for me this was due to having nuget packages for DLLs that also existed with local installed .NET versions. The project references seem to reference the local DLLs while the csproj file references the nuget packages. I removed the references in the project References section of the offending DLLs but kept the nuget packages installed. The offending DLLs/references were System.Runtime.Extensions.dll and System.Reflection.dll (existed in local 4.6.2), and the nuget packages for these two were added by adding the nuget package for Microsoft.Extensions.DependencyInjection.

Edit: adding ImplicitlyExpandDesignTimeFacades in the csproj file did not help.

Edit2: Note that the project will no longer have references to the DLL (might not be able to be used for using statements - still worked for System.Reflection?), but the build will copy the required DLL to the bin folder.

@livarcocc livarcocc modified the milestones: 2.2.1xx, 3.0.1xx Jun 12, 2019
@dasMulli
Copy link
Contributor Author

What's the status on this?
Do you want to ensure ns2.0 works in VS 2015 or just call it a day and not offer back-compat for VS 2015? I'd be in favour of that.. but then NuGet would need to update for 2015 to not offer installing these packages in the first place.

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

No branches or pull requests

10 participants