Search code examples
asp.netdebuggingvisual-studio-debugging

How can I debug a working directory *.aspx.cs file when running the main project in ASP.NET (using Visual Studio (2010))?


Okay, first things first, I don't usually develop ASP.NET applications and nor do I regularly use Visual Studio. I'm not entirely sure if the title to this question makes a whole lot of sense, so let me try to expand a little:

I'm working for a client whose website is split into two projects. The main project and the working directory project within. The file I'm working on lays within the working directory project.

I only have access to the database which the main project runs from; not the database the working directory project requires - therefore, I can't simply run the working directory project. After copying the *.aspx file into the same location on the main project I'm able to get the page up and running by running the main project (which somehow includes the *.aspx.cs and *.aspx.resx.files from the working directory project).

I need to debug the *.aspx.cs file in the working directory project, but as the working directory project isn't running I can't simply add a breakpoint to it.

How can I debug the *.aspx.cs file included from the working directory when only able to run the main project?


Solution

  • I managed to debug this in the end by simply putting some invalid code in the working directory file. The running main solution then picked up on this invalid code and took me to the file (which is nowhere to be found in the project itself!). I was then able to debug as I needed.

    Figured I'd leave this here for reference in case anyone else is having the same problem.