stride3d / stride-community-toolkit

Collection of helpers and extensions for Stride Game Engine developers. Simplifies and demonstrates common developer tasks building experiences for Stride with .NET.
https://stride3d.github.io/stride-community-toolkit/index.html
MIT License
76 stars 21 forks source link

Code-only sample code doesn't build #133

Closed CocoDico78 closed 3 months ago

CocoDico78 commented 4 months ago

Trying to follow instructions on https://stride3d.github.io/stride-community-toolkit/manual/code-only/create-project.html

Error from the Build log

MSB3073 The command ""C:\Users\xxx.nuget\packages\stride.core.assets.compilerapp\4.2.0.2122\buildTransitive..\lib\net8.0\Stride.Core.Assets.CompilerApp.exe" --disable-auto-compile --project-configuration "Debug" --platform=Windows --project-configuration=Debug --compile-property:StrideGraphicsApi=Direct3D11 --output-path="D:\repos\xxx\src\Console\bin\Debug\net8.0\data" --build-path="D:\repos\xxx\src\Console\obj\stride\assetbuild\data" --package-file="D:\repos\xxx\src\Console\Console.csproj" --msbuild-uptodatecheck-filebase="D:\repos\xxx\src\Console\obj\Debug\net8.0\stride\assetcompiler-uptodatecheck"" exited with code 1.

at

C:\Users\xxx.nuget\packages\stride.core.assets.compilerapp\4.2.0.2122\buildTransitive\Stride.Core.Assets.CompilerApp.targets line 153

After running the failing underlying command in CLI, I get this error:

Error restoring NuGet packages! Could not load file or assembly 'System.Security.Cryptography.Pkcs, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

Repro:

VaclavElias commented 4 months ago

Let me check this..

VaclavElias commented 4 months ago

I am going to do a few more tests, but it seems to be working for me on my VM. I am going to try a clean VM.

Could you try to delete your obj and bin folder, and build the project again?

CocoDico78 commented 4 months ago

Still same error. For repro, I've set up a tiny repo with exactly the steps from the doc (I've added a global.json to ensure same version of SDK and disable preview SDK).

https://github.com/CocoDico78/StrideCodeOnlyBuildIssue

VaclavElias commented 4 months ago

I was able to replicate this issue on clean VM. There seems to be some hidden and deep depenceny on this package 'System.Security.Cryptography.Pkcs, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Weirdly, it works on my dev computer because of some unknown references. I will raise a ticket in Stride repo and will work on this to figure out where the reference is and update it.

VaclavElias commented 4 months ago

I have some way around, till this is resolved.

Please follow these steps, which install/change references to the missing package:

  1. Install Stride Installer (https://www.stride3d.net/download/)
  2. Install the latest version of Stride from the installer
  3. Click Start - This will trigger installing some other NuGet packages
  4. You can close the Project selection Window
  5. Delete obj/bin in your code only project
  6. Build and run your code only project

References: https://github.com/stride3d/stride/issues/2232

CocoDico78 commented 4 months ago

I confirm it's now working, thanks 👍

VaclavElias commented 4 months ago

Thank you for confirmation. You can leave this issue with me and I will close it once I have a proper solution :)

VaclavElias commented 4 months ago

The issue addressed in the description was resolved. I have to update all code-only examples, so they are using Stride.CommunityToolkit.Windows instead of Stride.CommunityToolkit.

VaclavElias commented 3 months ago

The docs were just released and examples updated. The main example updated https://stride3d.github.io/stride-community-toolkit/manual/code-only/create-project.html

I am closing this as resolved.