Just starting up an ASP.NET project with Visual Studio Code on a Mac
I've been through all the usual steps, ending with the dnu restore
command which completed successfully.
I then run dnx web
and I get a running localhost:5000 - but when I browse to that address there is no content.
In the terminal window I can see the error below (sorry I haven't included all of it as it's quite verbose).
info: Microsoft.Extensions.DependencyInjection.DataProtectionServices[0]
User profile is available. Using '/Users/deanchalk/.local/share/ASP.NET/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
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/
info: Microsoft.AspNet.Mvc.Controllers.ControllerActionInvoker[1]
Executing action method firstmacaspnetapp.Controllers.HomeController.Index with arguments () - ModelState is Valid'
fail: Microsoft.AspNet.Diagnostics.ExceptionHandlerMiddleware[0]
An unhandled exception has occurred: Unable to resolve service for type 'Microsoft.Dnx.Compilation.ILibraryExporter' while attempting to activate 'Microsoft.AspNet.Mvc.Razor.Compilation.RoslynCompilationService'.
System.InvalidOperationException: Unable to resolve service for type 'Microsoft.Dnx.Compilation.ILibraryExporter' while attempting to activate 'Microsoft.AspNet.Mvc.Razor.Compilation.RoslynCompilationService'.
at Microsoft.Extensions.DependencyInjection.ServiceLookup.Service.PopulateCallSites (Microsoft.Extensions.DependencyInjection.ServiceProvider provider, ISet`1 callSiteChain, System.Reflection.ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) [0x00000] in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.Service.CreateCallSite (Microsoft.Extensions.DependencyInjection.ServiceProvider provider, ISet`1 callSiteChain) [0x00000] in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetResolveCallSite (IService service, ISet`1 callSiteChain) [0x00000] in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetServiceCallSite (System.Type serviceType, ISet`1 callSiteChain) [0x00000] in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.Service.PopulateCallSites (Microsoft.Extensions.DependencyInjection.ServiceProvider provider, ISet`1 callSiteChain, System.Reflection.ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) [0x00000] in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.Service.CreateCallSite (Microsoft.Extensions.DependencyInjection.ServiceProvider provider, ISet`1 callSiteChain) [0x00000] in <filename unknown>:0
I've googled around and cannot find any info.
My project.json looks like this:
{
"version": "1.0.0-*",
"userSecretsId": "aspnet5-firstmacaspnetapp-88915393-5f54-4e2d-9285-912b92370fb0",
"compilationOptions": {
"emitEntryPoint": true
},
"tooling": {
"defaultNamespace": "firstmacaspnetapp"
},
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.SQLite": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-final",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
"Microsoft.Dnx.Runtime":"1.0.0-rc1-final",
"Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions" : "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"publishExclude": [
"**.user",
"**.vspscc"
],
"scripts": {
"prepublish": [
"npm install",
"bower install",
"gulp clean",
"gulp min"
]
}
}
Does anyone have any ideas ?