当我安装我的自定义NuGet包它可以工作,但VS中的输出窗口显示消息,就像它试图添加文件两次,他们已经存在.这篇文章中的产出进一步下降.
我在服务器上有一个NuGet私有存储库,用于托管我们的库.安装和卸载正在运行,即使输出窗口显示以下消息.我<files>对spec文件中的标记感到好奇,如果有不同的方法我需要这样做.我已经尝试了多种基于文档的方法.我的版本是从NuGet站点安装的最新版本.
从网站: The latest version of the nuget.exe command-line tool is always available from http://nuget.org/nuget.exe
输出窗口在Install-Package CustomNuGet上显示如下内容:
项目/Plugins/CustomNuGet/CSS/custom.css已存在.
项目/Plugins/CustomNuGet/Scripts/custom.js已经存在.
项目/Plugins/CustomNuGet/Views/custom.cshtml已经存在.
输出窗口在Uninstall-Package CustomNuGet上显示如下内容:
在您的工作区中找不到/Plugins/CustomNuGet/CSS/custom.css项.
在您的工作区中找不到/Plugins/CustomNuGet/Scripts/custom.js项.
在您的工作区中找不到/Plugins/CustomNuGet/Views/custom.cshtml项.
我使用命令行工具创建了一个自定义Nuget包.该文件夹如下所示:
/CustomNuGet
CustomNuGet.nuspec
CustomNuGet.0.1.1.nupkg
/content
/lib
CustomNuGet.dll
/Plugins
/Views
custom.cshtml
/Scripts
custom.js
/CSS
custom.css
Run Code Online (Sandbox Code Playgroud)
spec文件是使用:nuget spec和nuget pack根据文档的根CustomeNuGet文件夹中的包创建的.这是spec文件:
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>CustomNuGet</id>
<version>0.1.1</version>
<authors>CustomNuGet</authors>
<owners>CustomNuGet</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>CustomNuGet</description>
<tags>CustomNuGet</tags>
<references>
<reference file="CustomNuGet.dll" />
</references>
<dependencies>
<dependency id="WebActivatorEx" version="2.0.0" />
</dependencies>
</metadata>
<files>
<file …Run Code Online (Sandbox Code Playgroud)