C
C#5mo ago
TheBasedTaka

✅ warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'

No description
90 Replies
TheBasedTaka
TheBasedTakaOP5mo ago
i don't have any linker option trying to run dotnet publush
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishAot>true</PublishAot>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<Using Include="System.Console" Static="true" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishAot>true</PublishAot>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<Using Include="System.Console" Static="true" />
</ItemGroup>
</Project>
mtreit
mtreit5mo ago
Does it build if you explicitly set the Platform to x64? Or is something in one of the csproj files explicitly targeting x86?
TheBasedTaka
TheBasedTakaOP5mo ago
@mtreit 64 doesn't change anything. i tried that before and all of my files have
html
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PublishAot>true</PublishAot>
<InvariantGlobalization>true</InvariantGlobalization>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
</Project>
html
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PublishAot>true</PublishAot>
<InvariantGlobalization>true</InvariantGlobalization>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
</Project>
the platforms tag in it
mtreit
mtreit5mo ago
I don't suppose you can share the entire solution (on github for example)? Because from what you've said you shouldn't be getting those errors.
TheBasedTaka
TheBasedTakaOP5mo ago
https://github.com/thebasedtaka/testpls let me know if you can see that
mtreit
mtreit5mo ago
No, I don't have access.
TheBasedTaka
TheBasedTakaOP5mo ago
ok its public
mtreit
mtreit5mo ago
Hmm, still 404
TheBasedTaka
TheBasedTakaOP5mo ago
i jumped the gun the mobile auth isn't getting triggered lol ok its public now
mtreit
mtreit5mo ago
What exact command are you running and from which folder?
No description
TheBasedTaka
TheBasedTakaOP5mo ago
dotnet publish in the aot folder
mtreit
mtreit5mo ago
No description
TheBasedTaka
TheBasedTakaOP5mo ago
:harold:
TheBasedTaka
TheBasedTakaOP5mo ago
this is what i get
TheBasedTaka
TheBasedTakaOP5mo ago
do you think its a config error somewhere?
mtreit
mtreit5mo ago
What .NET SDK do you have installed? Looks like you might be missing some native build tools. dotnet --list-sdks
TheBasedTaka
TheBasedTakaOP5mo ago
PS C:\Users\Taka\source\repos\Chapter07\Aot> dotnet --list-sdks
7.0.201 [c:\program files\dotnet\sdk]
8.0.300 [c:\program files\dotnet\sdk]
PS C:\Users\Taka\source\repos\Chapter07\Aot> dotnet --list-sdks
7.0.201 [c:\program files\dotnet\sdk]
8.0.300 [c:\program files\dotnet\sdk]
mtreit
mtreit5mo ago
Are you running from a developer command prompt? Although actually it builds fine for me even if I don't.
TheBasedTaka
TheBasedTakaOP5mo ago
im running it in powershell inside of vscode
mtreit
mtreit5mo ago
What is the output of where.exe link.exe ?
mtreit
mtreit5mo ago
You didn't pass it link.exe as an argument:
where.exe link.exe
where.exe link.exe
Run that as one line
TheBasedTaka
TheBasedTakaOP5mo ago
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\Hostx86\x86\link.exe
mtreit
mtreit5mo ago
x86
TheBasedTaka
TheBasedTakaOP5mo ago
C:\Users\Taka\source\repos\Chapter07\Aot>dotnet publish
Determining projects to restore...
All projects are up-to-date for restore.
Aot -> C:\Users\Taka\source\repos\Chapter07\artifacts\bin\Aot\release\Aot.dll
Aot -> C:\Users\Taka\source\repos\Chapter07\artifacts\publish\Aot\release\

C:\Users\Taka\source\repos\Chapter07\Aot>
C:\Users\Taka\source\repos\Chapter07\Aot>dotnet publish
Determining projects to restore...
All projects are up-to-date for restore.
Aot -> C:\Users\Taka\source\repos\Chapter07\artifacts\bin\Aot\release\Aot.dll
Aot -> C:\Users\Taka\source\repos\Chapter07\artifacts\publish\Aot\release\

C:\Users\Taka\source\repos\Chapter07\Aot>
idk why comand prompt worked
mtreit
mtreit5mo ago
Does where.exe link.exe print something different in command prompt? Best guess if you have some environment variables set differently between the two CLI environments.
TheBasedTaka
TheBasedTakaOP5mo ago
C:\Users\Taka\source\repos\Chapter07\Aot>where.exe link.exe INFO: Could not find files for the given pattern(s). ```
mtreit
mtreit5mo ago
Huh I would probably dump the environment variables in each environment to text files and then diff them to see what's different.
TheBasedTaka
TheBasedTakaOP5mo ago
is this the wrong path?
No description
mtreit
mtreit5mo ago
Not sure but VSCode might be setting something different? I would check the environment variables on the CLI. You can run dir:env in pwsh or set in cmd.exe
Angius
Angius5mo ago
I remember running into an issue of VSC using different env vars than Pwsh So entirely possible that one uses System variables and the other uses User, for example
TheBasedTaka
TheBasedTakaOP5mo ago
idk if i can diff these i think they have too different outputs did you remember how to sync them?
Angius
Angius5mo ago
Can't say I remember what I did... I think I just edited the variables manually
mtreit
mtreit5mo ago
User and System environment variables get merged together, it should usually be deterministic. Something else might be overriding them though.
Angius
Angius5mo ago
Here's the start of my convo with @TeBeCo, maybe it'll help: https://discord.com/channels/143867839282020352/143867839282020352/1246544814166511627
MODiX
MODiX5mo ago
Angius
Great, VS Code's terminal is borked
Quoted by
<@85903769203642368> from #chat (click here)
From Angius
React with ❌ to remove this embed.
Angius
Angius5mo ago
Or TeBe will pop in here and help
TheBasedTaka
TheBasedTakaOP5mo ago
its been too long, did i set up my environment variables or did the .net installer do it
mtreit
mtreit5mo ago
The VSCode powershell looks like it's a developer prompt Which sets a ton of environment variables.
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
mtreit
mtreit5mo ago
@TheBasedTaka do you have one of these on your start menu?
No description
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
mtreit
mtreit5mo ago
If so, if you open that and try to build does it work?
TheBasedTaka
TheBasedTakaOP5mo ago
lol the hell
No description
TheBasedTaka
TheBasedTakaOP5mo ago
should i just restart my computer or something lmfao
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
mtreit
mtreit5mo ago
The max length should be 32K
Angius
Angius5mo ago
tl;dr: this was my issue, VSC was using different vars
No description
TheBasedTaka
TheBasedTakaOP5mo ago
been doing too much javascript oops
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
TheBasedTaka
TheBasedTakaOP5mo ago
mine?
mtreit
mtreit5mo ago
More reason to never use the cursed built-in terminal in VSCode and just use the terminal outside of it like a sane person.
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
TheBasedTaka
TheBasedTakaOP5mo ago
using vs2022 btw
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
mtreit
mtreit5mo ago
1,897 characters is nothing for a PATH environment variable.
Angius
Angius5mo ago
Path can be arbitrarily long Just the editor in Windows settings cannot handle more than, like, 2k chars
mtreit
mtreit5mo ago
My path is over 5,000 chracters.
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
mtreit
mtreit5mo ago
It's not irrelevant.
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
mtreit
mtreit5mo ago
Windows supports up to 32K characters. If your'e using tools that don't support even a fraction of that, use better tools.
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
mtreit
mtreit5mo ago
Right, so use a terminal outside of the editor and you're good to go.
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
mtreit
mtreit5mo ago
If they want to shoot themselves in the foot that's fine I guess.
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
TheBasedTaka
TheBasedTakaOP5mo ago
these aren't too long no?
No description
mtreit
mtreit5mo ago
System and User path get combined together
dir env:path | %{$_.Value.Length}
dir env:path | %{$_.Value.Length}
That will give you the real length
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
TheBasedTaka
TheBasedTakaOP5mo ago
so you're saying to %razer%/whatever
No description
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
TheBasedTaka
TheBasedTakaOP5mo ago
put %USERPROFILE%.dotnet\tools into system env and it works btw
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
TheBasedTaka
TheBasedTakaOP5mo ago
oh
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
TheBasedTaka
TheBasedTakaOP5mo ago
:harold:
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
TheBasedTaka
TheBasedTakaOP5mo ago
oh i get what you mean think i should just re install that then or should i just change the env idk why i would even click the 86 checkbox
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
TheBasedTaka
TheBasedTakaOP5mo ago
weird i don't think i did any of that manually
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
TheBasedTaka
TheBasedTakaOP5mo ago
i think that one was probably me somehow i changed that
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Angius
Angius5mo ago
In my defense: timezones
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
mtreit
mtreit5mo ago
:this_is_fine:
MODiX
MODiX5mo ago
If you have no further questions, please use /close to mark the forum thread as answered
Want results from more Discord servers?
Add your server