stride3d / stride

Stride Game Engine (formerly Xenko)
https://stride3d.net
MIT License
6.49k stars 941 forks source link

can't find MSBuild #2336

Closed Sunflair0 closed 3 months ago

Sunflair0 commented 3 months ago

I have downloaded MSBuild from Visual Studio. I asked ChatGPT to help me, and it suggested:

Select Workloads:

In the installer, select the workloads you need. For MSBuild, you can choose: .NET desktop development ASP.NET and web development Desktop development with C++

In following the path that MSBuild should be on. I see I have Program Files and Program Files (x86) and Program Files and Program Files. Which path is where the build should be?

Platform(s): Does the problem occur on Windows, Android...? Windows

Describe the bug Pushing the start 4.2.0.2149 button makes this message come up. Cannot advance past it.

Error message: Stride Game Studio 4.2.0.2149 (.NET 8.0.6)

Could not find a compatible version of MSBuild. Check that you have a valid installation with the required workloads, or go to www.visualstudio.com/downloads to install a new one. Also make sure you have the latest .NET 6 SDK System.InvalidOperationException: Failed to find all versions of .NET Core MSBuild. Call to hostfxrresolvesdk2. There may be more details in stderr. at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetSdkFromGlobalSettings(String workingDirectory) at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetDotNetBasePaths(String workingDirectory)+MoveNext() at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetInstances(String workingDirectory)+MoveNext() at Microsoft.Build.Locator.MSBuildLocator.GetInstances(VisualStudioInstanceQueryOptions options)+MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable1 source, Func2 predicate, Boolean& found) at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func`2 predicate) at Stride.Core.Assets.PackageSessionPublicHelper.FindAndSetMSBuildVersion() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSessionPublicHelper.cs:line 40 at Stride.GameStudio.Program.Startup(UFile initialSessionPath) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\editor\Stride.GameStudio\Program.cs:line 221

Sunflair0 commented 3 months ago

or both?

MeharDT commented 3 months ago

The "ASP.NET and web development" workload is not needed for Stride and MSBuild isn't either for Stride 4.1+.

Have you downloaded the latest .NET 8.0 SDK?

https://dotnet.microsoft.com/en-us/download/dotnet/8.0

VaclavElias commented 3 months ago

Not sure if this helps. ..

I have MSBuild in this location. It wasn't added to PATH be default. I usually refer just the whole path..

image

Sunflair0 commented 3 months ago

You caught me in the middle of ripping out MSBuild and reinstalling it. I will download 8 again. The 64 version. I think earlier I may have done the 84, but not sure. To answer, yes, I have done it, but now I am 'repairing' the download.

Sunflair0 commented 3 months ago

The reason I am re-doing the MSBuild is because I don't see the .exe file in my list. Just about everything else is.

Sunflair0 commented 3 months ago

If I don't need MSBuild for 4.2, then why the error message?

I finished .net 8.0 and it gives me the same error.

MeharDT commented 3 months ago

If I don't need MSBuild for 4.2, then why the error message?

I finished .net 8.0 and it gives me the same error.

Can you restart your PC after the installation and try opening Stride again?

The error message is out of date and will likely be changed in a future update to reflect the new requirements.

Sunflair0 commented 3 months ago

no change. I did a restart, and still the same. What else could it mean? I have been at this for weeks and about to give up.

IXLLEGACYIXL commented 3 months ago

what happens when you run in powershell dotnet --list-sdks

VaclavElias commented 3 months ago

I was just about to ask the same if we could have an output of that :)

Sunflair0 commented 3 months ago

stride6 18 24

Sunflair0 commented 3 months ago

Must I run this after I change my directory? To what should I change it?

IXLLEGACYIXL commented 3 months ago

it runs dotnet command and lists all installed sdks

you dont have an installed sdk

you probably installed the runtime https://dotnet.microsoft.com/en-us/download grafik thats what you want, the link previously sent gives all options which are available and you probably just clicked on runtime and not the sdk for windows

IXLLEGACYIXL commented 3 months ago

after you installed that, restart your pc

Sunflair0 commented 3 months ago

stride6a 18 24

I have not done it again, but I will try it if you think something will be different. (green is what I just downloaded, but not installed and restarted computer again)

IXLLEGACYIXL commented 3 months ago

does the command now list it? grafik should output something like this

Sunflair0 commented 3 months ago

nada. I even changed the directory to match yours (\users)

IXLLEGACYIXL commented 3 months ago

does this path contain the sdk , run that ls 'C:\Program Files\dotnet\sdk'

IXLLEGACYIXL commented 3 months ago

can you check this too https://github.com/dotnet/sdk/issues/22508#issuecomment-963494604

Sunflair0 commented 3 months ago

stride6b 18 24

Is this what you are asking?

IXLLEGACYIXL commented 3 months ago

yes what is in that folder? does it contain the net8 sdk?

Sunflair0 commented 3 months ago

stride6c 18 24

Sunflair0 commented 3 months ago

yes, the link you shared, I have both files. The ones highlighted in green

IXLLEGACYIXL commented 3 months ago

you mean environment variables? can you share your path environment variables

Sunflair0 commented 3 months ago

Yes. I don't know how to get to it, though

IXLLEGACYIXL commented 3 months ago

windows button => type environment => should give you program for setting environment variables and a window like that grafik

at bottom is a blue button for environment variables grafik

it should be like that if you double click on path at the systemvariables tab and it should have only one dotnet path and not a x86 one

Sunflair0 commented 3 months ago

ok, I will do that. Ich mag Deutsch :)

IXLLEGACYIXL commented 3 months ago

grafik

IXLLEGACYIXL commented 3 months ago

screenshot would be best as always

Sunflair0 commented 3 months ago

It's giving me a stupid BING search for it.

I will figure it out...

IXLLEGACYIXL commented 3 months ago

grafik systemsteuerung => top right umgebung => umgebungsvariablen bearbeiten => opens a similiar window for whatever reason

Sunflair0 commented 3 months ago

stride6d 18 24

That was fun.

Sunflair0 commented 3 months ago

stride6e 18 24

Is this more of what you want?

IXLLEGACYIXL commented 3 months ago

stride6e 18 24

Is this more of what you want?

you double clicked on the top path, you need to double click on path in the bottom panel

Sunflair0 commented 3 months ago

The one that starts out with Python?

IXLLEGACYIXL commented 3 months ago

yes, system variables, not user variables

Sunflair0 commented 3 months ago

stride6f 18 24

It doesn't do anything when I double click on it. I even used the tabs to select the bottom option, it turns the choice blue, but no buttons light up.

Sunflair0 commented 3 months ago

Not sure why it starts out with Python. It was a class I took for 2 weeks and the teacher quit so never finished. I don't code in Python. I have PyCharm on my computer.

IXLLEGACYIXL commented 3 months ago

grafik here double click on Value of path

it has to open a second window with all values separated

that one grafik

it wont open if you didnt close the other window from before when you opened user path variable

Sunflair0 commented 3 months ago

stride6g 18 24

I promise you all other windows are closed. I have closed the window several times on accident, and this visual is the first of me opening the window again.

IXLLEGACYIXL commented 3 months ago

uhhhhhhhhhhhhhh thats new 🤣 that is maybe also the reason why the install doesnt work...

do you have stride still open or VS ? something that may lock that thing?

maybe make a restart and go straight to that? there seems something horrible wrong there are you the admin of that pc? if not ... why arent you

if dotnet cant set the system variable then ye.. it aint gonna find anything

Sunflair0 commented 3 months ago

I will restart and go straight to the window. Wish me more than luck

Sunflair0 commented 3 months ago

Same.

Is there a way to browse to it or something other than this window? Yes, I am the admin. It's my 3 year old laptop.

IXLLEGACYIXL commented 3 months ago

Same.

Is there a way to browse to it or something other than this window? Yes, I am the admin. It's my 3 year old laptop.

it may be that your windows user doesnt have sufficient rights... is that a teachers laptop? is your current user an admin?

Sunflair0 commented 3 months ago

no, it's mine. I abuse it daily.

IXLLEGACYIXL commented 3 months ago

run in powershell $env:PATH -split ';'

( its very weird that you cant edit the system variables as admin )

there is also an official windows discord to help with windows problems and i dont know how to resolve that issue

https://superuser.com/questions/1467734/i-am-admin-but-i-cannot-edit-system-variables-windows-10 maybe that one? i dont have windows home

Sunflair0 commented 3 months ago

I agree. Is there some way I can verify I am in admin mode? I don't think that is the default.

powershellA powershellB

MeharDT commented 3 months ago

stride6g 18 24

I promise you all other windows are closed. I have closed the window several times on accident, and this visual is the first of me opening the window again.

Can you try the steps here and see if it gives you Edit access?

https://superuser.com/a/1467834

IXLLEGACYIXL commented 3 months ago

y0,ou have exactly t0ha issue https://github.com/dotnet/sdk/issues/22508#issuecomment-963494604 the x86 dotnet comes first and AFTER that normal dotnet comes => x32 dotnet gets called and for that you have 0 sdks

you have for x64 which is in C:\Program Files\dotnet\ but its below x86 path

now the mystery why you cant edit the environment variables...

Sunflair0 commented 3 months ago

Ok, so I did the SYSTEM variable thing, and I have access now.