Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ASP.NET Core deployment to IIS error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ASP.NET Core deployment to IIS error

 Post Reply Post Reply
Author
pbrowne View Drop Down
Newbie
Newbie
Avatar

Joined: 22 January 2020
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote pbrowne Quote  Post ReplyReply Direct Link To This Post Topic: ASP.NET Core deployment to IIS error
    Posted: 24 January 2020 at 1:09am
I'm getting the following error on my ASP.NET Core 3.1 site:

"The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app. "

The site is just following the Microsoft tutorial at http://docs.microsoft.com/en-us/aspnet/core//ef-rp/intro?view=aspnetcore-3.1&tabs=visual-studio - https://docs.microsoft.com/en-us/aspnet/core/data/ef-rp/intro?view=aspnetcore-3.1&tabs=visual-studio

I have set "ASPNETCORE_ENVIRONMENT": "Production" in launchSettings.json...so not sure where else I need to set this or if that is the real problem.  Any ideas?

See http://parakeetbay.com/Students - http://parakeetbay.com/Students
Back to Top
pbrowne View Drop Down
Newbie
Newbie
Avatar

Joined: 22 January 2020
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote pbrowne Quote  Post ReplyReply Direct Link To This Post Posted: 24 January 2020 at 2:01am
OK, I also included <EnvironmentName>Production</EnvironmentName> in theen publish profile .pubxml.  This has correctly set the environmentVariable in web.config:  However the problem persits.

<?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=".\ContosoUniversity.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess">
        <environmentVariables>
          <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />
        </environmentVariables>
      </aspNetCore>
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 6937ada6-9807-49f9-a251-8a1a99a61009-->
Back to Top
pbrowne View Drop Down
Newbie
Newbie
Avatar

Joined: 22 January 2020
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote pbrowne Quote  Post ReplyReply Direct Link To This Post Posted: 24 January 2020 at 7:40am
Got it sorted, it was related to a missing local express db which is not available in this hosting.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.