4

I have developed asp.net core 2.0 webapi and hosting in IIS. I installed the hosting bundle as mentioned in Hosting Bundle Installation

But for some reason i am getting the following error:

An error occurred while starting the application.

.NET Core 4.6.25815.02 X64 v4.0.0.0    |   Microsoft.AspNetCore.Hosting version 2.0.0-rtm-26452    |    Microsoft Windows 6.1.7601 S 

Some of the error lines in stdout...

warn: Microsoft.AspNetCore.DataProtection.Repositories.EphemeralXmlRepository[50]
      Using an in-memory repository. Keys will not be persisted to storage.
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[59]
      Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
warn: Microsoft.AspNetCore.DataProtection.Repositories.EphemeralXmlRepository[50]
      Using an in-memory repository. Keys will not be persisted to storage.
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[59]
      Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
warnwarn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
      No XML encryptor configured. Key {973e8bbf-2ca5-4c7f-a2ac-2672c9bb8041} may be persisted to storage in unencrypted form.
: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
      No XML encryptor configured. Key {973e8bbf-2ca5-4c7f-a2ac-2672c9bb8041} may be persisted to storage in unencrypted form.
Hosting environment: Production
Content root path: C:\Elay\PublishOutput
Now listening on: http://localhost:30127
Application started. Press Ctrl+C to shut down.
fail: Microsoft.EntityFrameworkCore.Database.Connection[200004]

Any help?

8
  • Seems like an error in EF, Please check this vivekthangaswamy.blogspot.com/2017/08/… Commented Nov 29, 2017 at 15:08
  • Also please check the answer here stackoverflow.com/questions/45941707/… Commented Nov 29, 2017 at 15:09
  • Thanks. i am using the database on the same machine where i have iis. so dont think it is connection issue. Commented Nov 29, 2017 at 15:10
  • 1
    Well, it is a connection issue, since that's the failure message you're getting. Perhaps the connection string is wrong/not set properly. Commented Nov 29, 2017 at 15:28
  • 1
    @Darkonekt you are right , it is due to wrong connection. Thanks Commented Nov 30, 2017 at 10:41

2 Answers 2

4

There are a couple of settings you can add on to the WebHost.CreateDefaultBuilder() method that will show detailed error messages instead of generic one when hosting .NET Core 2 apps in IIS.

.UseSetting("detailedErrors", "true")

.CaptureStartupErrors(true)

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

2

This was due to wrong connection details. It works fine with the correct credentials. thanks

2 Comments

Can you share what was wrong? We have the same issue but I swear it was working before we republished and now not.. the connection string looks OK
I would also be interested what needs to be changed in order to remove this warnings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.