Skip to content

Bootstrapper Exception on IIS: The Main function returned unexpectedly ... #735

@guardrex

Description

@guardrex

For my ADAL on dnxcore50 project (dnx-coreclr-win-x64.1.0.0-beta6-12189): When the first request hits the app after deployment, I'm getting:

    Exception type: SEHException 
    Exception message: External component has thrown an exception.
   at AspNet.Loader.Bootstrapper.<>c__DisplayClass2_0.<LoadApplicationK10>b__0(Object _)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at AspNet.Loader.Bootstrapper.LoadApplicationK10(String appId, String appConfigPath, IProcessHostSupportFunctions supportFunctions, LoadApplicationData* pLoadAppData, Int32 loadAppDataSize, String runtimePackagePath, String appBasePath)
   at AspNet.Loader.Bootstrapper.LoadApplication(String appId, String appConfigPath, IProcessHostSupportFunctions supportFunctions, LoadApplicationData* pLoadAppData, Int32 loadAppDataSize)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Web.Hosting.ProcessHost.System.Web.Hosting.IProcessHostLite.ReportCustomLoaderError(String appId, Int32 hr, AppDomain newlyCreatedAppDomain)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)   at System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException)

subsequent requests result in

    Exception type: Exception 
    Exception message: The Main function returned unexpectedly with status code -2146233079.
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at AspNet.Loader.Bootstrapper.LoadApplicationK10(String appId, String appConfigPath, IProcessHostSupportFunctions supportFunctions, LoadApplicationData* pLoadAppData, Int32 loadAppDataSize, String runtimePackagePath, String appBasePath)
   at AspNet.Loader.Bootstrapper.LoadApplication(String appId, String appConfigPath, IProcessHostSupportFunctions supportFunctions, LoadApplicationData* pLoadAppData, Int32 loadAppDataSize)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Web.Hosting.ProcessHost.System.Web.Hosting.IProcessHostLite.ReportCustomLoaderError(String appId, Int32 hr, AppDomain newlyCreatedAppDomain)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)   at System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException)

Searching states that it's a symptom of something else in Need investigation: Crossgen coreclr KRE will break the IIS hosted scenario - dnx/issues/1319, which is the "path too long" issue, and Downlevel App cannot start on full IIS - dnx/issues/793.

Dependencies are

"Microsoft.IdentityModel.Protocol.Extensions": "2.0.0-*",
"Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-*",
"Microsoft.AspNet.Diagnostics": "1.0.0-*",
"Microsoft.AspNet.Server.IIS": "1.0.0-*",
"Microsoft.AspNet.StaticFiles": "1.0.0-*",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-*",
"Microsoft.Framework.ConfigurationModel": "1.0.0-*",
"Microsoft.AspNet.Authentication.OpenIdConnect": "1.0.0-*",
"Microsoft.AspNet.Identity": "3.0.0-*",
"Microsoft.AspNet.Http": "1.0.0-*",
"System.Runtime.Serialization.Json": "4.0.0-beta-*",
"Microsoft.IdentityModel.Clients.ActiveDirectory": "3.5.207081303-alpha"

This app runs fine from localhost ... it's failing on IIS 8 (WS 2012). I can put up a repo if that would help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions