c# - 创建包时找不到文件

标签 c# asp.net visual-studio-2015 nuget nuget-package

这是第一次尝试创建 Nuget包。

我尝试运行以下命令:

nuget.exe pack Package.nuspec

但我得到以下异常:

NuGet.exe : File not found: 'Site1.Master'. At line:1 char:10 + nuget.exe <<<< pack Package.nuspec + CategoryInfo : NotSpecified: (File not found: 'Site1.Master'.:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError


Package.nuspec 中的文件部分是这样的:

<files>
    <file src="Site1.Master" target="content\Site1.Master" />
    <file src="Site1.Master.cs" target="content\Site1.Master.cs" />
    <file src="Site1.Master.cs.designer" target="content\Site1.Master.cs.designer" />
</files>

我的示例解决方案是这样的:

enter image description here


目录:

enter image description here

最佳答案

.nuspec 文件中的路径始终相对于 .nuspec 文件本身的位置。要么是文件名错误,要么是目录路径错误。

关于c# - 创建包时找不到文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40845293/

相关文章:

Javascript:SetTimeout 和 ClearTimeout 重置。

c# - 如何确保 C# 项目中配置文件的更改导致 DLL 重建?

c# - Selenium - 强制点击不可见元素

c# - SignalR 2.0 CORS Chrome 禁用网络安全奇怪行为

c# - ServiceStack.Net 的多个可选参数

c# - 使用通配符在 csproj 中包含内容

c - "void main()"在 Visual Studio 中允许,但在 Eclipse 中不允许

c# - 从 WPF 应用程序注销 Azure Active Directory 应用程序?

c# - 在ABP中从CrudAppService检索子实体

c# - 使用 Crystal 报表导出为pdf文件