ASP.NET Not Publishing to IIS - 500 or 404 Error - c#

I am trying to publish my ASP.NET MVC Core website to IIS 8.5. I've published the package locally and get three folders: "approot", "logs" and "wwwroot". I then have to manually copy all three folders to my web server e.g. D:/inetpub/wwwroot/myWebsite/<CopyHere>.
Should I simply copy "approot", "logs" and "wwwroot" directly to "CopyHere", or elsewhere?
When I attempt to view the website, I simply get a blank page (e.g. "http://my.web.site"). If I enter my Controller and Action to the URL (e.g. "http://my.web.site/myController/myAction") then I get a 404 error status.

This has been an issue with ASP.NET Core RC1 for everybody. ASP.NET Core RC2 came out yesterday. I hope it fixes the many issues of publishing a project to IIS. But I've yet to try it. You can download ASP.NET Core RC2 here. And go here to read the instructions on migrating from RC1 to RC2.
I wouldn't suggest even bothering with the very buggy RC1. But if you want to try and make it work, first make sure you have httpPlatformHandler v1.2 installed. Then follow the steps and issue resolutions here. If it still is not working, I've heard some people have resolved their issues by adding a Configure1() method in Startup.cs. See the details here.
EDIT:
Here is the folder structure for RC1.
approot
logs
wwwroot
You point your website to wwwroot. The contents of wwwroot should be the same as the wwwroot folder in your project.
Also, make sure you set the .NET CLR version on your application pool to No managed code.

Related

How do I setup a ASP.net Core MVC web application to IIS when publishing it creates .dll, .pdb, and .json files

I'm trying to setup the default ASP.net Core MVC Web application on my local IIS. I publish it using a folder profile, but it generates .dll, .pdb, and .json files. Before, publishing it on the Webforms would generate .aspx and .ashx files I could drag and move to the folder for my web application. I've done some googling but I haven't been able to find a solution or tutorial on what to do with these files. So I'm kinda lost and in need of assistance.
FYI I'm on VS2019 and my project uses the ASP.net Core 2.1 framework. I'm also running IIS version 10.0.19041.1.
EDIT: clarified that it should be IIS, not IIS Express.
EDIT: changed my comparison to WebForms to what it actually creates. Some reason I thought it does .html.
Hi yep it's not straight forward I had a bit off difficulty the first time.
You first have to install the support for IIS from here.
Download
But know that 2.1 is not supported any longer I think.
1 IIS > add sites
2 create your site in the inetpub folder with whatever name you like.
3 paste the content of this folder in the app. C:\Users\yourUser\source\repos\projectName\projectname\bin\Release\netcoreapp2.1\publish
4 It is an app so the .dll etc is exactly what you need. Check the doc it explains how to install the support off .net core it is not native of IIS
Official Doc
Microsoft official documentation on How to deploy the website.
youtube video
Follow carefully the Doc and it should be Ok

Error 403 after deploying Asp Net Core 2.2 website on Godaddy

I have deployed my website developed in Asp net core 2.2 on Godaddy server.
After deploying I received error 500. As discussed with the Godaddy support I removed Web.config file.
Then it started throwing error 403. There is full permission to all folders and subfolders. I have searched a lot but unable to find any solution also Godaddy support is also not satisfactory.
I can't comment yet, otherwise I would. However:
Removing the web.config may not have been the correct move. My guess is now IIS has no idea that it should be running a .Net Core app, and instead tries to directory browse, which is disallowed so you receive a 403.
I'd also be wary now if you went and added full permissions on everything.
I would suggest re-deploying it from scratch and turning on the 'stdoutLogEnabled' in the web.config temporarily. Then the site should at least attempt to run again, and record an error log in the folder specified by the 'stdoutLogFile' path in the web.config.
More about stdoutLog here:
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-2.2

Deploy .net core 3.0 on AZURE or Local

Over the last 2 days i twisted my head around deploying my WEB API.
App specification: WEB API .NET CORE 3.0 Preview 4
Firstly i tried to deploy on Azure using App Services.
Seems like they don't support .net core 3.0 but i don't really understand this since you can wrap everything in your package, wasn't this done in order to be deploy-able everywhere ?
When i'm trying to access the websitei get a
HTTP Error 500.0 - ANCM In-Process Handler Load Failure which i didn't managed to fix.
--I tried to do the same with a clean project, still same issue--
Secondly i created a virtual machine (VM) and deploy on VM.
Here i get a internal server error and i cannot debug (any tips are welcome)
Third I deployed on local IIS, here i get the following error:
"Cannot read configuration file due to insufficient permissions"
I added the permissions to IIS_IUSRS but after this i get a infinite loop
--The same i get with the clean project--
Am i doing something wrong , what could i do to deploy my Web Api Project.
The documentation suggests that it is possible to deploy preview versions, although I haven't tried it. This blogger encountered the same problem you did, and resolved it using these instructions. He says:
This document covers two different ways to fix this issue – you can
either install the preview site extensions for ASP.NET Core 3, or you
can simply change your deployment to be a self-contained application.
In this case we’re going to go with deploying a self-contained
application, since this reduces any external dependencies which seems
sensible to me.
So it seems you are correct that building a self-contained package is one way of solving this, but you have to specifically ask for that when you publish.

403.14 - Publishing Asp.Net Core App

I'm trying publish an Asp.Net Core to an IIS 8 Server.
Here is my StartUp class
First, I read this tutorial and then, proceed with deploy.
This is the schema of my iis, and the app that I'm trying deploy is that one named "cola".
and this is the configuration of Asp.net Core pool
When I run the app, I get this error.
UPDATE - 05/05/16
If I go in homolog > cola > "Directory Browsing" and enable it, I have this result, but it's wrong cause I need to be redirected to Home/Index action.
What I'm doing wrong??
I had the same issue with core 1.1
The reason was that in my published output was missed web.config file
Try add it manually
With my ASP.NET Core 2.0 site, my web.config was also missing. Once added, the 403.14 went away. I'm still having some issues, but that was my solution to this particular error.
My understanding is the web.config is only used on the server for IIS settings but it still seems strange there is little to no mention of this in the deployment documentation.
the physical path is not \wwwroot but one level higher

Published my MVC 5 site used to be webforms 4.5

I had a website in ASP.Net 4.5 Webforms on DiscountASP.Net since approx. last April. I converted my website to MVC 5. I basically re wrote it from scratch. When I click on one of the links, it redirect me to a webpage that says [To Parent Directory] and list some directories from my previous project (4.5 webforms).
I tried rebuilding the project and publishing it again and I still have the issue. I am not sure what is wrong.
Can someone try clicking on the one of the two Practice Areas links on this website: www.attorneybeaulac.com and see what might cause the issue?
I see no Index.aspx under /PracticeAreas
The pages that work have views /PracticeAreas/FamilyLaw -> FamilyLaw.aspx
Things to check:
Make sure to properly prep the server for MVC 5.
Make sure .NET 4.5 is installed since that is the framework you are building with VS 2013 (and is required for the latest)
Check that you've run regiis_aspnet -ir to register .NET 4.5
Make sure to deploy your dependencies, all of the MVC and Razor assemblies to your site bin directory.
Make sure you have site configured as a .NET 4 site.
Make sure your web/mvc/razor references have copy local set to true
Clean the deployment destination and deploy fresh

Categories

Resources