Home

No usable .NET assemblies in NuGet package

I'm having intermittent issues including some NuGet packages into LINQPad.

Like some, we run an internal instance of the NuGet gallery and host our own packages. I've been successful in connecting to our gallery, viewing the packages and even including some, but others give me the following error: "There are no usable .NET assemblies in package ''."

After looking into the few packages that fail, I seem to notice a trend. All the packages that fail were compiled using the .NET 4.5.1 framework whereas the ones that work were compiled using 4.5.

I found the thread with the few others that were getting this error with other packages and verified that my packages contain the lib folder with the appropriate net451 underneath it that contains the assembled .dll.

Best guess so far is LINQPad is not looking for the net451 folder or cannot include assemblies that were compiled using 4.5.1.

To further test, I'm going to compile the same assemblies under 4.5 and include them in the packages as well and see if that works.

Comments

  • To double back, when I built for .NET 4.5 as well as 4.5.1 and added both versions of the assembly to the same package it loaded correctly.
  • This has become a show stopper for us. We have to use 4.5.1 and can't build in 4.5. Is there any way to tell it to look in the net451 folder?
  • Thanks for the heads-up. I'll fix this in next week's build.
  • The new beta build is now out:
    www.linqpad.net/beta.aspx
  • Hi, I'm experiencing this issue with the package SharpDX in LinqPad 4.51.03.
  • The SharpDX package doesn't work for a different reason: it's specially crafted to work with Visual Studio projects only. Take a look inside the package and you'll see that the lib folder is empty. Instead, they've included a PowerShell script to add the necessary references to a Visual Studio project.
  • Ah that sucks, thanks for looking...
  • I m still facing an issue in beta release for adding jquery reference through Nuget
  • Isn't jquery purely a Javascript library?
  • I'm now having this issue with the latest RavenDB Client nuget packages (v3.0), rendering me unable to execute a lot of my scripts.

    I'm using the latest LINQPad beta v4.52.04, but I've also tried 4.51.03 with no luck there either.

    The affected RavenDB Client v3.0 nuget packages only have a lib\net45 directory for their assemblies.

    Previous RavenDB Client nuget packages (e.g. v2.5) always worked for me in LINQPad. The only differences that I can see are that the prior versions had lib\net40, lib\net45, and lib\sl50 directories, and that its nuspec file has a node which v3.0 is missing.
  • Same error for Microsoft Enterprise Library - Logging Application Block 6.0.1304
    tested on LiqPad v4.52.04 (beta) & v4.51.03
  • I just noticed that my last post was stripped of a word I'd meant it to include:
    The only differences that I can see are that the prior versions had lib\net40, lib\net45, and lib\sl50 directories, and that its nuspec file has a <dependencies> node which v3.0 is missing.
  • lethek and cilerer: I've just tested both of those packages and am not getting any errors. What does Environment.Version return on your machines?
  • Hi Joe, I've two main dev PCs that I use, one is currently running Windows 10 Tech Preview, the other Windows 8.1. Both give me Environment.Version 4.0.30319.0.

    I tried EnterpriseLibrary.Logging just now too and had the same problem.
  • 4.0.30319.0 is the number for .NET Framework 4.0.

    .NET 4.5 has the version 4.0.30319.17929
    .NET 4.5.1 has the version 4.0.30319.18444

    LINQPad thinks you're running Framework 4.0 and so it will not use the 4.5 NuGet references.

    This is peculiar because I thought that Windows 8.1 came pre-installed with Framework 4.5.
  • edited December 2014
    It's very odd... :/

    I compiled a console app in VS2013 just now, targeting the .NET 4.5 framework and it also reported version 4.0.30319.0. Tried targeting 4.5.1, and that too reported version 4.0.30319.0.

    I then tried downloading and running the installer for the .NET 4.5 framework, but it refused to install saying that 4.5 is already part of the operating system, and that the same or higher version has already been installed. Note, I'm currently using my Windows 10 Preview PC at the moment, but in about an hour I'll be sitting at my Windows 8.1 one and can check that.

    Edit:
    My Windows 8.1 machine is showing the exact same behaviour.
  • I've come across a couple posts on StackOverflow (such as http://stackoverflow.com/questions/16137658/system-environment-version-providing-an-inaccurate-value) that suggested testing whether 4.5 is installed by checking whether a new class, ReflectionContext, is available, e.g.:
    public static bool IsNet45OrNewer() { // Class "ReflectionContext" exists from .NET 4.5 onwards. return Type.GetType("System.Reflection.ReflectionContext", false) != null; }
    Such code is returning true for me in the same LINQPad script that returns 4.0.30319.0 for Environment.Version.

    After reading http://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx, I've looked at the relevant keys in the registry of this PC (Win 8.1 x64).

    HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client\Release = 381029 (.NET Framework 4.6 Preview)
    HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client\Version = 4.5.53349
    HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client\1033\Release = 381029 (.NET Framework 4.6 Preview)
    HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client\1033\Version = 4.5.53349
    HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client\2052\Release = 378675 (.NET Framework 4.5.1 installed with Windows 8.1)
    HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client\2052\Version = 4.5.51641

    HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Release = 381029 (.NET Framework 4.6 Preview)
    HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Version = 4.5.53349
    HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\1033\Release = 381029 (.NET Framework 4.6 Preview)
    HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\1033\Version = 4.5.53349
    HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\2052\Release = 378675 (.NET Framework 4.5.1 installed with Windows 8.1)
    HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\2052\Version = 4.5.51641

    HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4.0\Client\Version = 4.0.0.0

    Note, I've also apparently got the 4.6 Preview installed, I believe it was included when I installed the VS2015 Preview recently (on both machines).
  • OK, I'll add the type check to the next build.
  • I downloaded the current build and it seems to be working, but there's no Date on the beta page. Is there any way for us to know when the most recent build was produced so that we can be sure we're getting a new one as of a given post by you? :)
  • Hi there - I'm using LINQPad latest stable (also tried beta) and am running Windows 10 Technical Preview build 9926. My Environment.Version is coming back as 4.0.30319.0 but I am able to see .Net 4.5 specific DLLs (like "System.Reflection.ReflectionContext"). So for now I am unable to use LINQPad with my own nuget packages that are .Net 4.5.1, which is causing trouble internally! :)
  • Hi, I'm using LINQPad 4.56.06 and I also can't access .NET4.5.1 NuGet packages.

    Environment.Version reports 4.0.30319.0

    I've got Visual Studio 15 RC installed.
Sign In or Register to comment.