Skip to content
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

Provide a clearer error message when IL Linker fails due to a native dependency #12916

Open
danroth27 opened this issue Feb 8, 2019 · 19 comments

Comments

@danroth27
Copy link

commented Feb 8, 2019

From @Awr0ra on Friday, 08 February 2019 23:17:09

This error showes after installing nuget packages EntityFrameworkCore.SqlServer in new project that based on template "Blazor (ASP.NET Core hosted)"

1. My dotnet --info

PM> dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.0.100-preview-010184
Commit: c57bde4593

Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.0.100-preview-010184\

Host (useful for support):
Version: 3.0.0-preview-27324-5
Commit: 63a01b08e5

.NET Core SDKs installed:
2.1.503 [C:\Program Files\dotnet\sdk]
2.2.103 [C:\Program Files\dotnet\sdk]
3.0.100-preview-010184 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview-19075-0444 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview-27324-5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0-preview-27325-3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

2. Error text (trimmed)

Error MSB3073
The command "dotnet "C:\Users\User.nuget\packages\microsoft.aspnetcore.blazor.mono\0.8.0-preview-20190204.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\User.nuget\packages\microsoft.aspnetcore.blazor.mono\0.8.0-preview-20190204.1\build\netstandard1.0../../tools/mono/bcl/" -d
"C:\Users\User.nuget\packages\microsoft.aspnetcore.blazor.mono\0.8.0-preview-20190204.1\build\netstandard1.0../../tools/mono/bcl/Facades/" -o
"D:\Projects_awr\Home\WebApplication1\WebApplication1.Client\obj\Debug\netstandard2.0\blazor\linker/" -x
"C:\Users\User.nuget\packages\microsoft.aspnetcore.blazor.build\0.8.0-preview-19104-04\targets\BuiltInBclLinkerDescriptor.xml" -x
"D:\Projects_awr\Home\WebApplication1\WebApplication1.Client\obj\Debug\netstandard2.0\blazor\linker.descriptor.xml" -a
"C:\Users\User.nuget\packages\microsoft.aspnetcore.blazor\0.8.0-preview-19104-04\lib\netstandard2.0\Microsoft.AspNetCore.Blazor.dll" -a
"C:\Users\User.nuget\packages\microsoft.aspnetcore.components\3.0.0-preview-19075-0444\lib\netstandard2.0\Microsoft.AspNetCore.Components.dll" -a
"C:\Users\User.nuget\packages\microsoft.aspnetcore.components.browser\3.0.0-preview-19075-0444\lib\netstandard2.0\Microsoft.AspNetCore.Components.Browser.dll" -a
"C:\Users\User.nuget\packages\microsoft.entityframeworkcore\2.2.1\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll" -a
"C:\Users\User.nuget\packages\microsoft.entityframeworkcore.abstractions\2.2.1\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Abstractions.dll" -a
"C:\Users\User.nuget\packages\microsoft.entityframeworkcore.relational\2.2.1\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Relational.dll" -a
"C:\Users\User.nuget\packages\microsoft.entityframeworkcore.sqlserver\2.2.1\lib\netstandard2.0\Microsoft.EntityFrameworkCore.SqlServer.dll" -a
"C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.caching.abstractions\2.2.0\lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.dll" -a
"C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.caching.memory\2.2.0\lib\netstandard2.0\Microsoft.Extensions.Caching.Memory.dll" -a
"C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.configuration\2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll" -a

......

"C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.security.principal.windows\4.5.0\runtimes\win\lib\netstandard1.3\System.Security.Principal.Windows.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.text.encoding.codepages\4.5.0\runtimes\win\lib\netstandard2.0\System.Text.Encoding.CodePages.dll" -a "D:\Projects_awr\Home\WebApplication1\WebApplication1.Shared\bin\Debug\netstandard2.0\WebApplication1.Shared.dll" -a "D:\Projects_awr\Home\WebApplication1\WebApplication1.Client\obj\Debug\netstandard2.0\WebApplication1.Client.dll"
" exited with code 1.
WebApplication1.Client
C:\Users\User.nuget\packages\microsoft.aspnetcore.blazor.build\0.8.0-preview-19104-04\targets\Blazor.MonoRuntime.targets 439

Copied from original issue: aspnet/Blazor#1784

@danroth27

This comment has been minimized.

Copy link
Author

commented Feb 8, 2019

From @danroth27 on Friday, 08 February 2019 23:57:31

Looks like a potential linker issue.

@lewing

This comment has been minimized.

Copy link
Member

commented Feb 13, 2019

  System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
     at Mono.Cecil.PE.ImageReader.ReadOptionalHeaders(UInt16& subsystem, UInt16& dll_characteristics, UInt16& linker) in /Users/lewing/Source/linker/cecil/Mono.Cecil.PE/ImageReader.cs:line 195
     at Mono.Cecil.PE.ImageReader.ReadImage() in /Users/lewing/Source/linker/cecil/Mono.Cecil.PE/ImageReader.cs:line 85
     at Mono.Cecil.PE.ImageReader.ReadImage(Disposable`1 stream, String file_name) in /Users/lewing/Source/linker/cecil/Mono.Cecil.PE/ImageReader.cs:line 759
     at Mono.Cecil.ModuleDefinition.ReadModule(Disposable`1 stream, String fileName, ReaderParameters parameters) in /Users/lewing/Source/linker/cecil/Mono.Cecil/ModuleDefinition.cs:line 1151
     at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters) in /Users/lewing/Source/linker/cecil/Mono.Cecil/ModuleDefinition.cs:line 1123
     at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters) in /Users/lewing/Source/linker/cecil/Mono.Cecil/AssemblyDefinition.cs:line 134
     at Mono.Linker.LinkContext.Resolve(String name)
     at Mono.Linker.Steps.ResolveFromAssemblyStep.Process()
     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)
@lewing

This comment has been minimized.

Copy link
Member

commented Feb 13, 2019

This appears to be coming from runtime.win-x86.runtime.native.system.data.sqlclient.sni/4.4.0/runtimes/win-x86/native/sni.dll and cecil throws an exception because there is no CLI header for this native windows dll

@Awr0ra

This comment has been minimized.

Copy link

commented Feb 15, 2019

and what should i do to run my app?

@faina09

This comment has been minimized.

Copy link

commented Mar 6, 2019

same issue here, using Microsoft.EntityFrameworkCore.SqlServer Version="3.0.0-preview.19074.3".
Actually seems to be not possible to use EF in Blazor 0.8.0, but I have a working sample with Blazor 0.7.0 and Microsoft.EntityFrameworkCore.SqlServer 2.1.4

@dennis-garavsky

This comment has been minimized.

Copy link

commented Mar 24, 2019

We experienced the same issue with Blazor 0.9 and https://nuget.org/packages/DevExpress.Xpo.
It seems that aspnet/AspNetCore#8158 may be related as well - JFYI.

@SyMind

This comment has been minimized.

Copy link

commented Apr 12, 2019

same issue.

dotnet new blazor -o WebApplication1
cd WebApplication1
dotnet run

and throw error.

@w26ak

This comment has been minimized.

Copy link

commented Apr 16, 2019

I have read that the possible solution could be to update the reference of System.Data.SqlClient to 4.7.0-preview3.19128.7. I tried to do that but it did not seem to work for me (or maybe I was doing something wrong).
Was anybody lucky to solve this issue? Does anyone knows a workaround in this case?

@dennis-garavsky

This comment has been minimized.

Copy link

commented Apr 16, 2019

I have read that the possible solution could be to update the reference of System.Data.SqlClient to 4.7.0-preview3.19128.7. I tried to do that but it did not seem to work for me (or maybe I was doing something wrong).

I tried the same workaround, but it did not work for me as well.

@MaurizioVerde

This comment has been minimized.

Copy link

commented Apr 17, 2019

I had same problem. Not sure if the same environment.
I had a 'code first' context in the 'shared' project part and there i installed EF nuget packages.
The error shown up when i installed EFCore.SqlServer.
So i left model class only in the shared project part and moved context ,DAL methods and EF nuget in the 'server' project part. i had to install nuget for ComponentModel.DataAssociations in the 'shared'.
Then i compiled with no errors, and i used models in 'client' retrieving data through a controller call.

image

Hope it could help
Maurizio

@w26ak

This comment has been minimized.

Copy link

commented Apr 18, 2019

Hi @MaurizioVerde
Thank you for so quick solution :)
As far as I understand you used the regular approach where you have a server side REST API and a client (Blazor project) which is calling that API through HttpClient. This is fine and it is working just fine. However this case is a little different from the regular one. The idea is to use EF Core right in the client project. The real beauty should be that you do not need to have any server side REST API - you can just use EF Core on the client side and forget about REST API.
Please correct me if I am wrong but this is one of the best coming features which should make Blazor so great and popular.

@MaurizioVerde

This comment has been minimized.

Copy link

commented Apr 18, 2019

Hi @w26ak
i knew it was too easy to be the real solution, sorry :)
Compared with my MVC 5 previous (years ago) experience, this one is already exciting.
but … call an entity collection client side would be great ("great" don't suffice)

@michaelccote

This comment has been minimized.

Copy link

commented May 5, 2019

I'm having the same problem as of today.

1. dotnet --info

_SDK .NET Core (reflétant tous les global.json) :
Version: 3.0.100-preview4-011223
Commit: 118dd862c8

Environnement d'exécution :
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.0.100-preview4-011223\

Host (useful for support):
Version: 3.0.0-preview4-27615-11
Commit: ee54d4cbd2

.NET Core SDKs installed:
2.1.403 [C:\Program Files\dotnet\sdk]
2.1.500 [C:\Program Files\dotnet\sdk]
2.1.502 [C:\Program Files\dotnet\sdk]
2.1.503 [C:\Program Files\dotnet\sdk]
2.1.504 [C:\Program Files\dotnet\sdk]
2.1.505 [C:\Program Files\dotnet\sdk]
2.1.600-preview-009426 [C:\Program Files\dotnet\sdk]
2.1.600-preview-009472 [C:\Program Files\dotnet\sdk]
2.1.600-preview-009497 [C:\Program Files\dotnet\sdk]
2.1.600 [C:\Program Files\dotnet\sdk]
2.1.601 [C:\Program Files\dotnet\sdk]
2.1.602 [C:\Program Files\dotnet\sdk]
2.1.700-preview-009597 [C:\Program Files\dotnet\sdk]
2.1.700-preview-009601 [C:\Program Files\dotnet\sdk]
2.2.300-preview-010050 [C:\Program Files\dotnet\sdk]
3.0.100-preview4-011223 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview4-19216-03 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview4-27615-11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0-preview4-27613-28 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download_

2. Error Text

Error MSB3073 The command "dotnet "C:\Users\michaelccote.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\michaelccote.nuget\packages\microsoft.aspnetcore.blazor.mono\0.10.0-preview-20190325.1\build\netstandard1.0../../tools/mono/bcl/" -d "C:\Users\michaelccote.nuget\packages\microsoft.aspnetcore.blazor.mono\0.10.0-preview-20190325.1\build\netstandard1.0../../tools/mono/bcl/Facades/" -o "C:\Users\michaelccote\source\Workspaces\TeknionVB\TekWeb\TekWeb.Client\obj\Debug\netstandard2.0\blazor\linker/" -x "C:\Users\michaelccote.nuget\packages\microsoft.aspnetcore.blazor.build\3.0.0-preview4-19216-03\targets\BuiltInBclLinkerDescriptor.xml" -x "C:\Users\michaelccote\source\Workspaces\TeknionVB\TekWeb\TekWeb.Client\obj\Debug\netstandard2.0\blazor\linker.descriptor.xml" -a "C:\Users\michaelccote.nuget\packages\microsoft.aspnetcore.blazor\3.0.0-preview4-19216-03\lib\netstandard2.0\Microsoft.AspNetCore.Blazor.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.aspnetcore.components\3.0.0-preview4-19216-03\lib\netstandard2.0\Microsoft.AspNetCore.Components.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.aspnetcore.components.browser\3.0.0-preview4-19216-03\lib\netstandard2.0\Microsoft.AspNetCore.Components.Browser.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.entityframeworkcore\3.0.0-preview4.19216.3\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.entityframeworkcore.abstractions\3.0.0-preview4.19216.3\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Abstractions.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.entityframeworkcore.relational\3.0.0-preview4.19216.3\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Relational.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.entityframeworkcore.sqlserver\3.0.0-preview4.19216.3\lib\netstandard2.0\Microsoft.EntityFrameworkCore.SqlServer.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.extensions.caching.abstractions\3.0.0-preview4.19216.2\lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.extensions.caching.memory\3.0.0-preview4.19216.2\lib\netstandard2.0\Microsoft.Extensions.Caching.Memory.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.extensions.configuration\3.0.0-preview4.19216.2\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.extensions.configuration.abstractions\3.0.0-preview4.19216.2\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.extensions.configuration.binder\3.0.0-preview4.19216.2\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.extensions.dependencyinjection\3.0.0-preview4.19216.2\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.extensions.dependencyinjection.abstractions\3.0.0-preview4.19216.2\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.extensions.logging\3.0.0-preview4.19216.2\lib\netstandard2.0\Microsoft.Extensions.Logging.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.extensions.logging.abstractions\3.0.0-preview4.19216.2\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.extensions.options\3.0.0-preview4.19216.2\lib\netstandard2.0\Microsoft.Extensions.Options.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.extensions.primitives\3.0.0-preview4.19216.2\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.jsinterop\3.0.0-preview4.19216.2\lib\netstandard2.0\Microsoft.JSInterop.dll" -a "C:\Users\michaelccote.nuget\packages\microsoft.win32.registry\4.6.0-preview4.19212.13\lib\netstandard2.0\Microsoft.Win32.Registry.dll" -a "C:\Users\michaelccote.nuget\packages\mono.webassembly.interop\3.0.0-preview4.19216.2\lib\netstandard2.0\Mono.WebAssembly.Interop.dll" -a "C:\Users\michaelccote.nuget\packages\remotion.linq\2.2.0\lib\netstandard1.0\Remotion.Linq.dll" -a "C:\Users\michaelccote.nuget\packages\system.buffers\4.5.0\lib\netstandard2.0\System.Buffers.dll" -a "C:\Users\michaelccote.nuget\packages\system.collections.immutable\1.6.0-preview4.19212.13\lib\netstandard2.0\System.Collections.Immutable.dll" -a "C:\Users\michaelccote.nuget\packages\system.componentmodel.annotations\4.6.0-preview4.19212.13\lib\netstandard2.0\System.ComponentModel.Annotations.dll" -a "C:\Users\michaelccote.nuget\packages\system.data.sqlclient\4.7.0-preview4.19212.13\lib\netstandard2.0\System.Data.SqlClient.dll" -a "C:\Users\michaelccote.nuget\packages\system.diagnostics.diagnosticsource\4.6.0-preview4.19212.13\lib\netstandard1.3\System.Diagnostics.DiagnosticSource.dll" -a "C:\Users\michaelccote.nuget\packages\system.interactive.async\3.2.0\lib\netstandard2.0\System.Interactive.Async.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.linq\4.1.0\lib\netstandard1.6\System.Linq.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.linq.expressions\4.1.0\lib\netstandard1.6\System.Linq.Expressions.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.linq.queryable\4.0.1\lib\netstandard1.3\System.Linq.Queryable.dll" -a "C:\Users\michaelccote.nuget\packages\system.memory\4.5.2\lib\netstandard2.0\System.Memory.dll" -a "C:\Users\michaelccote.nuget\packages\system.numerics.vectors\4.4.0\lib\netstandard2.0\System.Numerics.Vectors.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.objectmodel\4.0.12\lib\netstandard1.3\System.ObjectModel.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.reflection.emit\4.0.1\lib\netstandard1.3\System.Reflection.Emit.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.reflection.emit.ilgeneration\4.0.1\lib\netstandard1.3\System.Reflection.Emit.ILGeneration.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.reflection.emit.lightweight\4.0.1\lib\netstandard1.3\System.Reflection.Emit.Lightweight.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.reflection.typeextensions\4.1.0\lib\netstandard1.5\System.Reflection.TypeExtensions.dll" -a "C:\Users\michaelccote.nuget\packages\system.runtime.compilerservices.unsafe\4.6.0-preview4.19212.13\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll" -a "C:\Users\michaelccote.nuget\packages\system.security.accesscontrol\4.6.0-preview4.19212.13\lib\netstandard2.0\System.Security.AccessControl.dll" -a "C:\Users\michaelccote.nuget\packages\system.security.principal.windows\4.6.0-preview4.19212.13\lib\netstandard2.0\System.Security.Principal.Windows.dll" -a "C:\Users\michaelccote.nuget\packages\system.text.encoding.codepages\4.6.0-preview4.19212.13\lib\netstandard2.0\System.Text.Encoding.CodePages.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.threading\4.0.11\lib\netstandard1.3\System.Threading.dll" -a "C:\Users\michaelccote.nuget\packages\system.threading.tasks.extensions\4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll" -a "C:\Users\michaelccote\source\Workspaces\TeknionVB\TekWeb\TekWeb.Shared\bin\Debug\netstandard2.0\TekWeb.Shared.dll" -a "C:\Users\michaelccote\source\Workspaces\TeknionVB\TekWeb\TekWeb.Client\obj\Debug\netstandard2.0\TekWeb.Client.dll"" exited with code -532462766.

@w26ak

This comment has been minimized.

Copy link

commented May 8, 2019

I believe the key ingredient in this case is the project type. Basically Visual Studio provides you with 3 types of Blazor project:

  • Server-side (runs on SignalR)
  • ASP.NET Core Hosted (JS + REST)
  • Client-side (JS)

My mistake was that I chose Client-side and was trying to add reference to Microsoft.EntityFrameworkCore.SqlServer. After I changed project type to Server-side, it worked.

@michaelccote

This comment has been minimized.

Copy link

commented May 9, 2019

I believe the key ingredient in this case is the project type. Basically Visual Studio provides you with 3 types of Blazor project:

  • Server-side (runs on SignalR)
  • ASP.NET Core Hosted (JS + REST)
  • Client-side (JS)

My mistake was that I chose Client-side and was trying to add reference to Microsoft.EntityFrameworkCore.SqlServer. After I changed project type to Server-side, it worked.

I don't think it was a mistake on your end. I think it's a bug in Mono itself when you try to reference a shared project that has the NuGet Package Microsoft.EntityFrameworkCore.SqlServer in it. But yes i also noticed that building a Project Server-Side works perfectly from A to Y (Can't quite confirm that it works well up to Z).

You need to understand that even though they look very similar, these project types behaviour is very different on the backend (Client-Side vs Server-Side). I invite you to watch this amazing conference that @danroth27 gave this week on Blazor during the Microsoft Build event.

@MaurizioVerde

This comment has been minimized.

Copy link

commented May 10, 2019

@w26ak I had this error avoided thanks to this solution found in a discussion on CodeProject https://www.codeproject.com/Articles/1244729/ASP-NET-Core-Blazor-CRUD-using-Entity-Framework-an?msg=5590822#xx5590822xx
<PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> <RestoreAdditionalProjectSources> https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; https://dotnet.myget.org/F/blazor-dev/api/v3/index.json; </RestoreAdditionalProjectSources> <LangVersion>7.3</LangVersion> <RazorLangVersion>3.0</RazorLangVersion> <BlazorLinkOnBuild>false</BlazorLinkOnBuild> </PropertyGroup>
Editing the project you need to add a property in propertyGroup <BlazorLinkOnBuild>false</BlazorLinkOnBuild> and the compile error vanish.
The bad part is SqlServer calls get a "Cannot connect to SQL Server Browser. Ensure SQL Server Browser has been started."
Guess what? SQL Server Browser has been started. So i'm trying to figure out how to make sqlserver calls work from the client (server project works fine "From A to Y" like @michaelccote said (he made me laugh :) )

Hoping in a "non voodoo" solution

@michaelccote

This comment has been minimized.

Copy link

commented May 10, 2019

@w26ak I had this error avoided thanks to this solution found in a discussion on CodeProject https://www.codeproject.com/Articles/1244729/ASP-NET-Core-Blazor-CRUD-using-Entity-Framework-an?msg=5590822#xx5590822xx
<PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> <RestoreAdditionalProjectSources> https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; https://dotnet.myget.org/F/blazor-dev/api/v3/index.json; </RestoreAdditionalProjectSources> <LangVersion>7.3</LangVersion> <RazorLangVersion>3.0</RazorLangVersion> <BlazorLinkOnBuild>false</BlazorLinkOnBuild> </PropertyGroup>
Editing the project you need to add a property in propertyGroup <BlazorLinkOnBuild>false</BlazorLinkOnBuild> and the compile error vanish.
The bad part is SqlServer calls get a "Cannot connect to SQL Server Browser. Ensure SQL Server Browser has been started."
Guess what? SQL Server Browser has been started. So i'm trying to figure out how to make sqlserver calls work from the client (server project works fine "From A to Y" like @michaelccote said (he made me laugh :) )

Hoping in a "non voodoo" solution

I tried the solution that @MaurizioVerde proposed. At least the entire solution now compiles but i can't get it to run.

Capture2

Just to be a bit clearer to people ending up on this page, here's what i've tried :

  1. Double click on your Client projet to open Client.csproj.
  2. Add the following line right after the RazorLangVersion property :

Capture

@MaurizioVerde

This comment has been minimized.

Copy link

commented May 10, 2019

@michaelccote i have .NetCore 3.0 preview 5 SDK installed and VS preview updated and so do Blazor.
I noticed some error i dont remember before the update. I dont know if you incurred in the same situation

Furthermore my project have no <OutputType>Exe</OutputType>

@danroth27 danroth27 changed the title Blazor error MSB3073 (.Net Core SDK 3.0.100) Provide a clearer error message when IL Linker fails due to a native dependency May 17, 2019

@danroth27

This comment has been minimized.

Copy link
Author

commented May 17, 2019

@lewing We're seeing issues like this one reported a lot where the IL Linker fails due to a native dependency. The error message provided by the linker is cryptic and opaque (The command dotnet illink.dlll ... exited with error code 1). The ask here is to have the linker provide a clearer error message. I've updated the issue title accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.