IIS 7 Not find the _Layout.cshtml - asp.net-mvc

I am having a problem with a MVC application. When I publish it, I have the follow error:
The layout page "~/Views/Login/_LayoutLogin.cshtml" could not be found at the following path: "~/Views/Login/_LayoutLogin.cshtml".

I had the same problem once.
I figure out that it was an IIS permission problem. I went to the Application Pool and to the Authentication options. Then I edited the Anonymous Authentication Credentials to "Application pool identity"
Here is an answer in another post that have a better explanation about the solution
https://stackoverflow.com/a/6156675/2430118
Pedro

Related

Server not found after external login MVC

Hello I use the code from https://coding.abel.nu/2014/11/using-owin-external-login-without-asp-net-identity/
and I was getting the error "The page isn't redirecting properly". after I login to my provider.
I clear my cookies but now when I log in to my provider but I get "Server not found". "Firefox can't find the server at login;jsessionid=f09ba421eeee23eab2a1ffa8b6ed35c3." in the url it returns https://login;jsessionid=f09ba421eeee23eab2a1ffa8b6ed35c3/. My provider is CAS. This is for firefox. In chrome it just brings a blank page.
I try it also with Google but I get same errors.
Any idea?
thank you
I believe I had the similar bug, there was one line solution to this bug...
"here is a bug in Microsoft's Owin implementation for System.Web. The one that is being used when running Owin applications on IIS. Which is what probably 99% of us do, if we're using the new Owin-based authentication handling with ASP.NET MVC5.
The bug makes cookies set by Owin mysteriously disappear on some occasions..."
solution here: https://github.com/KentorIT/owin-cookie-saver

Not able to access my MVC 5 web application after adding MS Identity

I created my app using a template. After that i managed to connect it with an existing database. Then i tried to add Identity so that i will be able to authorise and authenticate users of the application. I tried to do that following the instructions of "shyamal parikh" in this post Adding ASP.NET MVC5 Identity Authentication to an existing project
My problem is that now i get a 401 error unless i got to solution explorer (in VS) and disable the windows authentication. But when i do that all the users have unrestricted access to the whole application.
I assume that the problem has to do with that solution that i performed but i cant comment directly there.
Can anyone give me a hint as to what i might be doing wrong?
Do you have windows authentication installed on your computer? Maybe adding that might help. Here are the instructions-
https://www.iis.net/configreference/system.webserver/security/authentication/windowsauthentication/providers/add
Also look at your event viewer, you might have some hints there.

Windows Azure MVC 2 in Dev blank

I been trying to create a new MVC 2 application under Azure, but when testing it in the Dev Fabric I get nothing but a blank page. What am I doing wrong?
Sometimes this is an IIS configuration issue... I'd look for "static content" and "HTTP redirection" being enabled in IIS. See http://msdn.microsoft.com/en-us/library/dd573369.aspx for a longer list of IIS features to make sure are enabled.
I got bitten by this too. There's a more discriptive thread on the msdn forums about this:
http://social.msdn.microsoft.com/Forums/en/windowsazuredevelopment/thread/0dbecc0b-d5a9-4bf7-a528-23ab793cf3ef

The resource cannot be found

I made a really simple MVC application with VS 2010 beta. just a view with 2 fields ID, and name made the controller and just tried to check the Index page. I am getting the following error. 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.
Version Information: Microsoft .NET Framework Version:4.0.21006; ASP.NET Version:4.0.21006.1
i am running on my laptop Windows 7 Home Premium I installed also IIS 7. is there some special option in order to work with MVC2. Any help would be greatly appreciated. Thanks
It might be possible that your routes are causing the problem.
If you could post your Global.asax, your controller and the url your are trying to access, then it would be helpful to answer more accurately.
Thanks

Deploy asp.net mvc beta to iis 6 causing 404's

I'm struggling to get around the 404 errors from asp.net mvc beta when deploying on IIS 6. I had this working in one of the previews by mapping .mvc in IIS but this no longer works. I've read Omar's post and several others on the web and tried their solutions but no luck so far.
The home page opens without a problem on IIS 6 but others 404 and the site runs well on IIS 7.
Has anybody deployed asp.net mvc beta to IIS 6 with success? If so, what adjustments did you need to make to the code and/or IIS settings to get it to work?
I found a solution to my problem from Steve Sanderson's blog (Thanks Steve):
Use a wildcard mapping for aspnet_isapi.dll. This tells IIS 6 to process all requests using ASP.NET, so routing is always invoked, and there’s no problem. It’s dead easy to set up:
open IIS manager (run -> inetmgr -> OK)
right-click your app, go to Properties
then Home Directory tab, then click Configuration.
Under Wildcard application maps, click Insert (not Add, which is
confusingly just above)
then enter
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll for
“Executable”, and uncheck Verify that file exists.
I can't seem to write comments yet. So I'll write a new answer.
There are a few similar questions going around on stackoverflow.
I'm using MVC 3. I know the question was MVC 2 related. But since this is the first stackoverflow post I bumped in to, I think it's worth mentioning that:
when you use MVC 3, you need to add a new extension mapping with the executable of the .NET 4 framework (C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll)
<edit>I just found out that I even don't need to set up the extension mapping. </edit>
It still didn't work for me then :) I still had to 'Allow' ASP.NET v4.0.30319 in the Web Service Extensions section in IIS:
open IIS
click on the server node
open the Web Service Extensions section
select the ASP.NET v4.0....
right click --> Allow
Good to go!
Url rewriting can help you to solve the problem. I've implemented solution allowing to deploy MVC application at any IIS version even when virtual hosting is used.
http://www.codeproject.com/KB/aspnet/iis-aspnet-url-rewriting.aspx

Resources