Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

System.Data.SqlClient build fails on macOS #7353

Closed

Description

@ifew

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]

Activity

  1. MichalStrehovsky commented on Apr 25, 2019

    @MichalStrehovsky
    Member

    ImportPrincipalName got renamed to ImportTargetName in dotnet/corefx#35383.

    What is the TargetFramework in your CSPROJ? Can you try setting it to netcoreapp3.0?

  2. jkotas commented on Apr 25, 2019

    @jkotas
    Member

    This is bug in SqlClient packaging: https://github.com/dotnet/corefx/issues/37183

    I do not think setting the target framework for netcoreapp3.0 is 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

  3. changed the title [-]Build fails on macOS[/-] [+]System.Data.SqlClient build fails on macOS[/+] on Apr 25, 2019
  4. ifew commented on Apr 26, 2019

    @ifew
    ContributorAuthor

    This is bug in SqlClient packaging: dotnet/corefx#37183

    I do not think setting the target framework for netcoreapp3.0 is 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

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions