I have a problem that nuget pack is renaming web.config to web.config.transform in my project. I am using the csproj file with a nuspec file beside it, and there is no line in the nuspec file to tell nuget to rename the file, yet in the output and the nupkg file, web.config is being renamed to web.config.transform.
web.config is not a part of the project, it's just added by the nuspec file (as normal, it's generated by the build process)
Can anyone suggest why it's doing this - it feels to me like a bug in nuget, but maybe there is something in the csproj file which nuget is taking as an instruction to do the rename? What could that be?
command:
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
output:
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 file:
<?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>
Thanks in advance
Chris