Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

312
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda