405.0 Method not allowed on IIS 7.5 - asp.net-mvc

A web application with IIS 7.5, ASP.NET, MVC 4 and Windows Identity Foundation is throwing following error:
Error HTTP 405.0 - Method Not Allowed
Module: StaticFileModule
Notification: ExecuteRequestHandler
Controller: StaticFile
The web application logins first through Windows Identity Foundation on a remote site. This login works fine, but when it redirects you to the local MVC application, the local IIS gives that error.
I tried disabling WebDav and configuring WebDav for all verbs but no luck.

Completely reinstall IIS. This will delete all bad configurations.
You'll have to reconfigure your app to work with WIF.

Related

OWIN and ASP.net membership in IIS 8.5 not working

I created an ASP.NET MVC project in visual studio 2015. I used the Windows Identity Foundation based template for individual accounts available in visual studio.
Then I configure it for facebook and Google.
It works perfectly when i run it from Visual Studio or IIS 7.5. I Could redirect to Google or Facebook page and I was able to register using email and I could see the records saved in the database.
However, when i deploy the app on IIS 8.5 running on windows server 2012 R2, on clicking the Facebook or google button, gives me 404 Resource Not Found Error.
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /account/externallogin
My question is do I need to do any further configuration on IIS 8.5 to get the External Authentication to work. I think the problem is IIS 8.5 is not able to recognize Startup class.
I have added nuget package Microsoft.Owin.Host.Systemweb.
I have a declaration on OWIN Startup class as
[assembly: OwinStartup(typeof(StartupDemo.TestStartup))]
I also have added
<appSettings>
<add key="owin:appStartup" value="StartupDemo.ProductionStartup" />
</appSettings>
in web.config
Also when i click register button, in IIS 7.5 i could register and login but on IIS 8.5 the registration screen simply refreshes without any message.
I verified if I could connect my SQL Server by creating a simple controller and i was able to get all Add New, Edit, Delete and View Actions working in IIS 8.5.
I think there is some requirement in IIS 8.5 to get OWIN working, any help will be much appreciated
Make sure your app pool is in v4.0 integrated mode.
Make sure you have bin placed Microsoft.Owin.Host.SystemWeb (I see you have installed it) - Just make sure its also in the bin folder.
Read this article to learn How OWIN Middleware Executes in the IIS Integrated Pipeline

ASP.NET MVC and HTTP 401.0 - Unauthorized

I deployed my ASP.NET MVC application to my local IIS (same computer) and I'm getting
HTTP 401.0 - Unauthorized
after accessing the application through the browser.
I'm using forms authetication and on the development server it works fine.
I depolyed also a default ASP.NET MVC project and its working fine, so it must be something application related. Is there any way to get more information on this particular error ? Any log file or something. The message HTTP 401.0 - Unauthorized isn't realy helpful.
Tested on
Windows 7,IIS 7.5 and Windows Server 2008 R2 IIS 7.5
EDIT
Found some logs c:\inetpub\logs\LogFiles\W3SVC1\ but there wasn't anything.
Looks like you need to set permissions on the folder.
Try granting permissions to the IIS APPPOOL\YourPoolUserNameHere
or to the IIS_IUSRS user group if the first one doesn't do the trick.

asp.net mvc app in windows 2003 server extension less runs only home page

I've setup an asp.net mvc app on a windows server 2003 machine with IIS6. ASP.NET MVC3 and .NET4 framework has been installed.
Now, I setup a New Website, New AppPool for .NET4 and then put a virtual directory under there with my asp.net mvc3/razor app. So:
IIS
+NewSite <<I set home directory to MyApp
++MyApp/ <<virtual dir
Here is the annoying bit, when I navigate to the address http://<MyServerIp>/ the home page for my app loads up. But, all other links/urls fail and give me a 404.
Like if I click Log On. The URL <myServerIp>/Account/LogOn gives a 404. Similarly all other urls other than the home page give me a 404.
I've gone through as many related questions on SO. I've gone through Phil Haacks article. I've setup a wildcard mapping for .net4.
Any ideas?
Make sure that .NET 4.0 is enabled in the web service extensions folder in IIS manager console:
Also make sure that ASP.NET is properly registered with IIS:
c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i

MVC site deployed to IIS 7 Homepage work All other page 404

I'm trying to deploy a MVC 3 site to IIS 7.5. The deafult route works but all links return a 404 error including if I manually enter the link for the homepage.
Details:
MVC 3 to IIS 7.5
Windows Server 2008 R2
MVC 3 is installed on server
Default Web Site/PaedPhysiotherapy_Uat
.net 4 is installed
DeafultApplicationPool used
App pool is .net4 and running in integrated mode
Custom error are turned off
If I deploy to a new website on the same IIS box using different ports, e.g. "http://newsite:81 which not under the default website everything works fine.
Even in the absence of routing, IIS will redirect requests for "/" to "/Default.aspx". In an MVC app, there's a Default.aspx which manually finds the MVC handler and invokes it. So that's probably why your home link works.
Your other pages must go through routing. In integrated mode there must be an IIS handler for this. Check the ExtensionlessUrlHandler in the IIS handler mappings. Compare that and other handlers with the sites which work.
At a guess, if this works when deploying to the root of a site then it looks like an absolute path has sneaked in. Perhaps somewhere this is a missing ~ in front of a path e.g.
/MyController
instead of
~/MyController
Also, you did remember to convert /PaedPhysiotherapy_Uat to an application?

Cannot host ASP.NET MVC application in IIS

I have created a virtual directory on the IIS (IIS 5.1 that's what i'm using). when i try t o run the applciation from my browser using the URL
http://localhost/sitename .
i'm able to see the initial landing page . But when i force a controller action call like this .
http://localhost/controllername/actionMethodName
i receive the 404(file not found error). But when i'm running the application from the asp.net development server (intergrated with VS ) everyhting works fine.
what may be the reason. i have set impersonate in web.config and enabled anonymous access in the IIS .
any thoughts/ suggestions
thanks,
vijay
Have you tried http://localhost/sitename/controllername/action?
Edit: You could try these solutions:
ASP.NET MVC and IIS 5
Deploy ASP.NET MVC on IIS 5.1 (Windows XP)

Resources