-
Notifications
You must be signed in to change notification settings - Fork 424
Running an application targeted for net461: Could not load file or assembly 'System.Runtime, Version=4.1.0.0' #295
Comments
Do you have a package reference to NETStandard.Library package in your net461 project? |
No, I didn't have it earlier but added it now and was able to proceed further. I am now hitting an issue with Error
You can find the diagnostic msbuild log file here: packagereference <PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.4.0-*" />
<PackageReference Include="NETStandard.Library" Version="2.0.0-*" /> generated binding redirects <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
</assemblyBinding> assets.json "System.Runtime.InteropServices.RuntimeInformation/4.4.0-preview1-25210-01": {
"type": "package",
"frameworkAssemblies": [
"mscorlib"
],
"compile": {
"ref/netstandard1.1/System.Runtime.InteropServices.RuntimeInformation.dll": {}
},
"runtime": {
"runtimes/win/lib/net45/System.Runtime.InteropServices.RuntimeInformation.dll": {}
}
}, |
It looks like your log file got cut off right in the middle of the ResolveAssemblyReferences target which generates the binding redirects so I wasn't able to see if the resolution looks correct. Can you please update the log file to included the full one? |
I put a new file |
Looks like we have a bug in the latest version of this package. The workaround however shouldn't really be needed any longer. Can you instead reference the "4.3.0" version of the RuntimeInformation package instead, assuming it is still needed. |
Now we have a desktop-specific NETStandard support package (NETStandard.Library.NETFramework) which should be used instead of NETStandard.Library. With this package no additional reference is required for System.Runtime.InteropServices.RuntimeInformation. This should be available after the next successful corefx build on the dotnet-core myget feed. |
I'm a bit fuzzy on some of this stuff, but are there cases (maybe System.Memory? Or the package mentioned earlier in this thread?) where a library/app, in addition to referencing the NuGet package it wants, must also reference an additional library that brings some additional implementation/references? In other words, is the following statement true?
|
Installing NetStandardLibrary in my nunit 2.6.4 / .net framework 4.6.2 (not .netcore) unit tests project fixed my System.Runtime filenotfoundexception. |
I am trying to run the MusicStore app on net461 and I am hitting the following error:
My machine has .NET Framework 4.7 installed
cc @pranavkm
The text was updated successfully, but these errors were encountered: