-
-
Notifications
You must be signed in to change notification settings - Fork 963
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
Stride.GameStudio Startup - Error Restoring NuGet packages! #2426
Comments
I'm experiencing the same issue when running the source code for the first time, resulting in the same outcome. |
Most likely either you don't have the SDK for .NET 8 installed or the config of the SDK is somehow bad. Even though this isn't MAUI, this link suggests the x86 might be taking priority causing the issue:
This link has a solution to change the PATH priority: |
I also mentioned it here. Not sure if some recent commits didn't cause the issue? @Basewq, can you confirm that you can run the Game Studio from the code and have no errors? https://discord.com/channels/500285081265635328/727168636770582581/1279863992227070123 |
Oh I see, I've not been on the latest commit, I've been on 8dd9a99 which has been working. I will try a newer commit and see if it bugs out. |
Ok, tested on the latest commit, yes it's broken. |
Thanks for coming back so quickly on this 😀. Yes, there were some clean up updates and it seems the things are a bit tangled here and there so it needs to be reviewed again. |
Have you tried removing packages from the .nuget folder? |
Yes, but the problem seems to be in how it's 'packing' the EDIT: Also, yes this change also means needing to delete from |
Maybe, a related hint.. I am probably the first one who started having this or similar issue in the community toolkit a few months ago when I run Later I discovered that only on the first build, probably on the PC, I have to run After that, all is working ok, including additional new projects. I don't have to run anymore The issue is that I have to test if I need to build Game Studio similar way I described above. |
you had godot before? godot makes a fallback folder and changes nuget configs which can result in errors |
Ok, so as far as I can tell from the following link, nuget packages are supposed to output to
So this particular line fails:
because "net8.0-windows" is being passed as targetFramework , but it needs to be "net8.0-windows7.0" (the 'canonical TFM')
This is called by some auto-generated file, eg.
But no idea how this is generated! EDIT: File is generated via: stride/sources/shared/Stride.NuGetResolver.Targets/Stride.NuGetResolver.Targets.projitems Line 27 in ba36a7e
So the problem is $(TargetFramework) as-is is being used in place of STRIDE_NUGET_RESOLVER_TARGET_FRAMEWORK , whereas the canonical TFM is required, to get to the correct lib subfolder.
So the solution appears to either revert to explicitly declare platform version of the TFM, or fix it to determine the TFM + platform version instead of
|
Thank you very much for investigating this one, in effect my PATH config and SDK seems to be correct and I also tried to cleanup my system nuget packages and the ones created by stride while waiting. |
This is the exact line of code preventing the Application to run. I also noted that this is a referenced file from Stride.NuGetResolver and wondered why its duplicated like this? one has UI capability, would it not be better split instead of double referencing? I am very new to this... It is throwing an error even though the versions are matched in the AppData/Local/Stride/NuGetDev with the values checked from the solution file build/Stride.GameStudio.sln I must be missing something.... My Source is the latest commit? 4.2.0.1 All my initializers reference the same version as everywhere else in the code base |
You can ignore that my version says 9999, I modified that on my local version which doesn't affect this issue. For the time being, either work off from commit c7519cd (ie. before the changes with #2205), or revert commit c424213 on your local machine. |
Worked by taking the changes before #2205, thanks! |
I can confirm that I can launch the Game Studio with the most recent commit. Thank you @Basewq. Also, thanks @DomeAlessi for reporting it for us! |
Fantastic, working for me too :) |
Release Type: Official Release/GitHub (please choose appropriate option)
GitHub
Version: Version number and/or git branch
v4.2.0.2188
Platform(s): Does the problem occur on Windows, Android...?
Windows 11
Describe the bug
After successfully building Stride.GameStudio in various configs (Debug/ Release - MixedPlatforms/ AnyCPU) I get an error when starting the application. The error says "Error Restoring NuGet packages!". Any hint on how I can fix this?
To Reproduce
Steps to reproduce the behavior:
Screenshots
Log and callstacks
[Verbose] Running restore with 16 concurrent jobs.
[Verbose] Reading project file StrideNugetResolver.json.
[Verbose] The restore inputs for 'StrideNugetResolver' have changed. Continuing restore.
[Error] Platform version is not present for one or more target frameworks, even though they have specified a platform: net8.0-windows
[Information] CACHE https://api.nuget.org/v3/vulnerabilities/index.json
[Information] CACHE https://api.nuget.org/v3-vulnerabilities/2024.08.29.05.32.17/vulnerability.base.json
[Information] CACHE https://api.nuget.org/v3-vulnerabilities/2024.08.29.05.32.17/2024.09.03.17.32.37/vulnerability.update.json
[Verbose] All packages and projects are compatible with net8.0-windows.
[Verbose] All packages and projects are compatible with net8.0-windows (win-x64).
[Information] Writing assets file to disk. Path: C:\Users\MyUser\AppData\Local\Temp\StrideNugetResolver-Stride.GameStudio-4.2.0.1-net8.0-windows-win-x64\project.assets.json
[Verbose] Writing cache file to disk. Path: C:\Users\MyUser\AppData\Local\Temp\StrideNugetResolver-Stride.GameStudio-4.2.0.1-net8.0-windows-win-x64\project.nuget.cache
[Verbose] Persisting dg to C:\Users\MyUser\AppData\Local\Temp\StrideNugetResolver-Stride.GameStudio-4.2.0.1-net8.0-windows-win-x64\StrideNugetResolver.json.nuget.dgspec.json
[Error] Error restoring NuGet packages: System.InvalidOperationException: Could not restore NuGet packages
at Stride.Core.Assets.NuGetAssemblyResolver.<>c__DisplayClass5_0.b__0(Object sender, ResolveEventArgs eventArgs) in W:\source\repos\stride\stride\sources\shared\Stride.NuGetResolver\NuGetAssemblyResolver.cs:line 126
The text was updated successfully, but these errors were encountered: