I have the following webconfig file produced by visual studio 2017 on a .net core application
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\SportsStore.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
<!--ProjectGuid: 5795049b-4d7e-4559-9010-f9134df11849-->
Although the publish succeed I get the following on the web page
Detailed Error Information:
Module
IIS Web Core
Notification
BeginRequest
Handler
Not yet determined
Error Code
0x8007000d
Config Error
Config File
\\?\C:\inetpub\wwwroot\sportstore\web.config
Requested URL
http://localhost:80/sportstore
Physical Path
C:\inetpub\wwwroot\sportstore
Logon Method
Not yet determined
Logon User
Not yet determined
Config Source:
-1:
0:
Because I have already work only on apache and the build in IIS express of visual studio I do not know where to start from. Internet has plethora of info and I tried many things but nothing.
Any suggestion?
Related
I am running an IIS instance (Not the default IIS Express) on which I have configured my ASP.NET Core 3.1 MVC project.
I would like to configure my web.config file, so that I have the following behavior:
Each time i update a view (.cshtml file) in my solution, the update is instantly visible after i refresh the page.
Each time i update a controller or a model (.cs file) the update becomes visible after a rebuild of the solution.
What I currently have is the following configuration in my root directory:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\bin\Debug\netcoreapp3.1\Live.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
Now with the following configuration I have to rebuild each time I want to see the result of my modifications. There's also another problem, each time I rebuild the app I encounter the following problem:
1>D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4502,5): error MSB3021: Unable to copy file "obj\Debug\netcoreapp3.1\Live.dll" to "bin\Debug\netcoreapp3.1\Live.dll". The process cannot access the file 'bin\Debug\netcoreapp3.1\Live.dll' because it is being used by another process.
I have to manually stop the IIS instance and then rebuild my solution.
I have worked on a project where this was the way things were done, however I never figured out how it was configured. I would appreciate any help if possible, Thanks.
I'm trying to deploy a netcore2.0 MVC app to IIS and keep getting the error above.
The file permissions are set correctly and I checked that the runtime is downloaded.
The error is as follows:
Module
IIS Web Core
Notification
Unknown
Handler
Not yet determined
Error Code
0x8007000d
Config Error
Config File
\\?\E:\Dev\test-deploy\web.config
Requested URL
http://localhost:4231/
Physical Path
Logon Method
Not yet determined
Logon User
Not yet determined
Following is my Config File (generated by vs code):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\Coneckt.Web.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
<!--ProjectGuid: 2833ed36-9a18-47b6-8f33-8998356796d9-->
This error occurs because the ApplicationHost.config or Web.config file contains a malformed XML element, you need to delete the malformed XML element from the ApplicationHost.config or Web.config file.
You can also refer to this link about how to deploy ASP.NET Core on IIS: Host ASP.NET Core on Windows with IIS.
We are moving our websites from a 2008 r2 server running IIS 7.5. The first program I moved over was asp.net core when attempting to run it I get the error HTTP Error 500.19 - Internal Server Error with the error code 0x8007000d. This starts my internet search unfortunately I don't have a config error which would narrow down the search quite a bit and none of the solutions I found worked. This code works on the old server just fine and I don't have anything in my code specifying the cpu so it not set to 32 bit.
Everything I have tried points me in the direction that the web.config file cannot be accessed. one of the reasons I say that is when I try to open configuration editor I receive the error the data is invalid (Exception from HRESULT: 0x8007000D) below is the web.config that I am using.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\Brochure_Fulfillment.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: e089189f-00f3-48ee-9532-1c03776dad6a-->
Using IIS 10 and .NET Core 2.0
The web.config was generated from a new .NET Core MVC project.
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\MvcMovie.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
With it in this configuration I can't open the configuration editor in IIS and gives a 500.19 error:
Config Source:
-1:
0:
If I remove the <aspNetCore /> node, it will open in the configuration editor in IIS but will give a 500.21 error:
Handler "aspNetCore" has a bad module "AspNetCoreModule" in its module list
What would I do to get about fixing this?
It sounds like you haven't installed the IIS Hosting bundle.
Go here: https://www.microsoft.com/net/download/all
Click the version of ".NET Core Runtime" that you need, then download the "Hosting Bundle Installer" under "Windows".
I'm getting an HTTP 502.5 error when trying to run my ASP.NET core 2.0 web app from IIS.
I've installed the .NET Core Windows Server Hosting Bundle and checked all my IIS settings as per this document https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/index?tabs=aspnetcore2x
The web.config looks like this.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\OscarWeb.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
The Windows event log produces the following errors.
It is IIS v6.2 running on Windows Server 2012 R2. The web application was built using ASP.NET Core 2.0.
When I run dotnet from the commandline as follows there are no errors:
dotnet oscarweb.dll
The first thing you have to do in this scenario is to create the logs folder if it is missing and check the stdout logs generated.
It can be several different things but from personal experience the most common issue i had was IIS not having enough permissions to run it. In IIS you can configure the Identity used in Advanced Settings. If it is using ApplicationPoolIdentity then change it to LocalSystem and see if it works. The logs in the stdtout file however will give you the answer.
The solution to this problem (in my case at least) was to reboot the web server. After installing the .NET Core Windows Server Hosting Bundle you need to reboot the server for them to be registered correctly.
Thanks to Chris Pratt (first comment underneath my question) for suggesting the answer :)
Not sure if your webconfig is complete. I believe aspnetcore tag needs to have the ASPNETCORE_ENVIRONMENT environment variable set as well.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\OscarWeb.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" >
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="YourRuntimeEnv" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</configuration>