Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

316
Visualizações
Single file application .NET Core 6.0 fails to generate bundles, if the file is too large

The idea is to have an application with a single file executable, despite the size, can be a very big file.

I'm using the "Single file deployment and executable" of .NET 6.0 with the following command:

publish {csproj.FullName} -c Release -r win-x64 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true --self-contained true -p:IncludeAllContentForSelfExtract=true -p:EnableCompressionInSingleFile=true

But when files are too big like greater then 4GB, I am not able to publish because of the following error:

C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(898,5): error MSB4018: System.ArgumentException: Stream length minus starting position is too large to hold a PEImage. (Parameter 'peStream') 
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(898,5): error MSB4018:    at System.Reflection.Internal.StreamExtensions.GetAndValidateSize(Stream stream, Int32 size, String streamParameterName) 
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(898,5): error MSB4018:    at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size) 

Any Idea how to fix it? Or another alternative to apply this idea.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

After some research there is a limitation on C# that doesn't allow for a single file to be more than 4gb.

So the alternative that I've chosen is to use self-extracting zips.

The one that I've chosen is 7Zip. Using their SDK I am able to zip my files into a single file, and then create a self-extracting zip that has the .exe for the file execution and it works as expected!

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda