.Net Core 2.0 SDK causes ASP.Net 1.1 Web App with project references to break
See original GitHub issueAfter I installed the .Net Core 2.0 SDK I started getting an InvalidOperationException: Can not find assembly file Microsoft.CSharp.dll at 'C:\Projects\Temp\VS2017Issue\WebApplication1\bin\Debug\net462\refs,C:\Projects\Temp\VS2017Issue\WebApplication1\bin\Debug\net462\
error at runtime on a web application that references a class library project.
If I remove the class library project reference then the runtime error goes away.
Falling back to the .Net Core 1.0.4 SDK (uninstall 2.0 or use global.json to target 1.0.4) also fixes the issue.
I have a sample app that reproduces the issue at https://github.com/squareitechnologies/VS2017Issue
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:26 (14 by maintainers)
Top Results From Across the Web
Migrate from ASP.NET Core 1.x to 2.0
This article outlines the prerequisites and most common steps for migrating an ASP.NET Core 1.x project to ASP.NET Core 2.0.
Read more >Netcore 2.1.1 release leads to app failing to run
Web.csproj : error NU1107: Version conflict detected for Microsoft.AspNetCore.Antiforgery. Reference the package directly from the project to ...
Read more >Please stop lying about .NET Standard 2.0 support!
In this post I have a bit of a rant about Microsoft's NuGet packages lying about supporting .NET Standard 2.0 when they kinda...
Read more >Upgrading to .NET Core 2.0 Preview - Rick Strahl's Web Log
Changing the target of the Web API project to .NET Core App 2.0; In the Web Project adding a reference to Microsoft.AspNetCore.All; In...
Read more >.NET core vs .NET framework
Wondering about the difference between .NET Core & .NET Framework? Here's a quick guide on how to pick the right runtime environment for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I believe this may be an issue of new logic to generate the deps.json file requiring a new version of
Microsoft.Extension.DependencyModel
that include https://github.com/dotnet/core-setup/commit/35749847a0fa555e2c758da17f52b6eaef2164be (or some other change).Adding a reference to the new NuGet package for the ASP.NET Core 1.1 app resolves the issue in @jeffpapp’s example project on my machine:
cc @eerhardt
I managed my project to build with SDK 1.0.4 after commenting this out in file Microsoft.NET.Build.Extensions.NETFrameworks.targets
although I do not think it is a smart move.
UPDATE: Silly me, I just added
<DependsOnNETStandard>netstandard1.6</DependsOnNETStandard>
as @TomGroeneboer wrote. Works perfect for me.