Dnx not loading dll's from packages folder in a Kestrel site
Closed this issue · 1 comments
I have a project that runs a kestrel site from a command, however on several machines I am getting internal server errors when attempting to request a page from the kestrel site once it is up. In doing some investigating it appears that the project dependencies are not getting loaded. When the kestrel site gets a request it fails when trying to reflect over the controllers because the Asp.Net Web Pages package is not loaded (System.Web.WebPages.dll). The project builds within Visual Studio 2015 so the dependencies are present and being loaded from the project.json file in some cases.
I added a console logger on startup when running the command from the console and I got this output
verb: Microsoft.AspNet.Hosting.Internal.HostingEngine[4]
Hosting starting
verb: Microsoft.AspNet.Hosting.Internal.HostingEngine[5]
Hosting started
Hosting environment: Production
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[1]
Request starting HTTP/1.1 GET http://localhost:5000/
verb: Microsoft.AspNet.StaticFiles.StaticFileMiddleware[4]
The request path / does not match a supported file type
verb: Microsoft.AspNet.StaticFiles.StaticFileMiddleware[4]
The request path / does not match a supported file type
verb: Microsoft.AspNet.StaticFiles.StaticFileMiddleware[4]
The request path / does not match a supported file type
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[3]
Request finished in 0.0969ms 500
fail: Microsoft.AspNet.Server.Kestrel[13]
An unhandled exception was thrown by the application.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeAssembly.get_DefinedTypes()
at Microsoft.AspNet.Mvc.Controllers.DefaultControllerTypeProvider.<>c.<get_ControllerTypes>b__5_0(Assembly a)
at System.Linq.Enumerable.d__162.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator
1.MoveNext()
at Microsoft.AspNet.Mvc.ApplicationModels.DefaultApplicationModelProvider.OnProvidersExecuting(ApplicationModelProviderContext context)
at Microsoft.AspNet.Mvc.Controllers.ControllerActionDescriptorProvider.BuildModel()
at Microsoft.AspNet.Mvc.Controllers.ControllerActionDescriptorProvider.GetDescriptors()
at Microsoft.AspNet.Mvc.Controllers.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
at Microsoft.AspNet.Mvc.Infrastructure.DefaultActionDescriptorsCollectionProvider.GetCollection()
at Microsoft.AspNet.Mvc.Infrastructure.DefaultActionDescriptorsCollectionProvider.get_ActionDescriptors()
at Microsoft.AspNet.Mvc.Routing.AttributeRoute.GetInnerRoute()
at Microsoft.AspNet.Mvc.Routing.AttributeRoute.RouteAsync(RouteContext context)
at Microsoft.AspNet.Routing.RouteCollection.d__9.MoveNext()
--- 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 Microsoft.AspNet.Builder.RouterMiddleware.d__4.MoveNext()
--- 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 Microsoft.AspNet.Hosting.Internal.RequestServicesContainerMiddleware.d__3.MoveNext()
--- 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 Microsoft.AspNet.Hosting.Internal.HostingEngine.<>c__DisplayClass32_0.<b__0>d.MoveNext()
--- 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 Microsoft.AspNet.Server.Kestrel.Http.Frame.d__79.MoveNext()
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[1]
Request starting HTTP/1.1 GET http://localhost:5000/favicon.ico
verb: Microsoft.AspNet.StaticFiles.StaticFileMiddleware[5]
The request path /favicon.ico does not match an existing file
verb: Microsoft.AspNet.StaticFiles.StaticFileMiddleware[5]
The request path /favicon.ico does not match an existing file
verb: Microsoft.AspNet.StaticFiles.StaticFileMiddleware[5]
The request path /favicon.ico does not match an existing file
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[3]
Request finished in 0.0031ms 500
fail: Microsoft.AspNet.Server.Kestrel[13]
An unhandled exception was thrown by the application.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeAssembly.get_DefinedTypes()
at Microsoft.AspNet.Mvc.Controllers.DefaultControllerTypeProvider.<>c.<get_ControllerTypes>b__5_0(Assembly a)
at System.Linq.Enumerable.d__162.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator
1.MoveNext()
at Microsoft.AspNet.Mvc.ApplicationModels.DefaultApplicationModelProvider.OnProvidersExecuting(ApplicationModelProviderContext context)
at Microsoft.AspNet.Mvc.Controllers.ControllerActionDescriptorProvider.BuildModel()
at Microsoft.AspNet.Mvc.Controllers.ControllerActionDescriptorProvider.GetDescriptors()
at Microsoft.AspNet.Mvc.Controllers.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
at Microsoft.AspNet.Mvc.Infrastructure.DefaultActionDescriptorsCollectionProvider.GetCollection()
at Microsoft.AspNet.Mvc.Infrastructure.DefaultActionDescriptorsCollectionProvider.get_ActionDescriptors()
at Microsoft.AspNet.Mvc.Routing.AttributeRoute.GetInnerRoute()
at Microsoft.AspNet.Mvc.Routing.AttributeRoute.RouteAsync(RouteContext context)
at Microsoft.AspNet.Routing.RouteCollection.d__9.MoveNext()
--- 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 Microsoft.AspNet.Builder.RouterMiddleware.d__4.MoveNext()
--- 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 Microsoft.AspNet.Hosting.Internal.RequestServicesContainerMiddleware.d__3.MoveNext()
--- 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 Microsoft.AspNet.Hosting.Internal.HostingEngine.<>c__DisplayClass32_0.<b__0>d.MoveNext()
--- 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 Microsoft.AspNet.Server.Kestrel.Http.Frame.d__79.MoveNext()
project.json
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true,
"warningsAsErrors": true
},
"dependencies": {
"EPiServer.ClientTDDSupport": "9.3.8-beta",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel --server.urls=http://*:5000/",
"web-test": "Microsoft.AspNet.Server.Kestrel"
},
"frameworks": {
"dnx451": { }
},
"exclude": [
"wwwroot",
"node_modules"
],
"publishExclude": [
"**.user",
"**.vspscc"
]
}
launchSettings.json
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:52485/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"Hosting:Environment": "Development"
}
},
"web": {
"commandName": "web",
"environmentVariables": {
"Hosting:Environment": "Development"
}
}
}
}
Fusion Log entry for System.Web upon site request
SystemWebLoadFailure.zip
@jason-masterson DNX is being retired in RC2. Let us know if you have issues when you get to try it with dotnet CLI.