-
Notifications
You must be signed in to change notification settings - Fork 216
Description
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]