Web.Release.Config does not work

时间秒杀一切 提交于 2019-12-12 02:42:04

问题


I have a web site I just took over and am wanting to get web transformations working. I have always had success with MVC projects doing this for debug and release but this ASP web pages application refuses to cooperate.

I apologize if this is a duplicate. I see a lot of questions like this but nothing has solved my issue yet.

If I press F5 and run, I get web.config settings as I expect. If I publish my "Test" profile (debug mode) I get web.Test.Config transformations as expected. If I publish my "Release" profile I get the same web.Test.Config transformations and NOT the release one.

Possible issues or things that may be of interest:

The web.config file expands in the solution to show the debug file. The release file is not part of this and is listed separately below.

I tried changing the compilation setting for debug to false in the main web.config. This had no effect.

In the SLN file I noticed that I have lines in the GlobalSection for postSolution that list my project GUID followed by .Debug or .Release. BOTH of these say "Debug|Any CPU" at the end. I changed the release ones to say "Release|Any CPU". I republished but VS just changed this back to Debug on me.

In Build -> Configuration Manager, I select Release as thje Active soltion configuration. In the Project contexts box, my application only has Debug available in the Configuration column drop down.

Edit: I noticed that in website.publishproj there was no section for Release. There was a PropertyGroup with configuration of Debug but that's all. Being cavalier or stupid I ignored the "do not modify this file" message and added the release section. This had no effect.

Edit: Photo pasted in. The dropdown is expanded.


回答1:


The highlighted dropdown is where you would need to add the configuration back in:



来源:https://stackoverflow.com/questions/35382815/web-release-config-does-not-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!