Here are the details about our development environment:
DevExpress 20.2.3 (we are using DevExtreme)
Microsoft Visual Studio Enterprise 2019 (Version 16.4.6)
ASP.NET Core 3.1.0
AspNetCore.Mvc 3.1.0.0
Microsoft SQL Server 2008 R2 (RTM) –
dotnet –version 3.1.300
Our Deployment Server environment details are:
Windows Server 2016 Standard 64-bit OS
dotnet –version 3.1.300
IIS version 10
We aim to use build & deploy/package using dotnet commandline:
Microsoft Windows [Version 10.0.17763.1697] (c) 2018 Microsoft Corporation. All rights reserved.
C:\Windows\system32>D:
D:>%comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat"
** Visual Studio 2019 Developer Command Prompt v16.8.2 ** Copyright (c) 2020 Microsoft Corporation
D:>cd D:\AppCodeArena\StrangeAcmeApplication\
D:\AppCodeArena\StrangeAcmeApplication>dotnet --version
3.1.300
D:\AppCodeArena\StrangeAcmeApplication>dotnet clean
…..Output...blah….blah….blah…..Output... 0 errors
D:\AppCodeArena\StrangeAcmeApplication>dotnet build -c Release
--runtime win10-x64 .\StrangeAcmeApplication.Uploaders.sln…..Output...blah….blah….blah…..Output... 0 errors
D:\AppCodeArena\StrangeAcmeApplication>dotnet publish .\src\StrangeAcmeApplication.Uploaders\StrangeAcmeApplication.Uploaders.csproj --runtime win10-x64 --no-build -c Release --output .\PublishedDirectory /p:DebugType=None /p:DebugSymbols=false /p:EnvironmentName=Development --self-contained true Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core Copyright (C) Microsoft Corporation. All rights reserved.
StrangeAcmeApplication.Uploaders -> D:\AppCodeArena\StrangeAcmeApplication\PublishedDirectory\
Within the .\PublishedDirectory\appsettings.json is the following content:
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } }, "AllowedHosts": "*" }
Within the .\PublishedDirectory\appsettings.Development.json is the following content:
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } }, "ConnectionStrings": { "dbConnectionString": "Data Source=BlahSQLServerBlah;Initial Catalog=BlahDatabaseInstanceBlah;Persist Security Info=True;User ID=blahUserNameblah;Password=blahblah"
} }
Finally within the .\PublishedDirectory\web.config, we have the following content:
< ?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=".\InvestorCentral.Uploaders.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess">
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>
</aspNetCore>
</system.webServer> </location> </configuration>
However, I keep getting the following error when I deploy to IIS Server:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module IIS Web Core
Notification Unknown
Handler Not yet determined
Error Code 0x8007000d
Config Error
Config File
\?\D:\webSites\StrangeAcmeApplication.Published\web.configRequested URL http://localhost:32769/
Physical Path
Logon Method Not yet determined
Logon User Not yet determined
Config Source: -1: 0:
@lex-li and @yiyi-you Thank you for your comments.
I feel kind of silly because the problem was that the server in question needed to have .NET Core Hosting Bundle installed on it (For my case, it's specifically .Net Core 3.1.12 Hosting Bundle for x64 bit ):
User contributions licensed under CC BY-SA 3.0