nuget - Using a nuspec file create package containing only other packages - Stack Overflow

admin2025-04-16  6

I ran the above question thru AI and got the response that I had already tested and played around with. Essentially the .nuspec file ends up:

    <?xml version="1.0" encoding="utf-8"?>
    <package xmlns=".xsd">
      <metadata>
        <id>MCLibrary</id>
        <version>25.2.1</version>
        <title>MCLibrary</title>
 <some stuff deleted>
        <dependencies>
          <group targetFramework="net48">
            <dependency id="DevExpress.Xpo" version="[24.2.3,)" />
            <dependency id="SmartInspect" version="[3.5.0,)" />
            <dependency id="MCCode" version="[25.2.1,)" />
          </group>
          <group targetFramework="net8.0-windows10.0.17763">
            <dependency id="DevExpress.Xpo" version="[24.2.3,)" />
            <dependency id="SmartInspect" version="[3.5.0,)" />
            <dependency id="MCCode" version="[25.2.1,)" />
          </group>
        </dependencies>
        </metadata>
    </package>

The following image is the result after installation ...

As you can see, the required dependency "MCCode"is not installed.

MCCode and MCLibrary are both located in the same network folder and MCCode itself is an available choice to install via the Nuget window in VStudio etc.

I believe I've tried everything I can think of as well as perusing a few similar questions here.

I ran the above question thru AI and got the response that I had already tested and played around with. Essentially the .nuspec file ends up:

    <?xml version="1.0" encoding="utf-8"?>
    <package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd">
      <metadata>
        <id>MCLibrary</id>
        <version>25.2.1</version>
        <title>MCLibrary</title>
 <some stuff deleted>
        <dependencies>
          <group targetFramework="net48">
            <dependency id="DevExpress.Xpo" version="[24.2.3,)" />
            <dependency id="SmartInspect" version="[3.5.0,)" />
            <dependency id="MCCode" version="[25.2.1,)" />
          </group>
          <group targetFramework="net8.0-windows10.0.17763">
            <dependency id="DevExpress.Xpo" version="[24.2.3,)" />
            <dependency id="SmartInspect" version="[3.5.0,)" />
            <dependency id="MCCode" version="[25.2.1,)" />
          </group>
        </dependencies>
        </metadata>
    </package>

The following image is the result after installation ...

As you can see, the required dependency "MCCode"is not installed.

MCCode and MCLibrary are both located in the same network folder and MCCode itself is an available choice to install via the Nuget window in VStudio etc.

I believe I've tried everything I can think of as well as perusing a few similar questions here.

Share Improve this question edited Feb 3 at 7:03 DarkBee 15.5k8 gold badges72 silver badges118 bronze badges asked Feb 3 at 6:54 DavidDavid 1,0582 gold badges13 silver badges31 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

As you can see, the required dependency "MCCode" is not installed.

May i confirm with you that if this package "MCCode" is customized and hosted on your local/third-party feed? Because I can't find this package in "nuget.org"(https://api.nuget.org/v3/index.json).

If so, please upload package "MCCode" to your local/third-party feed and add these package sources to Nuget.Config file.

<packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="localfeed" value="your local/third-party feed location" />
 </packageSources>

You can also configure package source via Tools->Nuget Package Manager in Visual Studio.

Test Result:

转载请注明原文地址:http://anycun.com/QandA/1744776347a87466.html