Nuget Push(更新到包) - 在包管理器中显示为新安装

时间:2021-11-24 23:09:06

I have a very simple post build script which packages all dlls from my project to a custom nuget server. This works fine, however, when opening package manager from any solution, I see the nuget package as a new install, as opposed to the expected 'update' option.

我有一个非常简单的post build脚本,它将我项目中的所有dll打包到一个自定义nuget服务器。这很好,但是,当从任何解决方案打开包管理器时,我将nuget包视为新安装,而不是预期的“更新”选项。

The nuspec file I am using is:

我使用的nuspec文件是:

<?xml version="1.0"?>
<package >
  <metadata>
    <id>Objects.ForConsumers</id>
    <version>1.2015.1111.11</version>
    <title>Objects.ForConsumers</title>
    <authors>My Firm</authors>
    <owners>My Firm</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Objects For Consumers</description>
    <releaseNotes></releaseNotes>
    <copyright>Copyright 2015</copyright>
    <tags>Objects For Consumers</tags>
  </metadata>
  <files>
    <file src="*.dll" target="lib" />
  </files>
</package>

The version number is incremented with each build.

版本号随每次构建而增加。

The commands are essentially

命令本质上是

nuget pack Objects.ForConsumers.nuspec

nuget pack Objects.ForConsumers.nuspec

nuget push Objects.ForConsumers.1.2015.1111.12.nupkg -s http://nuget.myserver.com myApiKey

nuget push Objects.ForConsumers.1.2015.1111.12.nupkg -s http://nuget.myserver.com myApiKey

Can anyone suggest which this is happening?

任何人都可以建议这发生了什么?

Nuget Push(更新到包) - 在包管理器中显示为新安装

2 个解决方案

#1


0  

You have selected the "online" option on the panel/tab on the left. If you select "Updates" and search for your package, you should see the update button.

您已在左侧的面板/选项卡上选择了“在线”选项。如果选择“更新”并搜索包,则应看到更新按钮。

#2


0  

I finally stumbled over the resolution to this. My nuspec file has the following:

我终于偶然发现了解决方案。我的nuspec文件包含以下内容:

  <files>
    <file src="*.dll" target="lib" />
  </files>

I updated this as follows:

我将其更新如下:

  <files>
    <file src="*.dll" target="lib" />
    <file src="*.dll" target="lib/net40" />
  </files>

(Adding in the specific folder for my .net version) And all is working now!

(在我的.net版本的特定文件夹中添加)现在一切正常!

Hope this helps somebody else in the future.

希望这有助于将来的其他人。

#1


0  

You have selected the "online" option on the panel/tab on the left. If you select "Updates" and search for your package, you should see the update button.

您已在左侧的面板/选项卡上选择了“在线”选项。如果选择“更新”并搜索包,则应看到更新按钮。

#2


0  

I finally stumbled over the resolution to this. My nuspec file has the following:

我终于偶然发现了解决方案。我的nuspec文件包含以下内容:

  <files>
    <file src="*.dll" target="lib" />
  </files>

I updated this as follows:

我将其更新如下:

  <files>
    <file src="*.dll" target="lib" />
    <file src="*.dll" target="lib/net40" />
  </files>

(Adding in the specific folder for my .net version) And all is working now!

(在我的.net版本的特定文件夹中添加)现在一切正常!

Hope this helps somebody else in the future.

希望这有助于将来的其他人。