问题
Is there a way to debug a (.NET c#) console application inside of a web application project? I want to be able to have a console application inside my web app for quick testing without having to use a separate solution. This allows me to quickly test a lot of my services without having to create a web page.
It allows me to add the console app without any problems. I can run it as well by setting it as the statup project although even though I use F5, it doesn't actually rebuild the console app. I have to right click on the project and say rebuild. Also none of the breakpoints get hit and I can't attach to the process either.
I'm thinking this is probably some limitation if it being in a web project, but if anyone knows a workaround, that would be great.
回答1:
Check in Configuration Manager (menu Build/Configuration Manager) and see if the console app project is checked for build in that particular configuration (Release, Debug, etc.).
来源:https://stackoverflow.com/questions/11073855/debug-console-application-inside-of-a-web-application