MVC 3 Area route not working

前端 未结 8 768
有刺的猬
有刺的猬 2020-12-17 18:54

I created a Area in my MVC 3 application called \'Blog\'.

In global.asax I have the following code.

public static void RegisterRoutes(RouteCollection         


        
8条回答
  •  死守一世寂寞
    2020-12-17 19:10

    Check if you have a virtual path is mapped as the area name. I set area address in visual studio just to debug and it asked me to create a virtual path. So AppRelativeCurrentExecutionFilePath was always ~/ and routing wasn't able to determine the area. For IIS express delete the virtual path for your site:

    C:\Users\username\Documents\IISExpress\config\applicationhost.config
    

    I spent 4 days to discover it.

提交回复
热议问题