ASP.Net Web Application Add Config Transform Grayed Out

前端 未结 6 1631
自闭症患者
自闭症患者 2020-12-08 01:20

I added an existing ASP.Net web application project to my solution. In addition to the standard debug and release configurations this solution also has two custom configurat

6条回答
  •  太阳男子
    2020-12-08 02:02

    I solved this by realizing two things:

    1. There is a Solution level configuration, and there are Project level configurations. The web.MyConfigName.config is created based on project level configurations.
    2. It seems that Visual Studio 2017 Configuration Manager bases what configurations to add from the (hidden) obj folder. Deleting the obj folder for the project and rebuilding will update the project with the configurations you've added.

    To make the option "add config transform" available follow these steps:

    1. Make sure you have enabled to Show Hidden Files
    2. Open configuration manager for the Solution
    3. Pick the relevant Solution config, then in the dropdown next to your project pick or and add, remove or edit what Project configs you want.
    4. Delete the obj folder in your project. Rebuild. Make sure you save the changes to your project and solution files. I also restarted visual studio, because why not. Verify that you see all your project configs as folders in your obj folder.
    5. Right-click web.config and add your config transformation.

    Hope it helps someone. :)

提交回复
热议问题