TrilonIO / aspnetcore-Vue-starter

*NEW* Asp.net Core & Vue.js (ES6) SPA Starter kit - Vuex, webpack, Web API, Docker, and more! By @TrilonIO
https://www.trilon.io
MIT License
1.22k stars 266 forks source link

Migration from ASP.NET Core 2.2 to 3.0, #139

Open UseMuse opened 5 years ago

UseMuse commented 5 years ago

adaptation of the project for asp core 3.0 with hot reload by Westwind.AspnetCore.LiveReload,because hot reload from asp core 2.2 stopped working

MarkPieszak commented 5 years ago

Hey @UseMuse !

Just seeing this now, did you have any other issues with this upgrade? I need to take a deeper look, I know that with NodeServices etc deprecated I'm wondering what kind of issues we might experience here

UseMuse commented 5 years ago

@MarkPieszak

             //the design is obsolete
            // Webpack initialization with hot-reload.
                app.UseWebpackDevMiddleware (new WebpackDevMiddlewareOptions
                {
                    HotModuleReplacement = true,
                });

suggest using Use Microsoft.AspNetCore.SpaServices.Extensions

I just marked the Configure method as Obsolete

design

 app.UseMvc (routes =>
            {
                routes.MapRoute (
                    name: "default",
                    template: "{controller = Home} / {action = Index} / {id?}");

                routes.MapSpaFallbackRoute (
                    name: "spa-fallback",
                    defaults: new {controller = "Home", action = "Index"});
            });

gives a warning:

Using 'UseMvc' to configure MVC is not supported while using Endpoint Routing. To continue using 'UseMvc', please set 'MvcOptions.EnableEndpointRouting = false' inside 'ConfigureServices'.

In the ConfigureServices Method in replaced it

  services.AddMvc ()
                .SetCompatibilityVersion (CompatibilityVersion.Version_2_2);

on this

            // Add framework services.
            services.AddMvc (opt => opt.EnableEndpointRouting = false)
                .SetCompatibilityVersion (CompatibilityVersion.Version_3_0);

//with explicit opt ​​=> opt.EnableEndpointRouting = false

also a discussion on my proposed update can be seen here: https://github.com/TrilonIO/aspnetcore-Vue-starter/issues/138

UseMuse commented 5 years ago

@Laranjeiras did you start with my fork? what mistake do you have?