Rohit Nair
Rohit Nair

Reputation: 43

Add Blazor support to existing ASP .NET Core 2.1 MVC application

I was looking at the Microsoft's new Blazor framework. It looks hugely impressive and would really help developers like me that has most of my Background in Desktop. Most of the Examples and tutorials that i see tells you how to start from scratch. I already have an existing .net core(2.1) MVC project with Ef core , Identity a that i wanted to add Blazor support. And i couldn't figure out how to do it. so hereby hoping someone here Might have faced similar issue and figured it or some one more knowledgeable may help me Thank you

Upvotes: 4

Views: 966

Answers (1)

Flores
Flores

Reputation: 8942

I wrote a blogpost about that: http://flores.eken.nl/mixing-blazor-and-mvc-pages-in-one-app/

Basically:

In the startup.cs of your site, change the app.UseBlazor() statement to:

app.Map("/bzr", child => { child.UseBlazor<Blazor.Program>(); });

And in the index.html in the wwwroot, alter the base href to:

<base href="/bzr/" />

Upvotes: 4

Related Questions