Tutorial :Debugging an ASP.NET MVC site and ASP.NET MVC Source Code



Question:

I have been given an app written by someone else and the error I get when I try to just launch the thing and the first look at it is:

"There is no source code available for the current location."

I could care less about the source code to ASP.NET MVC. How do I tell my project to show me the location where it is breaking in "my" code?

Update:
The message I get after this initial error is "no controller named ~"

After all this the app still works. Its just really slow. Any ideas?
Each page request goes through this cycle in debug mode.


Solution:1

This is going to be a routing issue. Can you please post the RegisterRoutes method in the Global.asax?

If it is using the default, then a request is being made to http://sitelocation/~/somethingelsehere.

My guess is there is a reference to a url like "~/Public/default.aspx".


Solution:2

Some basic things to check:

  1. The MVC is the startup project
  2. The Default.aspx is the startup page

Edit:

What does the Global.asx.cs page look like? Can you post some code? I am wondering if it's somewhere in the routing...


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »