The new BlazorILLink task does not properly quote the MonoLinkerPath, so usernames with e.g. spaces make the linker task fail.
See: https://github.com/aspnet/AspNetCore/blob/master/src/Components/Blazor/Build/src/targets/Blazor.MonoRuntime.targets#L204
Try to compile a blazor wasm project from a machine with a space in the username. See this gist, at "_LinkBlazorApplication":
Got the same problem, "ILLink failed with exited code 1" even with a blank project...
@Flearz workaround is to edit the file ".nuget\packages\microsoft.aspnetcore.blazor.build\3.1.0-preview4.19579.2\targets\Blazor.MonoRuntime.targets" in your home directory and change:
<BlazorILLink
ILLinkPath="$(MonoLinkerPath)"
AssemblyPaths="@(_BlazorAssemblyToLink)"
RootAssemblyNames="@(_BlazorLinkerRoot)"
RootDescriptorFiles="@(BlazorLinkerDescriptor)"
OutputDirectory="$(BlazorIntermediateLinkerOutputPath)"
ExtraArgs="$(_BlazorLinkerAdditionalOptions)"
ToolExe="$(_DotNetHostFileName)"
ToolPath="$(_DotNetHostDirectory)" />
into
<BlazorILLink
ILLinkPath=""$(MonoLinkerPath)""
AssemblyPaths="@(_BlazorAssemblyToLink)"
RootAssemblyNames="@(_BlazorLinkerRoot)"
RootDescriptorFiles="@(BlazorLinkerDescriptor)"
OutputDirectory="$(BlazorIntermediateLinkerOutputPath)"
ExtraArgs="$(_BlazorLinkerAdditionalOptions)"
ToolExe="$(_DotNetHostFileName)"
ToolPath="$(_DotNetHostDirectory)" />
@jspuij
This works thank you so much, I've been stuck with this for hours. Hope they will correct this soon.
Have a nice week.
Rihen
P.S. Even though I put the project in my SSD root, it was not working
@Flearz You're welcome ;-)
The fact that it was not working is that the linker is started from the nuget package folder, which resides in the users home directory. Project location is not relevant in this case.
@jspuij thanks for contacting us.
We'll take a look at the issue and get back to you.
I'm seeing the same issue.
This works thank you so much, I've been stuck with this for hours. Hope they will correct this soon.
@Flearz Glad it was hours only for you. Days for me :)
EDIT: The workaround is awesome. Thanks to @jspuij.
Same issue here. Spent an evening tracking this down before finding this post. Can confirm that the workaround worked. Thanks!
@jspuij thank you so much, how can you be that rocking smart?
@jkotalik Nice :)
Most helpful comment
@Flearz workaround is to edit the file ".nuget\packages\microsoft.aspnetcore.blazor.build\3.1.0-preview4.19579.2\targets\Blazor.MonoRuntime.targets" in your home directory and change:
into