Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4136

How do you import the builder lines for the Program.cs file from a Blazor to a Razor project?

$
0
0

I have a massive Razor project that I'm trying to convert to Blazor. To make things easier, I want to incorporate Blazor into the Razor project as I convert pieces over so I don't need to keep switching between two projects nor account for the base URL in any paths when publishing.

For the particular Blazor component I'm using, the documentation specifies that this line is required in your Program.cs file:

builder.Services.AddBlazorBootstrap();

Since going from Blazor to Razor isn't 1-to-1, I'm not sure on the syntax of what needs to be changed to integrate this line into my Razor project nor where specifically in the file it needs to go (If it needs to be nested).

Does anyone have any insight on how to add this line into my Program.cs file?

EDIT: I figured it out, but in case anyone else needed an answer, I thought I should clarify a few things.

The Razor project started in .NET 5.0, so it still has the startup.cs. This solution only applies if that's what you're using.


Viewing all articles
Browse latest Browse all 4136

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>