相关疑难解决方法(0)

.NET 5 not compiling to single file executables

Haiya! I'm having an issue regarding trying to compile my .NET 5 application to a single file executable while debugging through Visual Studio.

My CSProject is bellow.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net50</TargetFramework>
    <AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <PublishSingleFile>true</PublishSingleFile>
    <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
    <PlatformTarget>x64</PlatformTarget>
  </PropertyGroup>

</Project>
Run Code Online (Sandbox Code Playgroud)

I have my runtime identifier set to winx64 and publish single file set to true, yet when building I'm left with a bunch of DLLs that my application uses building along-side it (a total of 272 in total). I was wondering …

roslyn .net-core .net-core-publishsinglefile asp.net-core-5.0

14
推荐指数
1
解决办法
8918
查看次数