Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.

OOB SPA templates for 2.0 should use 2.0 Program.cs convention #442

Closed
dasMulli opened this issue Apr 4, 2018 · 4 comments
Closed

OOB SPA templates for 2.0 should use 2.0 Program.cs convention #442

dasMulli opened this issue Apr 4, 2018 · 4 comments

Comments

@dasMulli
Copy link

dasMulli commented Apr 4, 2018

The out of band SPA Templates for 2.0 use the CreateWebHostBuilder() convention for Program.cs, causing dotnet-ef to fail when trying to add EF support (getting the error message suggesting IDesignTimeDbContextFactory).

Not sure what to plan for the OOB templates is but they should use the BuildWebHost() convention so that adding EF Core will work without trouble.

@Eilon
Copy link
Member

Eilon commented Apr 4, 2018

Hi @dasMulli , is this in reference to the Microsoft.AspNetCore.SpaTemplates package? If so, that was retired per aspnet/Announcements#289. If not, can you point at the specific template(s) in this repo that are affected?

@dasMulli
Copy link
Author

dasMulli commented Apr 4, 2018

Specifically this one: https://github.com/aspnet/templating/blob/rel/2.0.x-spa-templates-oob/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/Program.cs

If this is the branch that was used to produce https://www.nuget.org/packages/Microsoft.DotNet.Web.Spa.ProjectTemplates/2.0.0 then #78 broke it work with 2.0.* EF tooling (without modifying or adding an explicit design time db factory).

Found it while putting together step-by-step instructions to add EF Core to an Angular SPA project (which now has a step to modify the Program.cs).

@dasMulli
Copy link
Author

dasMulli commented Apr 4, 2018

If you're considering to update the oob template package again before 2.1 (at which point it would work automatically with new EF tooling), it could also benefit from some dependency updates 😉 (Microsoft.AspNetCore.All for example)

@Eilon Eilon modified the milestone: 2.2.0 Apr 9, 2018
@Eilon
Copy link
Member

Eilon commented Apr 9, 2018

Ah OK, then no, we're not planning to do a further update here. In 2.1 everything should be good.

@Eilon Eilon closed this as completed Apr 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants