SparkDevNetwork / Rock

An open source CMS, Relationship Management System (RMS) and Church Management System (ChMS) all rolled into one.
http://www.rockrms.com
576 stars 350 forks source link

OwinStartupAttribute required in web.config to correct Server Error #884

Closed ElimAdmin closed 9 years ago

ElimAdmin commented 9 years ago

The following Server Error occurred without me making any changes to the server, nor have I upgraded Rock.

This was fixed by adding

<add key="owin:AutomaticAppStartup" value="false" /> 

missing from the

<appSettings> 

section of web.config.

This has fixed the issue for us, but I'm logging this as an issue in case there are any follow up actions required. http://stackoverflow.com/questions/20068075/owin-startup-class-missing

This also created a Mandrill webhook error email: Your Mandrill webhook at URL http://elimrms.org/Webhooks/Mandrill.ashx has failed with the following error: POST to http://elimrms.org/Webhooks/Mandrill.ashx failed with 500: and then the following error message


Server Error in '/' Application. The following errors occurred while attempting to load the app.

Exception Details: System.EntryPointNotFoundException: The following errors occurred while attempting to load the app.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[EntryPointNotFoundException: The following errors occurred while attempting to load the app.

[HttpException (0x80004005): The following errors occurred while attempting to load the app.

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34209

azturner commented 9 years ago

@ElimAdmin , Adding config setting to stop OWIN from doing automatic startup is probably not the best solution to this issue. It looks like the problem you were experiencing is due to framework finding two Startup classes in the IIS Temp folders. If you delete the IIS temp folder ( \Windows\Microsoft.NET\Framework(64)\v4.0.30319\Temporary ASP.NET Files\* ) for Rock, and remove the config setting you added, that should also fix the issue.

We are making a small config change in v3.0 (https://github.com/SparkDevNetwork/Rock/commit/bfdff9fe7bde2b8dd4ba67793160f961026037c9) to specify the OWIN Startup class that should help prevent this issue the future, but being unable to reproduce the error makes it difficult to know for sure.

treyhendon commented 9 years ago

FWIW I experienced a problem with this as well, but because I'm on a shared account I can't delete the files and am using the workaround from @ElimAdmin until 3.0 comes out. Thanks!

azturner commented 9 years ago

FYI.. v3.0 ( and 3.1 ) were released this morning.

waseemmuhammad-vteams commented 8 years ago

It works.

Thanks

karim007 commented 8 years ago

thanks a lot

aditiparakh111 commented 8 years ago

Thanks a lot ! worked perfectly for me...

seun104 commented 7 years ago

Thanks a lot!

shoeb-hasan commented 6 years ago

We have webApps and PaaS on Azure, so we don't have access to IIS. The following app-settings helped us resolving the issue:

<add key="owin:AppStartup" value="YourNameSpace_and_startup_className"/>

AshleyAS commented 5 years ago

I cannot add to my web config because it ignores the Startup.cs and keeps hangfire from operating properly. Any other solutions?

JoshuaMaiorino commented 1 year ago

I just experienced this issue on Rock v12.9 in production. I was able to fix by using the work around noted above, but figured I would just report here. It started occurring after a routine App Pool Recycle at 2:00 am