aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

No service for type 'Microsoft.Framework.Runtime.ILibraryManager' has been registered.

Open TomGroeneboer opened this issue 11 years ago • 8 comments

Hi guys,

I'm currently exploring the new version of ASP.NET, and I can't get this issue fixed...

When I run an empty ASP.NET 5 project it throws the following error:

Server Error in '/' Application.

No service for type 'Microsoft.Framework.Runtime.ILibraryManager' has been registered.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: No service for type 'Microsoft.Framework.Runtime.ILibraryManager' has been registered.

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:

[InvalidOperationException: No service for type 'Microsoft.Framework.Runtime.ILibraryManager' has been registered.] System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +303

[HttpException (0x80004005): No service for type 'Microsoft.Framework.Runtime.ILibraryManager' has been registered.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9940016 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261


My project is just the default generated code, nothing more.

I'm using the 1.0.0-beta5 clr x64 on windows 8.1.

Thanks!

TomGroeneboer avatar Jul 07 '15 13:07 TomGroeneboer

This looks like a duplicate of this SO question.

@TomGroeneboer can you please share the project.json file?

victorhurdugaci avatar Jul 07 '15 15:07 victorhurdugaci

I've got the problem, some dependencies in project.json weren't beta5, which I think is weird. The generated code from VS should just work out of the box, right?

TomGroeneboer avatar Jul 08 '15 07:07 TomGroeneboer

We actually have a bug with that. Visual studio will always use the beta5 packages but it will update the DNX based on your default alias (this will be fixed in a future VS version). So if you run dnvm upgrade, whatever version you upgrade to, you'll end up using the version in visual studio. Check your global.json for the version a specific project is using.

Sorry for the pain!

davidfowl avatar Jul 08 '15 07:07 davidfowl

Hmm, the global.json says 1.0.0-beta5 out of the box. But the dependencies aren't updated to that version. dnvm list tells me that 1.0.0-beta5 clr x86 is set as default.

TomGroeneboer avatar Jul 08 '15 07:07 TomGroeneboer

Visual Studio templates are baked to a specific version of the packages and they don't update until VS updates

davidfowl avatar Jul 08 '15 07:07 davidfowl

I see, thanks for the help guys!

TomGroeneboer avatar Jul 08 '15 07:07 TomGroeneboer

Right so you need to update the packages and code manually.

davidfowl avatar Jul 08 '15 08:07 davidfowl

It's now running! :) I'm trying to port some ASP.NET 4.5 applications to the new version of ASP.NET. A lot of things changed, now trying to understand the Middleware thing

TomGroeneboer avatar Jul 08 '15 08:07 TomGroeneboer