Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Referencing a .NET Standard library from an ASP.NET web application

$
0
0

The title really says it all already. I have a website running on .NET 4.8.1. And a whole bunch of libraries that are currently also targetting .NET 4.8.1.

I want to use a lot of these libraries in a new .NET Core application.Because one of these libraries contained a lot of references to membership which is no longer included in .NET Standard/.NET Core, I changed the membership to Identity. I put a few of these files in a new project that targets .NET Standard 2.0, so that I can also use identity in a new Blazor web application in the future.

However when I reference this project from my ASP.NET web application, Visual Studio does not show any build errors, but when I try to run the web application, I get the following error:

Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

How can I make sure this works?

I tried updating my ASP.NET web application to package reference, but then Visual Studio throws an error saying my project is not applicable for updating to package reference.

Is there a way to make this work? Tried installing netstandard.library through nuget but also this did not work.

Thanks


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>