corert icon indicating copy to clipboard operation
corert copied to clipboard

HelloWorld Sample is broken.

Open BrainSlugs83 opened this issue 6 years ago • 2 comments

On a fresh machine, with .NET Core 2.1.401, following the hello world guide at: https://github.com/dotnet/corert/tree/master/samples/HelloWorld

It fails when executing the dotnet publish -r win-x64 -c release command, during the "Generating native code" step:

  Generating native code
libcpmt.lib(nothrow.obj) : fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64' [d:\Projects.temp\CoreRT-HelloWorld\CoreRT-HelloWorld.csproj]
C:\Users\Mikey\.nuget\packages\microsoft.dotnet.ilcompiler\1.0.0-alpha-26831-02\build\Microsoft.NETCore.Native.targets(247,5): error MSB3073: The command "link  @"obj\release\netcoreapp2.1\win-x64\native\link.rsp"" exited with code 1112. [d:\Projects.temp\CoreRT-HelloWorld\CoreRT-HelloWorld.csproj]

BrainSlugs83 avatar Aug 31 '18 18:08 BrainSlugs83

This is caused by running in x86 Native Tools Command Prompt. Try running in vanilla command prompt or x64 Native Tools Command Prompt.

We have this error mentioned in https://github.com/dotnet/corert/blob/master/Documentation/how-to-build-and-run-ilcompiler-in-console-shell-prompt.md#workarounds-for-build-errors-on-windows. Maybe we need to make it more discoverable.

jkotas avatar Aug 31 '18 18:08 jkotas

Maybe we need to make it more discoverable.

Yep I just hit the same problem. However thumbs up for opening this issue which let me solve the problem quickly : )

noahfalk avatar Aug 23 '20 01:08 noahfalk