This repository was archived by the owner on Nov 13, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 13, 2026. It is now read-only.
System.Data.SqlClient build fails on macOS #7353
Copy link
Copy link
Closed
Description
I change from EFCore to Dapper Library. it's very fast x2
but I get an error when has compiled to native
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 54.67 ms for /Users/chitpong/Sourcecode/aws-lambda-lambdanative-db/src/aws-lambda-lambdanative/aws-lambda-lambdanative.csproj.
aws-lambda-lambdanative -> /Users/chitpong/Sourcecode/aws-lambda-lambdanative-db/src/aws-lambda-lambdanative/bin/Release/netcoreapp2.2/osx-x64/aws-lambda-lambdanative.dll
/usr/local/opt/llvm/bin/clang
Generating native code
EXEC : warning : RD.XML processing will change before release (https://github.com/dotnet/corert/issues/5001) [/Users/chitpong/Sourcecode/aws-lambda-lambdanative-db/src/aws-lambda-lambdanative/aws-lambda-lambdanative.csproj]
Undefined symbols for architecture x86_64:
"_NetSecurityNative_ImportPrincipalName", referenced from:
_System_Data_SqlClient_Interop_NetSecurityNative__ImportPrincipalName in aws-lambda-lambdanative.o
ld: symbol(s) not found for architecture x86_64
clang-8 : error : linker command failed with exit code 1 (use -v to see invocation) [/Users/chitpong/Sourcecode/aws-lambda-lambdanative-db/src/aws-lambda-lambdanative/aws-lambda-lambdanative.csproj]
/Users/chitpong/.nuget/packages/microsoft.dotnet.ilcompiler/1.0.0-alpha-27625-01/build/Microsoft.NETCore.Native.targets(337,5): error MSB3073: The command "clang "obj/Release/netcoreapp2.2/osx-x64/native/aws-lambda-lambdanative.o" -o "bin/Release/netcoreapp2.2/osx-x64/native/aws-lambda-lambdanative" /Users/chitpong/.nuget/packages/runtime.osx-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-27625-01/sdk/libbootstrapper.a /Users/chitpong/.nuget/packages/runtime.osx-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-27625-01/sdk/libRuntime.a /Users/chitpong/.nuget/packages/runtime.osx-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-27625-01/sdk/libSystem.Private.CoreLib.Native.a /Users/chitpong/.nuget/packages/runtime.osx-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-27625-01/sdk/libSystem.Private.TypeLoader.Native.a /Users/chitpong/.nuget/packages/runtime.osx-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-27625-01/framework/System.Native.a /Users/chitpong/.nuget/packages/runtime.osx-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-27625-01/framework/System.Globalization.Native.a /Users/chitpong/.nuget/packages/runtime.osx-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-27625-01/framework/System.IO.Compression.Native.a /Users/chitpong/.nuget/packages/runtime.osx-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-27625-01/framework/System.Net.Security.Native.a /Users/chitpong/.nuget/packages/runtime.osx-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-27625-01/framework/System.Security.Cryptography.Native.Apple.a -g -Wl,-rpath,'$ORIGIN' -lstdc++ -ldl -lm -lz -licucore -framework CoreFoundation -framework Security -framework GSS" exited with code 1. [/Users/chitpong/Sourcecode/aws-lambda-lambdanative-db/src/aws-lambda-lambdanative/aws-lambda-lambdanative.csproj]Metadata
Metadata
Assignees
Labels
No labels
Activity
MichalStrehovsky commentedon Apr 25, 2019
ImportPrincipalName got renamed to ImportTargetName in dotnet/corefx#35383.
What is the
TargetFrameworkin your CSPROJ? Can you try setting it tonetcoreapp3.0?jkotas commentedon Apr 25, 2019
This is bug in SqlClient packaging: https://github.com/dotnet/corefx/issues/37183
I do not think setting the target framework for
netcoreapp3.0is going to help. Try explicitly referencing newer preview version of SqlClient in your .csproj that was built from .NET Core 3.0 tree: https://www.nuget.org/packages/System.Data.SqlClient/4.7.0-preview4.19212.13[-]Build fails on macOS[/-][+]System.Data.SqlClient build fails on macOS[/+]ifew commentedon Apr 26, 2019
Hi, Well done!
I can compile when added latest version
<PackageReference Include="System.Data.SqlClient" Version="4.7.0-preview4.19212.13" />with<TargetFramework>netcoreapp2.2</TargetFramework>Thank You
@jkotas @MichalStrehovsky