【发布时间】:2015-04-17 22:16:55
【问题描述】:
我有一个问题,即 nuget pack 在我的项目中将 web.config 重命名为 web.config.transform。我正在使用带有 nuspec 文件的 csproj 文件,并且 nuspec 文件中没有行告诉 nuget 重命名文件,但在输出和 nupkg 文件中,web.config 被重命名为 web.config。变换。
web.config 不是项目的一部分,它只是由 nuspec 文件添加(正常情况下,它是由构建过程生成的)
任何人都可以建议它为什么这样做 - 对我来说感觉就像 nuget 中的一个错误,但也许 csproj 文件中有一些东西被 nuget 用作进行重命名的指令?那会是什么?
命令:
nuget pack path\to\projectfile\myproject.csproj -OutputDirectory C:\temp\publish -Version 1.1.646.32517 -Exclude Template.config -Exclude Template.Debug.config -Exclude Template.Release.config -Verbosity detailed
输出:
Attempting to build package from 'myproject.csproj'.
Packing files from 'path\to\projectfile\bin'.
Using 'myproject.nuspec' for metadata.
Add file 'path\to\projectfile\bin\myproject.dll' to package as 'lib\net451\myproject.dll'
Add file ... to package as ...
...
Found packages.config. Using packages listed as dependencies
Id: myproject
Version: 1.1.646.32517
Authors: xxx
Description: myproject
Dependencies: Microsoft.AspNet.WebApi (= 5.2.3)
Added file 'content\ApiTestPage.html'.
Added file ........
.....
Added file 'content\Web.config.transform'.
Added file 'lib\net451\myproject.dll'.
Successfully created package 'C:\temp\publish\myproject.1.1.646.32517.nupkg'.
nuspec 文件:
<?xml version="1.0"?>
<package >
<metadata>
<id>$id$</id>
<version>$version$</version>
<title>$title$</title>
<authors>$author$</authors>
<owners>$author$</owners>
<description>$description$</description>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<releaseNotes>xxx release.</releaseNotes>
<copyright>Copyright xxx 2015</copyright>
</metadata>
<files>
<file src="bin\*.*" target="content\bin" />
<file src="web.config" target="content" />
</files>
</package>
提前致谢
克里斯
【问题讨论】:
-
找到任何解决方案吗?
标签: nuget