Skip to content

[WebToolsE2E]Create Blazor(ASP.NET Core hosted) project, add **.Client project reference Blazor Class library project, meet an error:"*** exited with code -532462766" #10651

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
javiercn opened this issue May 30, 2019 · 7 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

Comments

@javiercn
Copy link
Member

INSTALL STEPS

  1. Clean machine: Win Server 2019 ENU
  2. Install Dev16.1.1 VSE(Web + .NetCore workload)
    Install Dev16.1.1 VSE from: https://aka.ms/vs/16/release/vs_Enterprise.exe
    Select Web + .NetCore workload
    check 2.2 and 1.x Development tools
  3. Install CLI 3.0 Preview6 (3.0.100-preview6-012101) from: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x64.exe
  4. Add private feeds below into NuGet.config file:
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="dotnet-windowsdesktop" value="https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json" />
<add key="aspnet-aspnetcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json" />
<add key="aspnet-aspnetcore-tooling" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json" />
<add key="aspnet-entityframeworkcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json" />
<add key="aspnet-extensions" value="https://dotnetfeed.blob.co re.windows.net/aspnet-extensions/index.json" />

REPRO STEPS

Install the Blazor VSIX to get the Blazor(ASP.NET Core hosted) template.
Run dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview6-19278-02 (the version is under the folder dotnet\shared\Microsoft.AspNetCore.App in machine)to install the Blazor CLI templates.
File > New Project > ASP.NET Core Web Application > ASP.ENT Core 3.0 ~ .NET Core > Blazor(ASP.NET Core hosted), click Create.
F5, meet error 900412
open a command prompt at the location of the solution folder and Blazor Class library to the solution by running:dotnet new blazorlib -o BlazorLib1
dotnet sln add BlazorLib1
dotnet add reference BlazorLib1
Return to VS, Click reload
Build, and meet an error in Output.
ACTUAL

Severity Code Description Project File Line Suppression State
Error MSB3073 The command "dotnet "C:\Users\v-wajian.nuget\packages\microsoft.aspnetcore.blazor.mono\0.10.0-preview-20190325.1\build\netstandard1.0../../tools/illink/illink.dll" -l none --verbose --strip-security true --exclude-feature com --exclude-feature sre -v false -c link -u link -b true -d "C:\Users\v-wajian.nuget\packages\microsoft.aspnetcore.blazor.mono\0.10.0-preview-20190325.1\build\netstandard1.0../../tools/mono/bcl/" -d "C:\Users\v-wajian.nuget\packages\microsoft.aspnetcore.blazor.mono\0.10.0-preview-20190325.1\build\netstandard1.0../../tools/mono/bcl/Facades/" -o "C:\Users\v-wajian\source\repos\WebApplication1\WebApplication1.Client\obj\Debug\netstandard2.0\blazor\linker/" -x "C:\Users\v-wajian.nuget\packages\microsoft.aspnetcore.blazor.build\3.0.0-preview6-19253-01\targets\BuiltInBclLinkerDescriptor.xml" -x "C:\Users\v-wajian\source\repos\WebApplication1\WebApplication1.Client\obj\Debug\netstandard2.0\blazor\linker.descriptor.xml" -a "C:\Users\v-wajian.nuget\packages\microsoft.aspnetcore.blazor\3.0.0-preview6-19253-01\lib\netstandard2.00\Microsoft.AspNetCore.Blazor.dll" -a "C:\Users\v-wajian.nuget\packages\microsoft.aspnetcore.components\3.0.0-preview6-19278-02\lib\netstandard2.0\Microsoft.AspNetCore.Components.dll" -a "C:\Users\v-wajian.nuget\packages\microsoft.aspnetcore.components.browser\3.0.0-preview6-19278-02\lib\netstandard2.0\Microsoft.AspNetCore.Components.Browser.dll" -a "C:\Users\v-wajian.nuget\packages\microsoft.extensions.dependencyinjection\3.0.0-preview6.19274.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.dll" -a "C:\Users\v-wajian.nuget\packages\microsoft.extensions.dependencyinjection.abstractions\3.0.0-preview6.19274.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll" -a "C:\Users\v-wajian.nuget\packages\microsoft.jsinterop\3.0.0-preview6.19274.1\lib\netstandard2.0\Microsoft.JSInterop.dll" -a "C:\Users\v-wajian.nuget\packages\mono.webassembly.interop\3.0.0-preview6.19252.2\lib\netstandard2.0\Mono.WebAssembly.Interop.dll" -a "C:\Users\v-wajian.nuget\packages\system.componentmodel.annotations\4.6.0-preview6.19273.5\lib\netstandard2.0\System.ComponentModel.Annotations.dll" -a "C:\Users\v-wajian\source\repos\WebApplication1\BlazorLib1\bin\Debug\netstandard2.0\BlazorLib1.dll" -a "C:\Users\v-wajian\source\repos\WebApplication1\WebApplication1.Shared\bin\Debug\netstandard2.0\WebApplication1.Shared.dll"   -a "C:\Users\v-wajian\source\repos\WebApplication1\WebApplication1.Client\obj\Debug\netstandard2.0\WebApplication1.Client.dll"" exited with code -532462766. WebApplication1.Client C:\Users\v-wajian.nuget\packages\microsoft.aspnetcore.blazor.build\3.0.0-preview6-19253-01\targets\Blazor.MonoRuntime.targets 439  
@javiercn
Copy link
Member Author

Actual error is this. Seems like the linker is missing a reference. We'll have to check the build code to see what we pass to the linker.

Fatal error in IL Linker

Unhandled Exception: Mono.Linker.LoadException: Error while processing references of 'blazorhosted.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Microsoft.Extensions.Logging.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Microsoft.Extensions.Logging.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at Mono.Linker.DirectoryAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
at Mono.Linker.AssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
at Mono.Linker.LinkContext.Resolve(IMetadataScope scope)
at Mono.Linker.LinkContext.Resolve(IMetadataScope scope)
at Mono.Linker.LinkContext.ResolveReferences(AssemblyDefinition assembly)
at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences(AssemblyDefinition assembly)
at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences(AssemblyDefinition assembly)
--- End of inner exception stack trace ---
at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences(AssemblyDefinition assembly)
at Mono.Linker.Steps.LoadReferencesStep.ProcessAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.BaseStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at Mono.Linker.Driver.Run(ILogger customLogger)
at Mono.Linker.Driver.Execute(String[] args, ILogger customLogger)
at Mono.Linker.Driver.Main(String[] args)

@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label May 30, 2019
@mkArtakMSFT mkArtakMSFT added this to the 3.0.0-preview6 milestone May 30, 2019
@mkArtakMSFT mkArtakMSFT added bug This issue describes a behavior which is not expected - a bug. PRI: 1 - Required and removed investigate labels May 30, 2019
@javiercn
Copy link
Member Author

I think the issue here is that Microsoft.AspNetCore.Components references <AspNetCoreAppReference Include="Microsoft.AspNetCore.Authorization" /> which is only in the shared framework and that tries to bring in Microsoft.Extensions.Logging.Abstractions and that causes the linker to blow up.

Disabling the linker gets the app to build (after fixing build errors, the templates need updating) but the application is still completely busted.

image

I'm not sure what our options here are.

  • Produce Microsoft.AspNetCore.Authorization as a package?
  • Take authorization bits out of Microsoft.AspNetCore.Components and into a separate package? (Would be part of the shared framework)
  • Remove auth support and re-add it to preview7?

I haven't tried, but I believe all blazor client-side might be busted.

@rynowak
Copy link
Member

rynowak commented May 31, 2019

Produce Microsoft.AspNetCore.Authorization as a package

This is the plan of record. If this isn't happening then that's what we need to figure out.

@javiercn
Copy link
Member Author

PR is out to make this happen: #10684

@javiercn javiercn added Working Done This issue has been fixed and removed Working labels May 31, 2019
@javiercn
Copy link
Member Author

Fix is in, pending verification.

@ar0311
Copy link
Contributor

ar0311 commented Aug 5, 2019

I'm getting a similar error on preview 7 - with the IL linker blowing up about Microsoft.Extensions.Logging when compiling a client side Blazor project generated from the hosted blazor template. This seems to be caused by referencing Identity in the xxxx.Shared project.

I have got it to compile happily by manually adding a PackageReference to Microsoft.Extensions.Logging in the blazor client project csproj file (latest available preview7.19362.4, slightly different to the rest of the packages preview7.19365.7)

Should I file a new issue or post details and repro details here?

@javiercn
Copy link
Member Author

javiercn commented Aug 5, 2019

Hi @ar0311.

It looks like you are posting on a closed issue!

We're very likely to lose track of your bug/feedback/question unless you:

  1. Open a new issue
  2. Explain very clearly what you need help with
  3. If you think you have found a bug, include detailed repro steps so that we can investigate the problem

@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
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
Projects
None yet
Development

No branches or pull requests

4 participants