MVC :: Route Debugger By Stephen Walther?

Feb 14, 2010

I'm trying to follow Stephen Walther's MVC tip: Build a Controller to Debug Your Custom Routes (http://stephenwalther.com/blog/archive/2008/08/03/asp-net-mvc-tip-29-build-a-controller-to-debug-your-custom-routes.aspx) but I'm getting this error "Object reference not set to an instance of an object." when getting the values of the RouteTable.

Function Index() As ActionResult
Dim context As HttpContextBase = Me.ControllerContext.HttpContext
Dim sb As New StringBuilder
For Each namedRoute As Route In RouteTable.Routes
'Dim dataTokens = formatValues(namedRoute.Defaults) 'this looks good
Dim rd = namedRoute.GetRouteData(context)
'sb.Append(dataTokens & "<br>") 'this looks good
sb.Append(formatValues(rd.Values)) 'this one is not, error here [:(]
Next
End Function
Private Function formatValues(ByVal values As RouteValueDictionary) As String
If values Is Nothing Then
Return "N/A"
End If
Dim col = New List(Of [String])()
For Each key As String In values.Keys
Dim value As Object = If(values(key), Nothing)
col.Add((key & "=") + value.ToString())
Next
Return String.Join(", ", col.ToArray())
End Function

You have to reference the debugger file (RouteDebugger.dll) provided by Stephen.

I'm trying to get the Route Name's for each controller.

View 3 Replies


Similar Messages:

MVC :: Webforms Route / Implementing Route In Global.asax

Mar 13, 2011

I tried to mix asp.net 4 webfrom and ASp.Net MVC 3. I add required lines in webconfig, but I've issues implementing route in global.asax

Currently I use several routes for webfroms. routs template are like below

routes.MapPageRoute("Node", _
"article/sport/{nID}/", _
"~/article/articleview.aspx")

I encounter error, when I add below lines to global.asax

routes.MapRoute( _
"Defaultss", _
"{controller}/{action}/{id}", _
New With {.controller = "Home", .action = "Index", .id = UrlParameter.Optional} _
)

I want to know how could I mix ASp.Net MVC routes with webforms routes.

View 3 Replies

MVC :: A Route Named 'Admin_default' Is Already In The Route Collection?

Mar 9, 2010

when i run the app i got this error

A route named 'Admin_default' is already in the route collection. Route names must be unique.
Parameter name: name

this is my AdminAreaRegistration

[Code]....

View 2 Replies

Route Constraints And Empty Route?

Sep 24, 2010

I have a url that I want to map routing to:

[URL]

where tabvalue is one of: "personal", "professional", "values" or nothing.

I want to map it to a route like:

Member/Edit/{tab}

But my problem is - I don't know how to specify such constraints. I'm trying this regex:

^[personal|professional|values]{0,1}$

but it only works when I use url

[URL]

[URL]

and doesn't work for

[URL]

how to specify the correct constraint?

P.S. I'm not using MVC, just asp.net WebForms

View 6 Replies

C# - MVC 3 Custom Route Handler - Skip To Next Custom Route Rule?

Mar 14, 2011

Was looking at asp.net mvc complex routing for tree path as an example of how to define a custom route handler for my MVC app. Essentially, I want to give the end user ultimate flexibility in defining the URL for any given page, so I provide them with a field in the interface to specify their own custom URL.

My custom route handler is basically a wild-card handler. It will do a lookup and if it finds a match, map it accordingly. However, if no match is found, I want it to fall back and find the next rule that matches in the global.asax. Is that possible? Or do I essentially need to code the mappings that used to exist in my global.asax into my custom route handler?

View 2 Replies

Using IE 8 Javascript Debugger?

Mar 29, 2011

I'm trying to debug a VS 2010 Web app and I'm using the IE 8 debugger for Javascript. Does anyone know what causes this message? I don't have any other debuggers going. There are no other processes going on.

View 7 Replies

Can IE Debugger Be Disabled?

Mar 2, 2011

We have recently had some security issues with our web app where users have actually gone into the IE debugger tool and enabled a "Submit" button and saved data they shouldn't have. So...my question is....is their anyway to prevent this from happening?

View 4 Replies

Cannot Get Work VS 2010 And IE Debugger

Mar 29, 2011

using VS 2010 and the IE Debugger. I can't get it to work for nothing. The IE Debugger works fine with all other VS versions. I've done the necessary steps in the "Internet Options" "Advanced" tab.

View 16 Replies

VS2010 Debugger Not Responding

Jul 19, 2010

I am working on a large website that is comprised of multiple applications. We are still using web forms. All of the applications are in a common directory that serves as the root directory in my localhost. The site was originally built in 2005 on 3.5 but has been migrated to 2010 still running on 3.5 (2.0). My problem is that my debugger will run once. After I stop debugging I cannot run the debugger again - it just hangs. My locals and watch windows open but do not populate and the browser never opens. We are running Visual Studio 2010 Ultimate on Windows 7 32 bit.

View 1 Replies

Web.Config Transformations In The Debugger?

Jan 24, 2010

When you run an application in the debugger, it appears to not apply the transformations to the web.config based on your build selection. Is this the case or am I missing something? It appears to be working just fine if I publish to local IIS, just does not seem to work in the debugger.

View 1 Replies

Trying To Connect To A Remote Debugger For VS2008-SP1?

Jun 28, 2010

I'm having problems trying to connect to a remote debugger for VS2008-SP1.I'm trying to debug an ASP.NET application on a Win2k8 VM. The host PC (WinXPsp3) running Visual Studio is connected to an AD domain, and is logged in with a domain account. The VM is not connected to the domain and is logged in with the local Administrator account.The VisualStudio remote debugger requires authentication in both directions, so I would normally add my domain account as a local admin on the VM and allow debug permissions for that user.Since the VM is not on the domain, I can't add my domain account as a local admin. What can I do to get remote debugging going between my PC and the VM?

View 3 Replies

Bind Debugger To All IP Addresses Instead Of Only Localhost?

Dec 23, 2010

How can I make visual studio asp.net debugger to bind to all ipaddresses of my network instead of localhost? So I can debug under another circumstances.

View 1 Replies

Visual Studio :: Is It Possible To Step Backward In The Debugger

Apr 8, 2010

In the Visual studio IDE is it possible to step backwards in the debugger? If this is not possible,can I somehow trace my step backwards in the compiler?

Also if I am stepping through C# code in the debugger, is it okay to add documentation in the file while I am debugging? I tried this and recieved a pop-up message box informing me that the code had changed. Otherwise the IDE seemed forgiving in regards to comment changes in debug mode. Also I guess this might also lead into the question of wether it is acceptable to add code during debug mode?

View 1 Replies

Visual Studio 2008 Debugger Detach?

Oct 4, 2010

My Visual Studio debugger detaches every time when I try to access a property in a web application. I don't use Visual Studio's inner webserver, just the standard IIS. It seems like that property has somewhere a stack overflow

(Server Application Unavailable)

, but I can't find it. There is an error message in the EventLog:

aspnet_wp.exe (PID: 5200) stopped unexpectedly

I've tried to delete all temp folder including ASP.NET temporary files, no change at all. I've tried to start devenv.exe /log

but in the log xml, there was hardly any exception. Is there any way to get that exception which causes the debugger to stop/detach?

Plus info is that another colleague can debug that property. I've tried to get his vssetting file, but no change.

View 1 Replies

C# - Visual Studio 2008 Debugger Keeps Detaching?

Aug 4, 2010

i'm trying to debug some code i.e. trying to get the values of some parameters

public SqlDataReader GetAllCompaniesByType(int type)
{
SqlParameter[] sqlp = new SqlParameter[2];[code]....

but for some reason the debugger keeps detaching. It is not just this code but happening everywhere it is driving me INSANE..

View 3 Replies

Is There A Visual Studio Debugger Visualizer For The .NET Session

Apr 26, 2010

If so; where can I get it?

View 2 Replies

C# - Loading Sandbox AppDomain Crashes Debugger?

Mar 2, 2011

I am creating a sandbox AppDomain so I can load up an assembly and release it.

var sandbox = AppDomain.CreateDomain("Sandbox", null,
AppDomain.CurrentDomain.SetupInformation);

However when I Load an assembly into to sandbox, the debugger crashes. I am in ASP.NET.

var assemblyName = AssemblyName.GetAssemblyName(assemblyPath);
var assembly = pluginDomain.Load(assemblyName); // crash here

View 1 Replies

Visual Studio :: Int Properties Showing Up In Debugger As HEX?

Sep 13, 2010

For some reason, when reading from an Access database, values that are supposed to be INT are showing up as HEX

dr["NumSent"]
0x00000000
dataSet.Tables[0].Rows.Count;
0x000004ba
dataSet.Tables[0].Rows.Count.ToString();
"1210"

View 2 Replies

Change The Initial Url Of The Debugger In Visual Studio 2008?

May 4, 2010

I was wondering if there is an option to change the debugger url when I initialize the debugger. I want it to start off at http://localhost:xxxx/controller/view rather than just http://localhost:xxxx/.

View 2 Replies

Visual Studio :: Debugger Not Loading Properly And Exiting?

Aug 24, 2010

I am attempting to debug my Visual Studio 2005 project. I have Internet explorer 8 and it's running on IIS.

When I hit the "debug" button, a new Internet Explorer browser window opens and my ASP VB .NET application loads normally. However, Visual studio returns back to regular editting mode and I can hit the "debug" button again. No break points hit but my web page still runs and loads normally.

The Output screen use to show Web.Server(exit 0) but now it doesn't show anything.

View 1 Replies

Debugger (break Points) Not Working In Visual Studio 2008?

Mar 15, 2011

I have an application in Visual Studio 2008. I have been working with it for some time. Today, suddenly, it will not debug, or more specifically it does not stop at the breakpoints I created in Visual Studio. It just ignores them. I tested the break points by adding one at the opening of the Page_Load event and nothing. If I put in a mistake on purpose the application will build, the internet explorer opens, and gives me an error report. It has never done this before. Usually it stops IE from opening and gives me a list of errors at the bottom of the VS screen. I want my old VS back. I don't see how this could have changed it but I'll mention the things I've worked on recently. I've been trying to configure the session states in the web.config page, and then recently I started a new web page with a conection to a database and gridview. I have restarted VS and nothing has changed.

View 2 Replies

Visual Studio :: Cannot Get Attached Debugger To Page In Website Folder

Feb 8, 2011

I'm using Vs2010 professional. I was working with a large WebSite (folder) project at work using IIS7 and tried to attach the debugger to the w3wp.exe for debugging an aspx page in IE8 after setting breakpoints in the javascript for the page and in the Page_Load in the code behind. I got a "first chance exception of type 'System.InvalidOperationException' occurred in System.dll" in my debug output, so I gave up for the moment. I created a default website project in the root of IIs7, and set it up as an application in IIs7 with the default app pool.

I tried entering a little javascript in the head, and set a breakpoint, and set a breakpoint again in the Page_Load. I attached the debugger again to w3wp.exe. I see the assemblies load in the debug output and nothing happens:

Ignoring attach security warning for process C:WindowsSystem32inetsrvw3wp.exe, owned by IIS APPPOOLDefaultAppPool [administrator]
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_64mscorlibv4.0_4.0.0.0__b77a5c561934e089mscorlib.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_64System.Webv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Web.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystemv4.0_4.0.0.0__b77a5c561934e089System.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Corev4.0_4.0.0.0__b77a5c561934e089System.Core.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Configurationv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Configuration.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Xmlv4.0_4.0.0.0__b77a5c561934e089System.Xml.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILMicrosoft.Build.Utilities.v4.0v4.0_4.0.0.0__b03f5f7f11d50a3aMicrosoft.Build.Utilities.v4.0.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Runtime.Cachingv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Runtime.Caching.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.RegularExpressionsv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Web.RegularExpressions.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_64System.Datav4.0_4.0.0.0__b77a5c561934e089System.Data.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Drawingv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Drawing.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILMicrosoft.JScriptv4.0_10.0.0.0__b03f5f7f11d50a3aMicrosoft.JScript.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILCppCodeProviderv4.0_10.0.0.0__b03f5f7f11d50a3aCppCodeProvider.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET Fileswebsite297987469de3b823App_global.asax.g3ldh1jy.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ServiceModel.Activationv4.0_4.0.0.0__31bf3856ad364e35System.ServiceModel.Activation.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.Extensionsv4.0_4.0.0.0__31bf3856ad364e35System.Web.Extensions.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Runtime.DurableInstancingv4.0_4.0.0.0__31bf3856ad364e35System.Runtime.DurableInstancing.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.Mobilev4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Web.Mobile.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ServiceModelv4.0_4.0.0.0__b77a5c561934e089System.ServiceModel.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSMDiagnosticsv4.0_4.0.0.0__b77a5c561934e089SMDiagnostics.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Xaml.Hostingv4.0_4.0.0.0__31bf3856ad364e35System.Xaml.Hosting.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET Fileswebsite297987469de3b823App_Web_t1ltfooj.dll'
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET Fileswebsite297987469de3b823App_Web_myfv4sgi.dll'
The thread '<No Name>' (0x22cc) has exited with code 0 (0x0).

I am using 64 bit Windows 7 Professional.

View 1 Replies

Inetinfo.exe, Dllhost.exe And Aspnet_wp.exe All Start Under Debugger On Themselves/ Unable To Attach

Feb 2, 2011

I'm trying to debug an ASP.NET application. I've created a virtual directory in IIS, copied all the binaries and web.config there. When I pass request from the client program running on the same computer aspnet_wp.exe is started but then something goes wrong.

I want to attach to the process and try debug it. When I ask Visual Studio to "Attach to process" it displays a list of processes and aspnet_wp.exe, inetinfo.exe and dllhost.exe are all displayed grayed as if they are already debugged by some other program and so I can't attach to any of them.

I have tried to disable the "debug" option in web.config:

<system.web>
<compilation debug="false">
othersettings
</system.web>

but it didn't change the behavior.What's happening and how do I make aspnet_wp, inetinfo and dllhost all start in such way I can attach a debugger to either of them?

View 1 Replies

How To View Session Variables In Visual Studio 2008 Debugger

Mar 30, 2010

Usually using Visual Studio's debugger is a breeze. Scanning through Locals quickly shows the values of variables, etc. However, I'm at a loss how to find out the values contained in session state variables? Can anyone give me a hand?Lets say I put a breakpoint right after:

Session("first_name") = "Rob Roy"

How do I view the value contained in Session("first_name") from locals?

View 2 Replies

AJAX :: Update Panel Fast In Debugger But Slow When Published?

Jan 29, 2010

I know it's not the best practice to do, but unfortunately I created a page with multiple large dropdown lists and have them inside an ajax updatepanel. I found some work arounds using siderite's ajax updatepanel adapter:
http://fastlistadapter.codeplex.com/.

The performance is very good while I am debugging on my machine, but when I publish the site and post it to a win 2003 server the performance drops off almost as bad as when the fix isn't there.


I understand that using a 3rd party fix really isn't supported by most, but is there any obvious reason why debug performance would be much better than published site performance on the same exact code?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved