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

can't dotnet run x86 at x64 on net8 #88283

Closed
NCLnclNCL opened this issue Jul 1, 2023 · 6 comments
Closed

can't dotnet run x86 at x64 on net8 #88283

NCLnclNCL opened this issue Jul 1, 2023 · 6 comments
Labels
area-Host needs-author-action An issue or pull request that requires more info or actions from the author.

Comments

@NCLnclNCL
Copy link

NCLnclNCL commented Jul 1, 2023

Description

I use dotnet run -a x86
however it returns error, if i use dotnet build -a x86 it can build successfully
if i target to net7 or net6, it tool cannot run with same errors

Reproduction Steps

dotnet run -a x86 and target net 8 preview5

Expected behavior

run successfully

Actual behavior

return errors Failed to load the dll from [D:\dotnet-sdk-8.0.100-preview.5.23303.2-win-x64\host\fxr\8.0.0-preview.5.23280.8\hostfxr.dll], HRESULT: 0x800700C1
The library hostfxr.dll was found, but loading it from D:\dotnet-sdk-8.0.100-preview.5.23303.2-win-x64\host\fxr\8.0.0-preview.5.23280.8\hostfxr.dll failed

Regression?

No response

Known Workarounds

No response

Configuration

net8 preview5
window 10 2009
x64

Other information

No response

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 1, 2023
@ghost
Copy link

ghost commented Jul 1, 2023

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

I use dotnet run -a x86
however it returns error, if i use dotnet build -a x86 it can build successfully

Reproduction Steps

dotnet run -a x86 in target net 8 preview5

Expected behavior

run successfully

Actual behavior

return errors Failed to load the dll from [D:\dotnet-sdk-8.0.100-preview.5.23303.2-win-x64\host\fxr\8.0.0-preview.5.23280.8\hostfxr.dll], HRESULT: 0x800700C1
The library hostfxr.dll was found, but loading it from D:\dotnet-sdk-8.0.100-preview.5.23303.2-win-x64\host\fxr\8.0.0-preview.5.23280.8\hostfxr.dll failed

Regression?

No response

Known Workarounds

No response

Configuration

net8 preview5
window 10 2009
x64

Other information

No response

Author: NCLnclNCL
Assignees: -
Labels:

area-Host

Milestone: -

@hez2010
Copy link
Contributor

hez2010 commented Jul 1, 2023

It seems that you are trying to run your program with x86 architecture while you only have x64 dotnet runtime installed.

@elinor-fung
Copy link
Member

@NCLnclNCL as @hez2010 pointed out, you'll need the x86 version of .NET installed. Can you install the x86 version of .NET and try again?

We do have an open issue around trying to detect the architecture mismatch case for better error messaging:

@elinor-fung elinor-fung added the needs-author-action An issue or pull request that requires more info or actions from the author. label Jul 3, 2023
@ghost
Copy link

ghost commented Jul 3, 2023

This issue has been marked needs-author-action and may be missing some important information.

@vitek-karas
Copy link
Member

In this case it seems to be exaggerated by the fact that the SDK is running from a private install, so there's very likely DOTNET_ROOT set to point to the x64 install. To make this work in a private install, you would need to install x86 runtime into another location and set DOTNET_ROOT_X86 to point to that location. Then dotnet run -a x86 should work even when running it from the x64 SDK.

Note that if you were using globally installed SDK/Runtime there's no need to set any env. variable as the location of the runtime for each architecture is written in registry and the app will find it from there. That's probably why it works just fine for .NET 6/7 as you're likely using the global install in that case.

@agocke
Copy link
Member

agocke commented Jul 10, 2023

Closed as dup of #3745

@agocke agocke closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jul 10, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Host needs-author-action An issue or pull request that requires more info or actions from the author.
Projects
None yet
Development

No branches or pull requests

5 participants