Skip to content

NativeLibrary sample issue #589

@KU348-code

Description

@KU348-code

I downloaded the NativeLibrary sample project from Github and tried publishing it without any modifications but failed. The command used and the error (NETSDK1102) resulting from it are as follows. Visual studio pro version 16.8.4 and Microsoft.DotNet.ILCompiler version 6.0.0-preview.1.21075.1 was used for publishing. Please advice.

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts>dotnet publish /p:NativeLib=Shared -r win-x64 -c release "C:\NativeLibrary\NativeLibrary.csproj"
Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

Determining projects to restore...
Restored C:\NativeLibrary\NativeLibrary.csproj (in 2.15 sec).
NativeLibrary -> C:\NativeLibrary\bin\release\net5.0\win-x64\NativeLibrary.dll
C:\Program Files\dotnet\sdk\5.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ILLink.targets(143,5): error NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. [C:\NativeLibrary\NativeLibrary.csproj]

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-NativeAOT-coreclr.NET runtime optimized for ahead of time compilation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions