.NETStandard 2.0 packages: No usable .NET assemblies in package
Hey, I’m trying to consume the aspnetcore-dev MyGet feed for prerelease version of ASP.NET Core and related packages.
In particular, I’m trying to load the following packages:
https://dotnet.myget.org/feed/aspnetcore-dev/package/nuget/Microsoft.EntityFrameworkCore
https://dotnet.myget.org/feed/aspnetcore-dev/package/nuget/Microsoft.Extensions.Logging
https://dotnet.myget.org/feed/aspnetcore-dev/package/nuget/Microsoft.Extensions.Configuration
I keep getting the error message “There are no usable .NET assemblies in package 'XY'.” regardless of which version I attempt to download.
I assume this may be an error with the .NET framework version since those prerelease packages need .NETStandard 2.0. So I made sure that I have the .NET Framework 4.7 installed (which should implement .NETStandard 2.0) and tried the latest LINQPad beta, but that didn’t help.
Is there some fix required in LINQPad to make this work, or am I doing something wrong?
In particular, I’m trying to load the following packages:
https://dotnet.myget.org/feed/aspnetcore-dev/package/nuget/Microsoft.EntityFrameworkCore
https://dotnet.myget.org/feed/aspnetcore-dev/package/nuget/Microsoft.Extensions.Logging
https://dotnet.myget.org/feed/aspnetcore-dev/package/nuget/Microsoft.Extensions.Configuration
I keep getting the error message “There are no usable .NET assemblies in package 'XY'.” regardless of which version I attempt to download.
I assume this may be an error with the .NET framework version since those prerelease packages need .NETStandard 2.0. So I made sure that I have the .NET Framework 4.7 installed (which should implement .NETStandard 2.0) and tried the latest LINQPad beta, but that didn’t help.
Is there some fix required in LINQPad to make this work, or am I doing something wrong?
Comments
For example:
1) Add Microsoft.Extensions.DependencyInjection 2.0.0 (which used to not be possible in the previous version of LINQPad).
2) Notice that there are no namespaces that can be added, but go ahead and add the namespace "Microsoft.Extensions.DependencyInjection" manually
3) Notice that when you try to use the "ServiceCollection" class, most of the methods and extension methods are not displayed, and you get the following error:
4) So, then I try and add the netstandard 2.0 nuget package, and I get the following error:
Thanks!
https://github.com/dotnet/sdk/issues/1220
https://github.com/dotnet/sdk/issues/1267
https://github.com/dotnet/sdk/issues/1488
https://github.com/dotnet/msbuild/issues/2481
Wish I could help more than that. I have some idea how to work with the stuff using project files now, but I have no idea how that could be applied to however LINQPad compiles stuff
https://www.linqpad.net/download.aspx#beta
If you're still having trouble, please run the following query to determine the exact framework version:
http://share.linqpad.net/37mvfc.linq
and also tell me your OS version.
Thanks
I’m just hitting one more error, which I have fortunately already seen myself. Exactly this one: https://github.com/aspnet/Logging/issues/697
It seems that LINQPad needs to be set up to generate binding redirects by default. Of course, again no idea how you do that without MSBuild ;D
When I consume Microsoft.Extensions.Logging.Console, I get a different error - that System.Runtime.InteropServices.RuntimeInformation cannot be found - not that it has an invalid manifest.
I've uploaded a new build that fixes the file-not-found error. Can you please test this and let me know. If you're still getting an error, I might be able to fix it if you can post a step-by-step repro.
I’ll let you know if I encounter any other problem, but I’ll assume that it is working fine now (until the next NuGet Update? >_<"). Thanks a lot for your help!
---------------------------
Cannot load assembly: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
---------------------------
How do I fix this problem?
Thanks,
Homero
This error occurs when I try to make a new connection using my lib, in dotnet standard 2.0.
Span<T>
type from the System.Memory NuGet package (using version 4.4.0-preview1-25305-02).The following code causes a FileNotFoundException for
System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0
.I’m back at work now, and tried to do the same there, and the package is not listed there, although I’m using the same version of everything (at least I think?).
I tried clearing the package cache but that also didn’t help. I also tried both the older 5.27.01 (where the issue originally appeared), and the newer 5.28.00.
Interestingly, I also tried the same on a virtual machine that is running 4.7.1 and it is working there. But when I tried it there, I did get a new license agreement dialog when adding the package (which also included CompilerServices.Unsafe there), while I don’t get that anymore on my main machine. So I wouldn’t be too surprised if there’s actually a cache somewhere?
---
welp, I just did things (don’t know what exactly; looked through my NuGet config, cleared more cached things in AppData/Local/NuGet/, manually removed “System.Memory” items there), and suddenly it’s working. No idea what exactly caused this now But at least it’s solved now…?
The computer is Windows 10 Pro 64 bit with 8GB of ram. I have installed the latest .Net framework and tried every version of LINQPad. I have purchased the full version of the software but I have not activated it yet.
I'm getting this in v5.36.03 and latest beta v5.37.01 (Any Cpu)