Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing RID for "Windows, Any CPU" configuration #18098

Closed
atauenis opened this issue Apr 27, 2020 — with docs.microsoft.com · 8 comments
Closed

Missing RID for "Windows, Any CPU" configuration #18098

atauenis opened this issue Apr 27, 2020 — with docs.microsoft.com · 8 comments
Labels
waiting-on-feedback Waiting for feedback from SMEs before they can be merged ⌚ Not Triaged Not triaged

Comments

Copy link

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.

@tdykstra
Copy link
Contributor

@sfoslund can you help with this question?

@tdykstra tdykstra added waiting-on-feedback Waiting for feedback from SMEs before they can be merged and removed ⌚ Not Triaged Not triaged labels Apr 27, 2020
@sfoslund
Copy link
Member

The -r flag is not required and by default dotnet publish produces a cross platform dll. See the first example in the publishing documentation.

@atauenis
Copy link
Author

atauenis commented 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-x64 builds can be runned on 32-bit systems?

@sfoslund
Copy link
Member

I see, since EXE files are executables and inherently not cross platform, I don't think there's a way to do this.

@atauenis
Copy link
Author

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
Copy link
Member

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).

@atauenis
Copy link
Author

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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-feedback Waiting for feedback from SMEs before they can be merged ⌚ Not Triaged Not triaged
Projects
None yet
Development

No branches or pull requests

5 participants