{"action":"opened","issue":{"url":"https://api.github.com/repos/aspnet/Identity/issues/832","repository_url":"https://api.github.com/repos/aspnet/Identity","labels_url":"https://api.github.com/repos/aspnet/Identity/issues/832/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Identity/issues/832/comments","events_url":"https://api.github.com/repos/aspnet/Identity/issues/832/events","html_url":"https://github.com/aspnet/Identity/issues/832","id":156111759,"number":832,"title":"ASP.NET Core RC2 Seed Data using Services","user":{"login":"kjanshair","id":8051020,"avatar_url":"https://avatars.githubusercontent.com/u/8051020?v=3","gravatar_id":"","url":"https://api.github.com/users/kjanshair","html_url":"https://github.com/kjanshair","followers_url":"https://api.github.com/users/kjanshair/followers","following_url":"https://api.github.com/users/kjanshair/following{/other_user}","gists_url":"https://api.github.com/users/kjanshair/gists{/gist_id}","starred_url":"https://api.github.com/users/kjanshair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjanshair/subscriptions","organizations_url":"https://api.github.com/users/kjanshair/orgs","repos_url":"https://api.github.com/users/kjanshair/repos","events_url":"https://api.github.com/users/kjanshair/events{/privacy}","received_events_url":"https://api.github.com/users/kjanshair/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-21T17:02:44Z","updated_at":"2016-05-21T17:02:44Z","closed_at":null,"body":"I've been using ASP.NET 5 RC1 in which I've an application in which I seed administrative credentials into the data base using Services as follows:\r\n\r\n`public void ConfigureServices(IServiceCollection services)\r\n    {\r\n        services.AddEntityFramework()\r\n                .AddSqlServer()\r\n                .AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(Configuration[\"Data:DefaultConnection:ConnectionString\"]));\r\n\r\n        services.AddIdentity<AdministratorUser, IdentityRole>()\r\n            .AddEntityFrameworkStores<ApplicationDbContext>()\r\n            .AddDefaultTokenProviders();\r\n\r\n        services.AddMvc();\r\n\r\n        services.AddTransient<AdministratorSeedData>();\r\n    }`\r\n\r\nHere is the connection string sub-object:\r\n\r\n`\"ConnectionString\": \"Server=.;Database=kjanshair;Trusted_Connection=True;\"`\r\n\r\nAnd the service that I use to seed data is being seeded using the Administrative seed data. It all works fine but when I port it to RC2, with the following changes in the startup as:\r\n\r\n`public void ConfigureServices(IServiceCollection services)\r\n    {\r\n        services.AddDbContext<ApplicationDbContext>(options => \r\n        options.UseSqlServer(Configuration[\"Data:DefaultConnection:ConnectionString\"]));\r\n\r\n        services.AddIdentity<ApplicationUser, IdentityRole>()\r\n            .AddEntityFrameworkStores<ApplicationDbContext>()\r\n            .AddDefaultTokenProviders();\r\n\r\n        services.AddMvc();\r\n\r\n        services.AddTransient<AdministratorSeedData>();\r\n    }`\r\n\r\nwith the connection string as:\r\n\r\n`\"ConnectionString\": \"Server=.;Database=_CHANGE_ME;Trusted_Connection=True;\"`\r\n\r\nI get an exception in Configure() method\r\n\r\n`public async void Configure(IApplicationBuilder app, AdministratorSeedData seeder)\r\n    {\r\n        app.UseIdentity();\r\n\r\n        app.UseMvcWithDefaultRoute();\r\n\r\n        await seeder.EnsureSeedData(); //Here exception occurs\r\n    }`\r\n\r\nsaying:\r\n\r\n`Message = \"Cannot open database \\\"_CHANGE_ME\\\" requested by the login. The login failed.\\r\\nLogin failed for user 'DESKTOP-55E4D9H\\\\Janshair Khan'.\"`\r\n\r\nWhy Am I getting this error? I've looked all over the alternatives but couldn't resolved."}}
{"actor":{"display_login":"kjanshair"}}