在这里,如何利用Atach To Process on IIS进程,在将视觉演播室快播成网络时,将:
- Open your web site project in Visual Studio Express 2012 for Web,
and browse your dev website in a browser - You can do it by Ctrl+F5 in VS (start without debugging) - this will run w3wp.exe (ISS Application Pool Process - this process will run when your project Web Location is HTTP)
- Open Visual Studio express 2012 for windows desktop. yes. for "windows desktop" - here will come the trick (-:
- In the VS for desktop - press Ctrl+O (Open File) - and browse to file in website that you want to debug - [root]/Default.aspx.cs for example.
Now in the Default.aspx.cs code, set a Breakpoint - for example in
Page_Load event code
- In the VS for desktop - go to Debug menu and select Attach To Process...
In the Attach To Process dialog - in the Available Process list select your IIS process: w3wp.exe
Now press Attach button
- Go to your browser and run the /Default.aspx page
Result:
The website run in IIS process, will stop in the breakpoint in the VS for desktop, and you can debug it.
注:
- This will work only if your website project Web Location is HTTP (this configured when creating the website project in the VS. Google for instructions)
- I did it on 2012 version, and it may work on other versions as well.