You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing RID for "Windows, Any CPU" configuration #18098
Visual Studio can build .NET Core apps for "Any CPU" platform (combo 32/64-bit). How to build/publish an app like Visual Studio does but using dotnet publish -r tool? Which RID I need to use?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: 009616d0-6c93-a2de-82fe-4f7168817f18
Version Independent ID: 4c2c5549-0151-516d-91d0-9b017c74e787
No, I'm interested in a EXE file that launches the DLL. E.g. like from dotnet publish -r win-x86, but with "win-AnyCPU" platform (if it is available in Core 3.1 like was in Framework 4.x).
Or win-x64 builds can be runned on 32-bit systems?
Visual C# 2005+ can make semi cross-platform binaries. Executables for "Any CPU" platform are running in 32-bit mode on 32-bit OS and in native 64-bit mode in 64-bit OS.
In the stack overflow post you linked, this is the most liked answer:
An AnyCPU assembly will JIT to 64-bit code when loaded into a 64-bit process and 32 bit when loaded into a 32-bit process.
I believe the AnyCPU assembly it's referring to are DLLs, which are taken and JIT (just in time) compiled to native code (64 bit on 64 bit OSs and 32 bit on 32).
Seems that .NET Core have very bad support for AnyCPU EXEs. Sad... Clients of my app reported that 32-bit EXE don't run with 64-bit Runtime, so they're need to install both architectures of Runtime to use all .NET Core apps on their machines. Older versions of my app, built via Visual Studio (not CLI) in AnyCPU mode, are working correctly in all x86 and x64 systems with a single Runtime been installed.
Activity
tdykstra commentedon Apr 27, 2020
@sfoslund can you help with this question?
sfoslund commentedon Apr 27, 2020
The
-rflag is not required and by defaultdotnet publishproduces a cross platform dll. See the first example in the publishing documentation.atauenis commentedon Apr 27, 2020
No, I'm interested in a EXE file that launches the DLL. E.g. like from
dotnet publish -r win-x86, but with "win-AnyCPU" platform (if it is available in Core 3.1 like was in Framework 4.x).Or
win-x64builds can be runned on 32-bit systems?sfoslund commentedon Apr 27, 2020
I see, since EXE files are executables and inherently not cross platform, I don't think there's a way to do this.
atauenis commentedon Apr 28, 2020
https://stackoverflow.com/questions/516730/what-does-the-visual-studio-any-cpu-target-mean
Visual C# 2005+ can make semi cross-platform binaries. Executables for "Any CPU" platform are running in 32-bit mode on 32-bit OS and in native 64-bit mode in 64-bit OS.
sfoslund commentedon Apr 28, 2020
In the stack overflow post you linked, this is the most liked answer:
I believe the AnyCPU assembly it's referring to are DLLs, which are taken and JIT (just in time) compiled to native code (64 bit on 64 bit OSs and 32 bit on 32).
atauenis commentedon May 12, 2020
https://stackoverflow.com/questions/61711209/how-to-compile-a-net-core-project-to-any-cpu-architecture
dotnet/sdk#1906 (comment)
Seems that .NET Core have very bad support for AnyCPU EXEs. Sad... Clients of my app reported that 32-bit EXE don't run with 64-bit Runtime, so they're need to install both architectures of Runtime to use all .NET Core apps on their machines. Older versions of my app, built via Visual Studio (not CLI) in AnyCPU mode, are working correctly in all x86 and x64 systems with a single Runtime been installed.
tdykstra commentedon May 12, 2020
Per the dotnet/sdk#1906 (comment) issue, it doesn't appear that there is anything missing in the RID catalog doc, so I'm closing this issue.