VS2013 Browser Link “The controller for path '

2019-01-22 10:50发布

Since updating to VS2013, we receive this error when running our (MCV4) web app:

The controller for path '/9ac086a69364466a841e03e001f946fd/arterySignalR/ping' could not be found.

I know that it relates to browser link although i'm not sure what we need to do to make it work correctly. Is there some configuration change we need to make to support this new feature?

6条回答
老娘就宠你
3楼-- · 2019-01-22 11:36

On VS2013 @Todd's solution didn't work for me, so I made my own.
Hope it saves you some time.

public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
#if DEBUG
    routes.IgnoreRoute("{*browserlink}", new { browserlink = @".*__browserLink.*" });
#endif
}
查看更多
Lonely孤独者°
4楼-- · 2019-01-22 11:38

If you would like the benefit of Browser Link but don't want the missing controller path exceptions, you can add an ignore regex to your route collection. This is what I did:

public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

#if DEBUG
    routes.IgnoreRoute("{*browserlink}", new { browserlink = @".*/arterySignalR/ping" });
#endif

    //...
}

The regex technique is courtesy of this Phil Haack post.

查看更多
手持菜刀,她持情操
5楼-- · 2019-01-22 11:39

This happens to be a known issue with SignalR and has been fixed in SignalR 2.0.1 and 1.1.5:

2.0.1: https://github.com/SignalR/SignalR/issues/2569 (not yet released)
1.1.5: https://github.com/SignalR/SignalR/issues/2570 (not yet released)

Long story short, nothing you can do to change it, should just wait for the next release of browser link which has a newer version of SignalR.

查看更多
神经病院院长
6楼-- · 2019-01-22 11:41

Had in VS2013, after some project nuget package updates.

Cleaned the solution, closed VS and IISExpress from try and resolved

查看更多
地球回转人心会变
7楼-- · 2019-01-22 11:48

Add the following to your root web.config:

<appSettings>
    <add key="vs:EnableBrowserLink" value="false" />
</appSettings>
查看更多
登录 后发表回答