Bronzato
Bronzato

Reputation: 9332

Blazor WebAssembly slow at compile (up to 30 secs)

My Blazor WebAssembly project is became slow at compile. It takes about 25-30 seconds to compile even with a tiny modification in one of my razor components.

I already tried to set BlazorWebassemblyEnableLinking to false in my all 3 .csproj files without any effect.

<PropertyGroup>
    <BlazorWebassemblyEnableLinking>false</BlazorWebassemblyEnableLinking>
</PropertyGroup>

This was suggested here https://remibou.github.io/Make-your-Blazor-development-faster/

Tested scenario:

I know this is preview of Blazor Wasm but it was a pain to code in this situation.

Any advices for speeding up the coding process ?

I found a trick to speed up compilation time. Simply create a new folder (let's say Pages excluded) right click, Exclude from project. Then I moved a maximum of razor components inside of it. If I am currently busy working on a specific part of my Blazor application, I moved all files except that part to the excluded folder. In my case compilation time goes from 30 secs to 5 secs. When needed (before releasing for publishing something) I simply have to move back excluded files to original Page folder. This trick suits my needs for now until compilation times will be better (I hope in a near future).

Upvotes: 3

Views: 1743

Answers (1)

Bronzato
Bronzato

Reputation: 9332

I found a trick to speed up compilation time. Simply create a new folder (let's say Pages excluded) right click, Exclude from project. Then I moved a maximum of razor components inside of it. If I am currently busy working on a specific part of my Blazor application, I moved all files except that part to the excluded folder. In my case compilation time goes from 30 secs to 5 secs. When needed (before releasing for publishing something) I simply have to move back excluded files to original Page folder. This trick suits my needs for now until compilation times will be better (I hope in a near future).

enter image description here

Upvotes: 3

Related Questions