Will .net8 support 32 bit Application when built on "Any CPU" Configuration

Sreekanth N Kartha 20 Reputation points
2025-04-28T07:09:16.3733333+00:00

I am not able to run an application that is built on "Any CPU" configuration in 32 bit OS, but if i explicitly provide the architecture as x86 the application works properly. Will .net8 still support 32 bit application when built on "Any CPU" configuration.

Error I am receiving:

User's image

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,230 questions
{count} votes

1 answer

Sort by: Most helpful
  1. RLWA32 48,416 Reputation points
    2025-04-28T08:49:27.21+00:00

    In .Net 8 building for "Any CPU" does not have the same meaning as it did when using the .Net Framework.

    When VS2022 builds a .Net 8 application (.exe) it actually creates a dll which is loaded by a starter program provided by the framework. A 64-bit starter program is used by default when "Any CPU" is selected. Consequently, the .net 8 application won't run on a 32-bit system.

    There is a way to tell VS2022 to provide a 32-bit starter program for an "Any CPU" .net 8 application by using the NETCoreSdkRuntimeIdentifier MSBuild property. Unlike the behavior under the .Net Framework such an "Any CPU" application will run as a 32-bit process on 64-bit windows.

    I don't see a tangible benefit to using "Any CPU" if you intend to support 32-bit versions of windows since in .Net 8 the starter programs are not platform agnostic.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.