Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Some packages with only pre-release versions can not be used as dependencies



  • This seems to be intermittent, but it really makes installing pre-release packages annoying.

    Lets say you have 2 packages:

    • Foo (version 1.0.0-pre)
    • Bar (version 1.0.0-alpha)

    And Bar has a dependency on Foo (version 1.0.0-pre)

    Attempting to install it via the Package Manager Console fails:

    PS> Install-Package Bar -Version 1.0.0-alpha 
    Attempting to resolve dependency 'Foo (≥ 1.0.0-pre)'.
    Install-Package : Unable to resolve dependency 'Foo (≥ 1.0.0-pre)'.
    At line:1 char:1
    + Install-Package Bar -Version 1.0.0-alpha  -Source  ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
        + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand    
    

    It is easy to tell which packages have this problem in the ProGet website. If you navigate to /feeds/default/Bar/1.0.0-alpha, you will see the dependency on Foo. If you click the link, it will just bring you back to the default feed page. On packages that have a stable version (and some that don't), this will bring you to the package's page.

    Product: ProGet
    Version: 3.5.5



  • Pre-release packages on NuGet are, unfortunately, very finicky and hard to get working right. On top of that, there are many different ways to query nuget.org for a single package depending on the context (Pre-Release, package restore), and those ways are not documented.

    Can you do a fiddler trace to see what specific URL on the ProGet side is failing?



  • It is failing to resolve the package when it calls FindPackageById. The response includes the package with the correct version, so I'm quite confused why it isn't resolving. Here is a sanitized view (note that there are multiple pre-release packages, and the version I actually want is 1.0.0.0-RDM, but it fails if the dependency is on 1.0.0.0-RM, too):

    Request:

    GET http://proget/nuget/default/FindPackagesById()?id='Foo' HTTP/1.1
    DataServiceVersion: 1.0;NetFx
    MaxDataServiceVersion: 2.0;NetFx
    User-Agent: NuGet VS PowerShell Console/2.8.50926.663 (Microsoft Windows NT 6.1.7601 Service Pack 1, VS Premium/12.0)
    NuGet-ProjectGuids: {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
    Accept: application/atom+xml,application/xml
    Accept-Charset: UTF-8
    Accept-Encoding: gzip, deflate
    Host: proget
    

    Response:

    <feed xmlns="http://www.w3.org/2005/Atom">
        <title type="text">Packages</title>
        <id>http://proget/nuget/default/FindPackagesById()/</id>
        <updated>2015-03-20T18:54:31Z</updated>
        <link rel="self" title="FindPackagesById" href="FindPackagesById" />
        <entry>
            <id>http://proget/nuget/default/Packages(Id='Foo',Version='1.0.0.0-RM')</id>
            <title type="text">Foo</title>
            <summary type="text"></summary>
            <updated>2015-03-18T16:41:40Z</updated>
            <author>
                <name>Abraham</name>
            </author>
            <link rel="edit-media" title="Package" href="Packages(Id='Foo',Version='1.0.0.0-RM')/$value" />
            <link rel="edit" title="Package" href="Packages(Id='Foo',Version='1.0.0.0-RM')" />
            <category term="NuGet.Server.DataServices.Package" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
            <content type="application/zip" src="http://proget/nuget/default/package/Foo/1.0.0.0-RM" />
            <m:properties>
                <d:Version>1.0.0.0-RM</d:Version>
                <d:Dependencies>Microsoft.ApplicationBlocks.ExceptionManagement:1.0.0.1|Logging:1.0.0.0</d:Dependencies>
                <d:IsLocalPackage m:type="Edm.Boolean">true</d:IsLocalPackage>
                <d:IsLatestVersion m:type="Edm.Boolean">false</d:IsLatestVersion>
                <d:IsAbsoluteLatestVersion m:type="Edm.Boolean">true</d:IsAbsoluteLatestVersion>
                <d:IsProGetHosted m:type="Edm.Boolean">true</d:IsProGetHosted>
                <d:IsPrerelease m:type="Edm.Boolean">true</d:IsPrerelease>
                <d:NormalizedVersion>1.0.0.0-RM</d:NormalizedVersion>
                <d:IsProjectPackage m:type="Edm.Boolean">false</d:IsProjectPackage>
                <d:Listed m:type="Edm.Boolean">true</d:Listed>
            </m:properties>
        </entry>
        <entry>
            <id>http://proget/nuget/default/Packages(Id='Foo',Version='1.0.0.0-RDM')</id>
            <title type="text">Foo</title>
            <summary type="text"></summary>
            <updated>2015-03-11T17:50:23Z</updated>
            <author>
                <name>Abraham</name>
            </author>
            <link rel="edit-media" title="Package" href="Packages(Id='Foo',Version='1.0.0.0-RDM')/$value" />
            <link rel="edit" title="Package" href="Packages(Id='Foo',Version='1.0.0.0-RDM')" />
            <category term="NuGet.Server.DataServices.Package" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
            <content type="application/zip" src="http://proget/nuget/default/package/Foo/1.0.0.0-RDM" />
            <m:properties>
                <d:Version>1.0.0.0-RDM</d:Version>
                <d:Dependencies>Microsoft.ApplicationBlocks.ExceptionManagement:1.0.0.1|Logging:1.0.0.0</d:Dependencies>
                <d:IsLocalPackage m:type="Edm.Boolean">true</d:IsLocalPackage>
                <d:IsLatestVersion m:type="Edm.Boolean">false</d:IsLatestVersion>
                <d:IsAbsoluteLatestVersion m:type="Edm.Boolean">false</d:IsAbsoluteLatestVersion>
                <d:IsProGetHosted m:type="Edm.Boolean">true</d:IsProGetHosted>
                <d:IsPrerelease m:type="Edm.Boolean">true</d:IsPrerelease>
                <d:NormalizedVersion>1.0.0.0-RDM</d:NormalizedVersion>
                <d:IsProjectPackage m:type="Edm.Boolean">false</d:IsProjectPackage>
                <d:Listed m:type="Edm.Boolean">true</d:Listed>
            </m:properties>
        </entry>
        <entry>
            <id>http://proget/nuget/default/Packages(Id='Foo',Version='1.0.0.0-PF')</id>
            <title type="text">Foo</title>
            <summary type="text"></summary>
            <updated>2015-03-11T17:50:23Z</updated>
            <author>
                <name>Abraham</name>
            </author>
            <link rel="edit-media" title="Package" href="Packages(Id='Foo',Version='1.0.0.0-PF')/$value" />
            <link rel="edit" title="Package" href="Packages(Id='Foo',Version='1.0.0.0-PF')" />
            <category term="NuGet.Server.DataServices.Package" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
            <content type="application/zip" src="http://proget/nuget/default/package/Foo/1.0.0.0-PF" />
            <m:properties>
                <d:Version>1.0.0.0-PF</d:Version>
                <d:Dependencies>PostSharp:2.0.10.3-pre|Microsoft.ApplicationBlocks.ExceptionManagement:1.0.0.1|Logging:1.0.0.0</d:Dependencies>
                <d:IsLocalPackage m:type="Edm.Boolean">true</d:IsLocalPackage>
                <d:IsLatestVersion m:type="Edm.Boolean">false</d:IsLatestVersion>
                <d:IsAbsoluteLatestVersion m:type="Edm.Boolean">false</d:IsAbsoluteLatestVersion>
                <d:IsProGetHosted m:type="Edm.Boolean">true</d:IsProGetHosted>
                <d:IsPrerelease m:type="Edm.Boolean">true</d:IsPrerelease>
                <d:NormalizedVersion>1.0.0.0-PF</d:NormalizedVersion>
                <d:IsProjectPackage m:type="Edm.Boolean">false</d:IsProjectPackage>
                <d:Listed m:type="Edm.Boolean">true</d:Listed>
            </m:properties>
        </entry>
    </feed>


  • This is a bug in NuGet that seems to have started happening in 2.8.

    We rolled back, to 2.7... and that caused other bugs... we went back to 2.6... which had different bugs. So, we got off pre-release packages. They're a serious pain.



  • Thanks for the info, Brad. Unfortunately, we aren't going to be able to get off the pre-release package train anytime soon. Hopefully they can fix this in an upcoming release.

    I do find it extremely strange that the ProGet website acts differently if there are stable packages, than if there aren't. Why does navigating to http://proget/feeds/default/Bar bring you to a stable package if it exists, but will redirect to the feed directory if it doesn't (even if there are pre-release packages)?



  • NuGet does not really supported having prerelease packages without a non-prerelease package. It creates a lot of unknown/unpredictable versions, in most of the client and server versions we tested.

    Suggest you create a baseline version (0.0.0) or something to work around this.



  • Okay, Alana, thanks for your help. We will do just that.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation