ASP.NET MVC Sub Application - asp.net-mvc

I have a ASP.NET MVC application at a root level (e.g. http://example.com), and have now deployed an additional ASP.NET MVC application as a sub-application (e.g. http://example.com/api). I have set the sub-application as an "Application" in IIS.
However, whenever I try to navigate to the sub-application, I am getting a 403.14 Forbidden error. It's like the sub-application isn't getting picked up as an ASP.NET MVC application. If I try and hit a url which has a controller/action method in the sub-application (e.g. http://example.com/api/home/index"), I get a 404 response.
In terms of setup, the only differences I can see in IIS Manager is a lack of an "ISAPI Filters" icon for the sub-application. I am running .NET 4.5, ASP.NET MVC 4, and IIS 7.5.
Does anyone have any suggestions on how to get this ASP.NET MVC sub-application working?

Turns out I was missing the following config from the <system.webServer> config in my child application:
<modules runAllManagedModulesForAllRequests="true"/>
After I put that in, it started recognising the child application as an ASP.NET MVC site.

Related

IIS 10 (or MVC?) throwing 403 Forbidden [duplicate]

I have deployed an asp.net MVC application to my IIS7 server. When I attempt to browse the dafault route I get the message
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
It's clear to me that it is not loading/processing the global.asax, but I have no idea why. I've deployed another MVC application to this same location/app pool and it works fine.
Does anyone have any idea how to debug a problem like this?
Maybe:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
OR
ASP.NET MVC on IIS 7.5
ASP MVC in IIS 7 results in: HTTP Error 403.14 - Forbidden
Can't run ASP.NET MVC 2 web app on IIS 7.5
I've tried a lot, and finally one checkbox did the trick

response.redirect page from asp classic to mvc controller

I have an ASP classic application running and in same folder i have moved the mvc web deploy package.
Now when i redirect my page from classic asp to a controller/action it shows error 404.
It is running fine on local IIS but not on web server
Please help

Using ELMAH inside my asp.net mvc 4 & MVC5 web application

I have two asp.net mvc web applications; asp.net mvc4 and asp.net mvc5 , they are both deployed under iis7 on two separate VMs.
now i am currently facing problems when un-handled exceptions are raised,,, because users will be re-directed to the Error view inside the shared folder under the view section. and i am unable to know exactly the exception details..
so i have read about using the ELMAH tool which will automatically logs all the UN-handled exceptions. but my question is that what are the steps that i need to follow to configure the tool inside myC application ?
second question; will ELMAH works on asp.net vmc4 and asp.net mvc5 in the same way?
Third question. now i have custom error set to <customErrors mode="RemoteOnly" /> inside my live asp.net mvc web application, since i do not want end users to be exposed to the technical details about any exception, so when using elmah should i set the custom error to be no ?
Thanks
1) Just install Elmah from Nuget. That will enable it with the default configuration to save exceptions to an XML file
2) Yes, it should work both in MVC4 and 5
3) No, you can leave it as it is. The Elmah page is available locally only by default. Users will be still redirected to your Error page, and you can use the elmah URL locally to access the actual error information.

asp.net MVC 3 no default page

Has anyone tried to deploy an asp.net mvc 3 website that uses the razor templates? The project does not create a default page and not sure if this changes in some way?
I have several projects in the pipeline that work on both IIS 7 and 6 (test servers) without any issues with a missing default.aspx page. I don't have any production code in effect but so far it's not an issue.
I would say the issue with a missing default.aspx page would rely on the server not using the <modules runAllManagedModulesForAllRequests="true" /> in the web.config. Otherwise a default.aspx page isn't necessary for handling. As long as IIS uses the mvc module to handle requests.

Getting 404 When Requesting MVC Page within Classic ASP Application

Current Application Server Configuration:
IIS 6.0
Windows 2003 Server Standard Edition SP2
.NET Framework 3.5 SP1
Current Application Architecture
Classic ASP 3.0, referenced within HTML Frames
A few ASP.NET Web Forms
System.Web.Mvc.dll copied to Web Application bin folder
To test the feasibility of gradually incorporating ASP.NET MVC into our existing architecture, I published an MVC application to the aforementioned classic ASP application folder. I put in a hyperlink to the MVC page from one of the standard .html pages and I get a 404 response, telling me the requested page does not exist. I am using the same relative link that is being used on my local machine, which works fine.
Any pointers would be much appreciated.
Thanks.
Answered here ASP.NET MVC on IIS6

Resources