Skip to content

Blazor: Mono linker path not properly quoted #17754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jspuij opened this issue Dec 10, 2019 · 9 comments
Closed

Blazor: Mono linker path not properly quoted #17754

jspuij opened this issue Dec 10, 2019 · 9 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. Done This issue has been fixed feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly

Comments

@jspuij
Copy link
Contributor

jspuij commented Dec 10, 2019

Describe the bug

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

To Reproduce

Try to compile a blazor wasm project from a machine with a space in the username. See this gist, at "_LinkBlazorApplication":

https://gist.githubusercontent.com/TofuEcho/0d110f8cad83071406dcd8f48d928fbc/raw/259d63b7e9b541cdc17475b142fa8c7a7e537a62/gistfile1.txt

Further technical details

  • ASP.NET Core version 3.1.0
@jspuij jspuij changed the title Mono linker path not properly quoted Blazor: Mono linker path not properly quoted Dec 10, 2019
@danroth27 danroth27 added area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. labels Dec 10, 2019
@pranavkm pranavkm added the feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly label Dec 11, 2019
@Flearz
Copy link

Flearz commented Dec 11, 2019

Got the same problem, "ILLink failed with exited code 1" even with a blank project...

@jspuij
Copy link
Contributor Author

jspuij commented Dec 11, 2019

@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="&quot;$(MonoLinkerPath)&quot;"
        AssemblyPaths="@(_BlazorAssemblyToLink)"
        RootAssemblyNames="@(_BlazorLinkerRoot)"
        RootDescriptorFiles="@(BlazorLinkerDescriptor)"
        OutputDirectory="$(BlazorIntermediateLinkerOutputPath)"
        ExtraArgs="$(_BlazorLinkerAdditionalOptions)"
        ToolExe="$(_DotNetHostFileName)"
        ToolPath="$(_DotNetHostDirectory)" />

@Flearz
Copy link

Flearz commented Dec 11, 2019

@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

@jspuij
Copy link
Contributor Author

jspuij commented Dec 11, 2019

@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.

@javiercn
Copy link
Member

@jspuij thanks for contacting us.

We'll take a look at the issue and get back to you.

@SeppPenner
Copy link

SeppPenner commented Dec 17, 2019

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.

@TroelsL
Copy link

TroelsL commented Dec 19, 2019

Same issue here. Spent an evening tracking this down before finding this post. Can confirm that the workaround worked. Thanks!

pranavkm added a commit that referenced this issue Jan 8, 2020
* Pass the same closure of assemblies that is used by the SDK's linker to Blazor's linker and ResolveBlazorRuntimeDependencies task
* Quote the mono linker path

Fixes #17644
Fixes #17754
@zhou-xb
Copy link

zhou-xb commented Jan 9, 2020

@jspuij thank you so much, how can you be that rocking smart?

pranavkm added a commit that referenced this issue Jan 15, 2020
* Handle satellite assemblies in the Blazor build targets

* Pass the same closure of assemblies that is used by the SDK's linker to Blazor's linker and ResolveBlazorRuntimeDependencies task
* Quote the mono linker path

Fixes #17644
Fixes #17754
@SeppPenner
Copy link

@jkotalik Nice :)

@ghost ghost locked as resolved and limited conversation to collaborators Feb 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. Done This issue has been fixed feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly
Projects
None yet
Development

No branches or pull requests

9 participants