简体   繁体   中英

Same web service project, different configuration, can't debug

I have created a C# web service, a web client, and successfully debugged the service with ASP.NET Development Server (that thingy that gets activated when you just press F5). All fine. Now I need a web service that is almost the same as previous, but differs in a few lines of code. For this purpose I created two new configurations, DebugNew and ReleaseNew, and set the output directory to binNew (instead of default "bin"). The problem is that original web service is executed in debugger, instead of new web service. The debugger is unaware of binNew folder. How to set up the environment to start new web service if DebugNew configuration is active?

As far as I know, web applications will only run out of the bin folder. If somebody knows how to change that, I would be happy to call myself wrong in order to learn that trick myself.

Assuming that I am actually correct for once there, you could write a post compile script that checks which build configuration is active. If it's either DebugNew or ReleaseNew, copy the contents from binNew to bin.

If there's really only a few lines of code different though, I question whether or not putting a configuration setting in and adjusting the code accordingly isn't a better way to go. But, I certainly don't know all the facts. Just a thought I had.

I established a truce with Visual Studio (or unconditionally surrendered, depending on the point of view), and reverted output directory back to \\bin. At least the setup project, which is in the same solution, maintains separate folders for each configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM