【发布时间】:2017-03-26 16:01:52
【问题描述】:
我正在尝试创建一个 NuGet 包,它只部署构建系统和通用开发人员实用程序使用的一些脚本。
这是.nuspec 文件内容:
<?xml version="1.0"?>
<package>
<metadata>
<id>Some.Scripts</id>
<version>1.0.0.0</version>
<title>Some Script Library</title>
<authors>Some Developers</authors>
<owners>Some Developers</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Contains scripts for general use in coding or build and deploy automation.</description>
<releaseNotes>Initial release.</releaseNotes>
<copyright>Copyright 2015</copyright>
<tags>PowerShell scripts automation TeamCity build tools</tags>
</metadata>
<files>
<file src=".scripts\**\*" target=".scripts\" />
</files>
</package>
磁盘上的文件夹结构是:
\GitRepos\Some-Scripts\
\GitRepos\Some-Scripts\Some.Scripts.nuspec
\GitRepos\Some-Scripts\.git
\GitRepos\Some-Scripts\.scripts\
\GitRepos\Some-Scripts\.scripts\someScript.ps1
NuGet.exe 3.3.0.212 产生此错误消息:
无法创建没有依赖项和内容的包
我正在做的事情可能吗?
更新
我最初发布了一个答案:
好的,我想我找到了问题所在。它不喜欢源文件夹 .scripts 中的前导句点,尽管它在目标文件夹中很酷。
虽然实际上只解决了一半的问题。虽然它制作了一个包并且文件在其中(在 WinZip 中查看),但安装失败:
无法安装软件包“Some.Scripts 1.0.0”。您正在尝试将此包安装到以“.NETFramework,Version=v4.6.1”为目标的项目中,但该包不包含任何与该框架兼容的程序集引用或内容文件。如需更多信息,请联系包作者。
更新 2
在 NuGet GitHub 上发现了这个错误报告,但在一个对我来说似乎无关的领域进行了一些工作后,它已被关闭。
【问题讨论】:
标签: nuget nuget-package