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

634
Visualizações
"win-x86" or "win-x64" target runtime for Any CPU?

Many years I have built my apps under "Any CPU" configuration. But I have update to .Net 5, decide to use the Publish Function, which asking to implicitly choose between "win-x86" and "win-x64" options for target runtime.

I thought the whole deal with the "Any CPU" was to built apps not choosing between x86 and x64? 🤓 What should I do now?

Publish menu

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

0

When publishing the app, a target architecture needs to be specified, because the compiler will create an architecture specific stub loader for the project (in Windows, the "exe" file).

In .NET Core, all C# projects (irrespective of whether they're applications or libraries) compile to .dll files. These .dll files are platform independent, or AnyCPU (of course unless they contain code that would only run on certain operating systems, such as P/Invoke calls). The applications compiled this way can be run by using the dotnet <DllName> command.

Now this is not convenient, because people expect an "exe" file to start a program with. This exe file (or an equivalent "no-extension" file for unix) is created by the publish command, in addition to copying everything together. The exe file with the same name as the main .dll is the stub-loader that basically calls dotnet <myapp.dll>, even if publishing a framework-dependent application. That's why even a program that is targeting AnyCpu needs a platform-dependent publish step.

[Note: On Windows, the exe file might already be created in the build step, as VS uses it. But you'll notice that it always has about the same size, for all your apps.]

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