ASP.NET Core RC2 403.14 Forbidden error - asp.net

I am trying to set up an ASP.NET Core test website on my Windows 10 machine. I followed the steps found in the ASP.NET Core documentation (https://docs.asp.net/en/latest/publishing/iis.html), but when I browse to the site, I get a 403.14 Forbidden error. I can Run the app through Visual Studio, fine and everything is rendered as expected, but when I Publish the site, the error appears. A few other items:
The root of the site is pointing to the wwwroot folder of the published output as it should be.
I can place a static file in the wwwroot folder and access it through the browser fine. Problem only seems to happen when browsing to MVC code. When enabled, directory browsing works fine as well.
Routing, controllers, and views are set up correctly. I can Run and Debug the site in VS fine with an instance of Kestrel running.
I am trying to access the site via port 80 on a test URL specified in my hosts file (I am hosting a number of other sites fine on the same machine already with this common config).
The app pool is configured correctly using No Managed Code.
The IIS instance has full file permissions to the folder.
I am thinking I have something messed up in my installation (I had a previous install of HttpPlatformHandler installed previous to the RC2 where it was replaced by AspNetCoreModule). Any thoughts?

Related

Routing issues after publish asp.net mvc app

I recently developed an asp.net mvc application that want to publish online. I used the Publish option on Visual Studio to do that.
Apparently this is a common task and there are several tutorials about that. However my case has a different detail that I believe is not allowing me to run the app successfully.
So the thing is:
I have a Wordpress site successfully running at www.somedomain.com
I want my asp.net application to run at www.somedomain.com/myapp
This is what I have done so far:
Uploaded all my app files to httpdocs/myapp folder on the server;
Configured a virtual directory on httpdocs/myapp folder on the server;
Imported the database from my local computer to the remote server;
Changed the connection strings on web.config to point to the database on the remote server;
After this, when I try to access on the browser to www.somedomain.com/myapp I can see that it redirects me to www.somedomain.com/myapp/Account/Login?ReturnUrl=%2Fmyapp%2F but shows the 404 error (Page not found) with the layout of my Wordpress site. So it looks like it is running the Wordpress site, instead of the asp.net app on that folder.
are you using IIS?
you need to create an application instead of a virtual directory
otherwise it will not treat the sub folder as an application and will follow parent folder’s web.config and other settings

MVC6/ASP.NET core published to iis 404 on controller endpoints

I have managed to publish an MVC6 website to IIS, but it seems to be only serving the static files in wwwroot. As soon as I make a request to a MVC controller endpoint I get a 404.
What other steps do I need for the backend code to run? I see that in the web.config it is executing the web.cmd file in approot, but this doesn't seem to be running.
Edit Running the web.cmd directly - i.e. using the self-host ability - works fine on the server where the app is deployed.
I had a similar issue to this (404 on every page except for root) and while initially it looked like an IIS configuration issue or a problem with httpPlatformHandler, after running web.cmd manually I was able to find some issues with my connection string.
After fixing these issues I was able to run the site through IIS without any hassles.

Published website ASP.NET with IIS

I have just completed my website and I started working with IIS it works fine when I put all my file without published. I copy the whole website to wwwroot inside my folder as I said It works fine but when I tried to work without code behind page it didn't work I published website from VS. and I copy my published file to the same folder but it doesn't work.
I received this error:
Eval is not declared. It may be inaccessible due to its protection level.
I don't want to put my code behind page. How can I run my published pages?
First, when you publish your web project, their are no code behind pages.
Do this, set a directory and publish your site in it.
Now cmd-> intemgr->
site-> -> add web site->
give site name and select an application pool, then set the physical path to the directory where your application is published, if necessary change the port to something like 50 because 80 is a standard port for http. Hit ok. Your site is ready.
Please check in application pool that your application pool is set to .Net framework version V4.0 (i mean the version compatible to your app ).
just click to browser the site, please do check the uri you can see the port number also

Changing "Project Url" causes ASP.Net Web app to not be debuggable

I have an ASP.NET Web Application project that I am using to host a WCF Data Services (OData) project.
I went and changed the url from:
http://localhost/MyProject
to
http://localhost/v1/MyProject
after I did that I created a Virtual Directory for the new project URL.
Now when I run I get this error:
Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information.
I clicked help but it was no help (was IIS 6 level instructions, I have IIS 7). I did some googling and it was all fairly generic responses.
How can I get this working again? (Aside from revert to my old Url. Reverting works but I changed it for a very good reason.)
Your virtual directory need to point to the same scr directory you were originally debugging against.
Also, make sure the virtual directory is configured for Windows Authentication, which is required for debugging.
I had to go to my website in IIS and add a folder under it called v1. After I did that it all worked perfectly.

IIS5 or IIS6 Web Application running under IIS7?

I have a web application that runs fine under IIS5 or IIS6. I just installed Vista, which has IIS7. I just copied the entire web app over as-is, no changes to any files. I went into the IIS7 manager and created a web appliction under the Default Web Site and pointed it to the app I copied over.
When I try to browse to the app in IE, it tells me there's nothing there to handle it and that directory browsing is not turned on. This is a .NET app, so it uses Default.aspx. I looked in the manager, and there was no handling of Default.aspx setup. Is that not on by default for IIS7?
So, I added Default.aspx, and now the error is "HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map."
I thought maybe it was because the default for IIS7 is Integrated Mode, so I created a new AppPool for Classic Mode and changed my app to use that. I still get the same error.
I was under the impression that I could move .NET apps to IIS7 without any changes. Is this not true?
0) Check if you have asp.net extensions installed under Programs and Features - Windows Features - WWW services - Application Development Features - .Net Extensibility / ASP.Net
1) The Microsoft .net framework
2) Try copying the whole directory to your IIS's root folder (usually wwwroot), common error that iuser/iwam does not have rights to read the other folder.
3) Check under "Handler Settings" if you have .aspx associated with any Isapimodules.

Resources