{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/4349","repository_url":"https://api.github.com/repos/aspnet/Mvc","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/4349/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/4349/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/4349/events","html_url":"https://github.com/aspnet/Mvc/issues/4349","id":143495040,"number":4349,"title":"Cannot cast Newtonsoft.Json.Linq.JObject to Newtonsoft.Json.Linq.JToken in Microsoft.Extensions.DependencyModel.DependencyContextJsonReader","user":{"login":"miguellira","id":1449255,"avatar_url":"https://avatars.githubusercontent.com/u/1449255?v=3","gravatar_id":"","url":"https://api.github.com/users/miguellira","html_url":"https://github.com/miguellira","followers_url":"https://api.github.com/users/miguellira/followers","following_url":"https://api.github.com/users/miguellira/following{/other_user}","gists_url":"https://api.github.com/users/miguellira/gists{/gist_id}","starred_url":"https://api.github.com/users/miguellira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguellira/subscriptions","organizations_url":"https://api.github.com/users/miguellira/orgs","repos_url":"https://api.github.com/users/miguellira/repos","events_url":"https://api.github.com/users/miguellira/events{/privacy}","received_events_url":"https://api.github.com/users/miguellira/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-25T13:07:19Z","updated_at":"2016-03-25T15:57:19Z","closed_at":null,"body":"### Steps to reproduce\r\ninstall latest dotnet cli\r\ngit clone https://github.com/aspnet/cli-samples.git\r\nupdate `project.json` with the following framework settings:\r\n```json\r\n    \"frameworks\": {\r\n        \"netstandardapp1.5\": {\r\n            \"imports\": [\r\n                \"dnxcore50\",\r\n                \"portable-net451+win8\"\r\n            ],\r\n            \"dependencies\": {\r\n                \"NETStandard.Library\": \"1.5.0-*\"\r\n            }\r\n        }\r\n    }\r\n```\r\ndotnet restore\r\ndotnet build\r\ndotnet run\r\nlaunch a browser to `http://localhost:5000`\r\n### Expected behavior\r\nHTML with a static image and \"Hello World\"\r\n### Actual behavior\r\nThe following error:\r\n```console\r\nAn unhandled exception has occurred while executing the request\r\nSystem.InvalidCastException: Cannot cast Newtonsoft.Json.Linq.JObject to Newtonsoft.Json.Linq.JToken.\r\n   at Newtonsoft.Json.Linq.Extensions.Convert[T,U](T token)\r\n   at Microsoft.Extensions.DependencyModel.DependencyContextJsonReader.Read(JObject root)\r\n   at Microsoft.Extensions.DependencyModel.DependencyContextJsonReader.Read(Stream stream)\r\n   at Microsoft.Extensions.DependencyModel.DependencyContextLoader.LoadAssemblyContext(Assembly assembly)\r\n   at Microsoft.Extensions.DependencyModel.DependencyContextLoader.Load(Assembly assembly)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultAssemblyProvider..ctor(IHostingEnvironment environment)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ClosedIEnumerableService.CallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService[T](IServiceProvider provider)\r\n   at Microsoft.AspNetCore.Mvc.Internal.ActionDescriptorCollectionProvider.GetCollection()\r\n   at Microsoft.AspNetCore.Mvc.Internal.ActionDescriptorCollectionProvider.get_ActionDescriptors()\r\n   at Microsoft.AspNetCore.Mvc.Internal.AttributeRoute.GetTreeRouter()\r\n   at Microsoft.AspNetCore.Mvc.Internal.AttributeRoute.RouteAsync(RouteContext context)\r\n   at Microsoft.AspNetCore.Routing.RouteCollection.<RouteAsync>d__9.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext()\r\n```\r\n### Environment information:\r\n```console\r\n.NET Command Line Tools (1.0.0-beta-001998)\r\n\r\nProduct Information:\r\n Version:     1.0.0-beta-001998\r\n Commit Sha:  cd35ba2a1a\r\n\r\nRuntime Environment:\r\n OS Name:     Mac OS X\r\n OS Version:  10.11\r\n OS Platform: Darwin\r\n Runtime Id:  osx.10.11-x64\r\n``` \r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/comments/201342511","html_url":"https://github.com/aspnet/Mvc/issues/4349#issuecomment-201342511","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/4349","id":201342511,"user":{"login":"pranavkm","id":174281,"avatar_url":"https://avatars.githubusercontent.com/u/174281?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavkm","html_url":"https://github.com/pranavkm","followers_url":"https://api.github.com/users/pranavkm/followers","following_url":"https://api.github.com/users/pranavkm/following{/other_user}","gists_url":"https://api.github.com/users/pranavkm/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavkm/subscriptions","organizations_url":"https://api.github.com/users/pranavkm/orgs","repos_url":"https://api.github.com/users/pranavkm/repos","events_url":"https://api.github.com/users/pranavkm/events{/privacy}","received_events_url":"https://api.github.com/users/pranavkm/received_events","type":"User","site_admin":false},"created_at":"2016-03-25T15:57:19Z","updated_at":"2016-03-25T15:57:19Z","body":"Our latest bits (from aspnetcidev) were built using `1.0.0001718` and tested* on Travis + internal CIs so it should just work. \r\n\r\n* - we use in memory servers for our tests, so we don't get coverage for tests over Kestrel and IIS. We get that indirectly via MusicStore which seems to be doing ok on OSX with that build of CLI + latest of Mvc."}}