I installed the SlowCheetah package via nuget and added transform files for my web.config based on Build config. However, on building, the web.config does not get transformed. I checked my project file and did see entries for SlowCheetah PropertyGroup and Import elements. I dont see a target for transformation in the project file. If I add an app.config, the app.config file does get transformed. It is my understanding that installing the SlowCheetah package should automatically add the web.config transform target to the MSBuild file for the project. I can add it manually but I thought SlowCheetah does it out of the box. Am I missing something. Please do let me know. My requirement is that my web.config file should get transformed based on build configuration and the transformed web.config file should be located in the output directory. Thanks and appreciate all help.
相关问题
- Visual Studio 2019 - error MSB8020: The build tool
- Is It possible to build asp.net core project using
- Delete files older 6 months
- msbuild: build as to a appxbundle (AppxBundle=Alwa
- Programmatically adding and editing the Targets in
相关文章
- Build errors of missing packages in Visual Studio
- Copy different file to output directory for releas
- Why doesn't AutogenerateBindingRedirects work
- MSBuild - How to build multiple files AND projects
- Visual Studio Solution — Any way to create a “spec
- Invalid value for the configfile paramter of the g
- using Visual Studio to copy files?
- dotnet core 2 long build time because of long rest
Visual Studio is doing Transformation only when you deploy your project by using the publish functionality. To do it when you do the build you need to tweak your MSBuild script. The complete solution is here. Here the essentials:
Did you set the "copy to output directory" property of your transform files to "Do not copy" ? Please check also your project file.
In your project file the following entries should be added (depending the version you installed , in this case 2.5.7):
To elaborate on Philipp's answer I have found a possible simpler solution: No need for a Web.Base.Config and no problems with overwriting your web.config which causes problems in Source Control.