-
Notifications
You must be signed in to change notification settings - Fork 426
Referencing a .net standard class library project in .net Framework web app and System.IO.FileNotFoundException throws #410
Comments
I had the same problem with a simple net framework console application that references a netstandard library and as workaround I had to install packages in the console application. This is an important issue to fix because the problem manifest only at runtime so I should have to manually add all of the netstandard libraries references. Attached a repro, just try to execute the console app that recall a function built on the netstandard library using System.IO.File, it will result in the follow
|
Not completely sure about this, but do you have the NetStandard.Library NuGet installed? |
Yes, I it was included automatically when I created the ".NET Standard 1.4" class library csproj
here more info about the environment I used: vs
msbuild
|
I encountered this too, using vs 2017 15.3 preview 7, dependencies (nuget packages) of netstandard libraries are not copied/resolved on .netFramework projects, and you only get a runtime error. |
It sounds like you guys are hitting this issue dotnet/sdk#901. Can you try the workarounds listed there and see if that helps? |
@valeriob @devel0 @mesuttalebi are you unblocked here? BTW if you haven't already you'll want to upgrade to released .NET Core 2.0 / VS 15.3 |
I am running into this as well. I haven't been able to solve this. I might be missing something but I did not see any workarounds in dotnet/sdk#901 I'm already on VS15.3 en Core/Standard 2.0, but it still doesn't work |
I'm hitting this issue as well. Will create a repro tonight. |
I have the same issue using VS 15.3 (release) |
@ericstj @weshaggard can you please help troubleshoot this one... |
As I reported on dotnet/sdk#901 I was able to get this to correctly work by putting |
Just so all the information is on this thread the workaround is: For anyone that might still be hitting this you can workaround it by explicitly making the .NET Framework project a ProjectReference based project by setting the following property in the project:
I'm going to close this issue and if there are further questions/issue please take the conversation to dotnet/sdk#901. |
@weshaggard TYVM for the workaround. Worked a treat. Although now I have a million new compiler warnings since my Stylecop analysers in the .NET Standard project are now being included in my .NET 4.6.1 unit tests :/ |
2018.07.02 same problom vs2017 15.7.3 |
@weshaggard I am using asp.net website project(webform), and there is no csproj file to edit. |
Find solution here,
|
Created a .net Standard 1.4 class library, and then used it in a web application created by targetting .netframework 4.6.2. when running web application the blow exception was thrown.
Could not load file or assembly 'System.Security.Claims, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
I tested same library with .net core web application and there was no error.
in .netframework web application manually installed system.security.claims 4.3 nuget package solved the problem.
I can't understand if this error is for Visual Studio 2017 tooling or Nuget package manager's package restore. but I think it should be solved.
The text was updated successfully, but these errors were encountered: