nuget pack将web.config重命名为web.config.transform

nuget pack将web.config重命名为web.config.transform,nuget,Nuget,我有一个问题,nuget pack在我的项目中将web.config重命名为web.config.transform。我正在使用csproj文件,旁边有一个nuspec文件,nuspec文件中没有一行命令nuget重命名该文件,但是在输出和nupkg文件中,web.config被重命名为web.config.transform web.config不是项目的一部分,它只是由nuspec文件添加的(通常由构建过程生成) 有人能告诉我为什么要这样做吗?我觉得这就像nuget中的一个bug,但也许在c

我有一个问题,nuget pack在我的项目中将web.config重命名为web.config.transform。我正在使用csproj文件,旁边有一个nuspec文件,nuspec文件中没有一行命令nuget重命名该文件,但是在输出和nupkg文件中,web.config被重命名为web.config.transform

web.config不是项目的一部分,它只是由nuspec文件添加的(通常由构建过程生成)

有人能告诉我为什么要这样做吗?我觉得这就像nuget中的一个bug,但也许在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>

$id$
$version$
$title$
$author$
$author$
$description$
假的
xxx发布。
版权所有xxx 2015
提前谢谢


Chris有同样的问题,我通过在我的nuspec文件中显式添加Web.config解决了这个问题

<package >
  <metadata>
    ...
  </metadata>
  <files>
    <file src="Web.config" target = ""/>
  </files>
</package>

不幸的是,我们已经有了这个问题,并尝试了“web.config”和“web.config”,但都没有为我们解决这个问题。nuget应该将一个转换文件放入输出包中,这很奇怪,所以我猜它是项目文件中的某个内容。找到了解决方案吗?
  <files>
    <file src="Web.config" target = ""/>
    <file src="*.asmx" target = ""/>
    <file src="*.asax" target = ""/>
    <file src="*.html" target = ""/>
    <file src="bin\*.dll" target="bin" />
  </files>