15

I'm trying to create a nuget package which will both add a DLL and configure it inside of the proper configuration file. The package can be used in either a console/form application or a web application, so I want to update the appropriate configuration file, either app.config or web.config.

My files section in the .nuspec file contains the following inside of the section.

    <file src="config.transform" target="content\app.config.transform"/>
    <file src="config.transform" target="content\web.config.transform"/>

The .nupkg file does contain both of the transforms inside of the content folder.

When I add my package to a project in VS2010 through Manage NuGet Packages, the only file which is ever modified is the app.config file. Web.config is never touched. In fact, in a web application with an existing web config, NuGet will create an app.config file which contains the modifications.

Is there a way of doing what I'm trying to do (and if so, how)?

Thierry
  • 1,031
  • 7
  • 16

1 Answers1

8

According to a related bug report, it should already work how you want it to. Are you running the latest version of NuGet?

svick
  • 236,525
  • 50
  • 385
  • 514
Betty
  • 9,109
  • 2
  • 34
  • 48
  • 1
    This was totally my own fault. What I did not realize is that NuGet is apparently smarter than I am, and will only apply web.config updates in a web project. I had created a dll project and put both app.config and web.config in it to test my conversions. – Thierry Oct 09 '12 at 14:44