{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/4674","repository_url":"https://api.github.com/repos/aspnet/Mvc","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/4674/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/4674/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/4674/events","html_url":"https://github.com/aspnet/Mvc/issues/4674","id":155619835,"number":4674,"title":"Actions lost when referencing Microsoft.AspNetCore.Mvc in dependency ","user":{"login":"jimmypc92","id":7662382,"avatar_url":"https://avatars.githubusercontent.com/u/7662382?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmypc92","html_url":"https://github.com/jimmypc92","followers_url":"https://api.github.com/users/jimmypc92/followers","following_url":"https://api.github.com/users/jimmypc92/following{/other_user}","gists_url":"https://api.github.com/users/jimmypc92/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmypc92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmypc92/subscriptions","organizations_url":"https://api.github.com/users/jimmypc92/orgs","repos_url":"https://api.github.com/users/jimmypc92/repos","events_url":"https://api.github.com/users/jimmypc92/events{/privacy}","received_events_url":"https://api.github.com/users/jimmypc92/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-18T22:54:56Z","updated_at":"2016-05-18T22:58:38Z","closed_at":null,"body":"When you have some library that references Microsoft.AspNetCore.Mvc such as in the following project.json\r\n\r\n_ClassLibrary1 project.json_\r\n\r\n```\r\n{\r\n  \"version\": \"1.0.0-*\",\r\n\r\n  \"dependencies\": {\r\n    \"Microsoft.AspNetCore.Mvc\": \"1.0.0-rc2-final\",\r\n    \"NETStandard.Library\": \"1.5.0-rc2-24027\"\r\n  },\r\n\r\n  \"frameworks\": {\r\n    \"netstandard1.5\": {\r\n      \"imports\": \"dnxcore50\"\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nand you have an application that depends on MVC by referencing this library, it causes actions to not be added to the **ActionDescriptorCollectionProvider**.\r\n\r\nThis can be reproduced by the following steps:\r\n1\\. Create an ASP.NET Core Web Application with the default web application template\r\n![image](https://cloud.githubusercontent.com/assets/7662382/15377019/888010de-1d0d-11e6-8f82-0ad4ff8915a8.png)\r\n\r\n2\\. Add a class library as a project\r\n![image](https://cloud.githubusercontent.com/assets/7662382/15377050/c8f3c584-1d0d-11e6-81c9-9a579ba17443.png)\r\n\r\n3\\. Change project.json of the class library to the content listed above in _ClassLibrary1 project.json_\r\n\r\n4\\. Remove reference to Microsoft.AspNetCore.Mvc in web application project.json\r\n```\r\n{\r\n  \"userSecretsId\": \"{REMOVED}\",\r\n\r\n  \"dependencies\": {\r\n    \"Microsoft.NETCore.App\": {\r\n      \"version\": \"1.0.0-rc2-3002702\",\r\n      \"type\": \"platform\"\r\n    },\r\n    \"Microsoft.ApplicationInsights.AspNetCore\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.AspNetCore.Authentication.Cookies\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.AspNetCore.Diagnostics\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.AspNetCore.Identity.EntityFrameworkCore\": \"1.0.0-rc2-final\",\r\n    //\"Microsoft.AspNetCore.Mvc\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.AspNetCore.Razor.Tools\": {\r\n      \"version\": \"1.0.0-preview1-final\",\r\n      \"type\": \"build\"\r\n    },\r\n    \"Microsoft.AspNetCore.Server.IISIntegration\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.AspNetCore.Server.Kestrel\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.AspNetCore.StaticFiles\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.EntityFrameworkCore.SqlServer\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.EntityFrameworkCore.Tools\": {\r\n      \"version\": \"1.0.0-preview1-final\",\r\n      \"type\": \"build\"\r\n    },\r\n    \"Microsoft.Extensions.Configuration.EnvironmentVariables\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.Extensions.Configuration.Json\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.Extensions.Configuration.UserSecrets\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.Extensions.Logging\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.Extensions.Logging.Console\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.Extensions.Logging.Debug\": \"1.0.0-rc2-final\",\r\n    \"Microsoft.VisualStudio.Web.BrowserLink.Loader\": \"14.0.0-rc2-final\",\r\n    \"Microsoft.VisualStudio.Web.CodeGeneration.Tools\": {\r\n      \"version\": \"1.0.0-preview1-final\",\r\n      \"type\": \"build\"\r\n    },\r\n    \"Microsoft.VisualStudio.Web.CodeGenerators.Mvc\": {\r\n      \"version\": \"1.0.0-preview1-final\",\r\n      \"type\": \"build\"\r\n    }\r\n  },\r\n\r\n  \"tools\": {\r\n    \"Microsoft.AspNetCore.Razor.Tools\": {\r\n      \"version\": \"1.0.0-preview1-final\",\r\n      \"imports\": \"portable-net45+win8+dnxcore50\"\r\n    },\r\n    \"Microsoft.AspNetCore.Server.IISIntegration.Tools\": {\r\n      \"version\": \"1.0.0-preview1-final\",\r\n      \"imports\": \"portable-net45+win8+dnxcore50\"\r\n    },\r\n    \"Microsoft.EntityFrameworkCore.Tools\": {\r\n      \"version\": \"1.0.0-preview1-final\",\r\n      \"imports\": [\r\n        \"portable-net45+win8+dnxcore50\",\r\n        \"portable-net45+win8\"\r\n      ]\r\n    },\r\n    \"Microsoft.Extensions.SecretManager.Tools\": {\r\n      \"version\": \"1.0.0-preview1-final\",\r\n      \"imports\": \"portable-net45+win8+dnxcore50\"\r\n    },\r\n    \"Microsoft.VisualStudio.Web.CodeGeneration.Tools\": {\r\n      \"version\": \"1.0.0-preview1-final\",\r\n      \"imports\": [\r\n        \"portable-net45+win8+dnxcore50\",\r\n        \"portable-net45+win8\"\r\n      ]\r\n    }\r\n  },\r\n\r\n  \"frameworks\": {\r\n    \"netcoreapp1.0\": {\r\n      \"imports\": [\r\n        \"dotnet5.6\",\r\n        \"dnxcore50\",\r\n        \"portable-net45+win8\"\r\n      ]\r\n    }\r\n  },\r\n\r\n  \"buildOptions\": {\r\n    \"emitEntryPoint\": true,\r\n    \"preserveCompilationContext\": true\r\n  },\r\n\r\n  \"runtimeOptions\": {\r\n    \"gcServer\": true\r\n  },\r\n\r\n  \"publishOptions\": {\r\n    \"include\": [\r\n      \"wwwroot\",\r\n      \"Views\",\r\n      \"appsettings.json\",\r\n      \"web.config\"\r\n    ]\r\n  },\r\n\r\n  \"scripts\": {\r\n    \"prepublish\": [ \"npm install\", \"bower install\", \"gulp clean\", \"gulp min\" ],\r\n    \"postpublish\": [ \"dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%\" ]\r\n  }\r\n}\r\n```\r\n\r\n5\\. Add reference from web application to the class library.\r\n\r\n\r\nThe following can be used to verify there are no actions being found \r\n```\r\n\r\napp.UseMvc(routes =>\r\n{\r\n    routes.MapRoute(\r\n        name: \"default\",\r\n        template: \"{controller=Home}/{action=Index}/{id?}\");\r\n});\r\n\r\nif (app.ApplicationServices.GetRequiredService<IActionDescriptorCollectionProvider>().ActionDescriptors.Items.Count == 0) {\r\n    throw new Exception(\"No actions found.\");\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/comments/220182781","html_url":"https://github.com/aspnet/Mvc/issues/4674#issuecomment-220182781","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/4674","id":220182781,"user":{"login":"rynowak","id":1430011,"avatar_url":"https://avatars.githubusercontent.com/u/1430011?v=3","gravatar_id":"","url":"https://api.github.com/users/rynowak","html_url":"https://github.com/rynowak","followers_url":"https://api.github.com/users/rynowak/followers","following_url":"https://api.github.com/users/rynowak/following{/other_user}","gists_url":"https://api.github.com/users/rynowak/gists{/gist_id}","starred_url":"https://api.github.com/users/rynowak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rynowak/subscriptions","organizations_url":"https://api.github.com/users/rynowak/orgs","repos_url":"https://api.github.com/users/rynowak/repos","events_url":"https://api.github.com/users/rynowak/events{/privacy}","received_events_url":"https://api.github.com/users/rynowak/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T22:58:38Z","updated_at":"2016-05-18T22:58:38Z","body":"/cc @javiercn "}}