开发者

Routing problem with particular controller name using ASP.NET MVC 1 in IIS 7

开发者 https://www.devze.com 2023-02-08 11:24 出处:网络
I have joined a team developing an ASP.NET MVC version 1 application.I run this app on my local machine using IIS version 7.5.My operating system is Windows Server 2008 R2 Enterprise Edition.I use Vis

I have joined a team developing an ASP.NET MVC version 1 application. I run this app on my local machine using IIS version 7.5. My operating system is Windows Server 2008 R2 Enterprise Edition. I use Visual Studio 2008 SP1 for development.

One of the controllers in this app is called ReportsController. The route table entries for this controller use 'Reports' as the controller name part. The problem I have is that, using IIS 7.5 on my local machine, I simply cannot access any of the Reports action methods. If I try to access, say, '/Reports/Index' from Chrome or Firefox, I get a 401 Unauthorized response (as seen using Fiddler) and the browser displays its username/password entry dialog.

Please note the following:

  • All other non-Report pages in the application work correctly.
  • If I add a breakpoint to Application_BeginRequest, it is not hit when requesting a Reports page.
  • If I change the Reports routing entries in the route table registration code so that I have to access paths like '/Reportss/Index' (note the extra 's') then these Reports pages work correctly.
  • I have tried deleting then recreating my Web application in IIS.
  • T开发者_C百科he Reports pages work fine if I run the application using the Visual Studio 2008 development server (Cassini).
  • There is no directory called Reports in the application directory.
  • The Reports pages work correctly on our UAT environment, also under IIS 7.5.
  • I have reviewed my IIS setting several times, including comparing them with those on UAT, and I can't see a problem.

While I can use Cassini to access the Reports pages, I would really like to understand what is causing this issue.


If you have Reporting Services installed on your machine. try to create a new web site and use it. If you have SSRS installed on your machine it uses /reports for hosting reports.


I have had problems using the directory name 'Reports' at the root of a .net 2.0 website on IIS 7.5. It generates a 503 Error, indicating that there is an error at the system level before IIS tries to serve the page. I am not sure if reporting services is installed on my server. I just changed the directory name, all links and everything worked.


I have the exact same issue in my MVC Application with reporting services installed on the same server where code was deployed. I have changed the Reporting Manager URL in "SQL Server Reporting Services Configuration" which was hostName/Reports and assigned a new name i.e. SSRSReports so the virtual directory is now hostName/SSRSReports.

Now my application as well as SSRS Reports are working as expected.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号