Export broken after Visual Studio update to 17.3

After updating Visual Studio to >= 17.3 the export stops working in 2021.4

It fails with:

System.MissingMethodException: Method not found: 'System.ReadOnlySpan`1<Char> Microsoft.IO.Path.GetFileName(System.ReadOnlySpan`1<Char>)'.

As long as we don’t provide a proper fix for it, the workaround is as follows:

  1. Copy the attached config file to %UserProfile%\.nuget\packages\stride.core.assets.compilerapp\\lib\net472 - overwriting the existing one (it adds an assembly redirect)
  2. Export the patch (will fail with that MissingMethodException)
  3. Open exported sln with VS, set build configuration to Release and build (alternatively, open “Developer Command Prompt for VS 2022”, navigate to folder which contains .sln file, and type dotnet build -c Release)

It should now build the application successfully.

Stride.Core.Assets.CompilerApp.exe.config.zip (782 Bytes)

We just found a better solution to this issue. In the next release (2021.4.11) we will internally constraint the used MSBuild version to a maximum of 17.2. So even if one has VS 17.3 installed, as long as the Microsoft Build Tools 2019 can be found all should be good.

Note that if the above workaround had been applied already, one needs to un-apply it - simply delete the whole package folder and let the build system re-install it.