CodeWzrd
CodeWzrd

Reputation: 127

ASP.NET 3.5 website under an ASP.NET MVC 3 application - getting Do not have permission error

So I'm rewriting an application that was an ASP.NET 3.5 website. There is a folder that has ASHX handlers. These handlers are APIs called by external apps. My solution is to run this API folder under the new MVC site as an 3.5 application. The URLs stay the same and everything will work wonderfully.

In the MVC app, I have forms authentication enabled in the web.config. I IgnoreRoute the API folder in Global.asax.cs. I created a new app pool for .NET 2.0 and assigned it to the new app created on the API folder.

Accessing the handler from the server works, I get my custom error as I did not specify my credentials. Accessing the handler from my machine, I get You do not have permission to view this directory or page. I created a default.aspx page in the API folder and the page displays. So it's a handler (ASHX) issue.

Upvotes: 1

Views: 103

Answers (2)

CodeWzrd
CodeWzrd

Reputation: 127

I ended up creating a new web site solution targeting .NET 3.5 and had only 1 handler Test.ashx that returned Hello World. Configured IIS to use a different app pool (classic mode) for the API folder and it worked. So I added in my existing handlers and it worked. I'm guessing something in the web.config file was causing the issue.

Upvotes: 1

Alex M
Alex M

Reputation: 2548

Try going to IIS and under your website -> Handler Mappings. Check whether .ashx is mapped.

Upvotes: 0

Related Questions