Watch
2
0
Fork
You've already forked raylib-cs
0

fix: let the binding build for browser-wasm on both net8.0 and net10.0

The net8-era wasm workload (Microsoft.NET.Runtime.WebAssembly.Sdk 8.0.x,
auto-imported for RID browser-wasm) treats every browser-wasm project as
a wasm app: it forces OutputType=Exe after project evaluation (CS5001
for a classlib) and hooks its app-bundle build after Build, which errors
because a library has no assemblies to bundle. Opt Raylib-cs out via
DisableAutoWasmBuildApp (props time, before the workload defaults its
trigger) and pin OutputType back to Library in Directory.Build.targets
(evaluated after the workload props, so the assignment wins). net10's
wasm SDK needs neither workaround.
This commit is contained in:
tiger tiger tiger 2026-07-06 15:41:36 +02:00
commit 3c08139d91
2 changed files with 17 additions and 0 deletions

View file

@ -1,4 +1,13 @@
<Project>
<!-- The net8-era wasm workload (Microsoft.NET.Runtime.WebAssembly.Sdk 8.0.x, imported for
RID browser-wasm) unconditionally sets OutputType=Exe after project evaluation, which
breaks the net8.0 classlib build with CS5001. Pin it back to Library here: this file is
imported after the workload props, so the assignment wins. (net10's wasm SDK leaves
OutputType alone; Examples stays an Exe and is excluded.) -->
<PropertyGroup Condition="'$(MSBuildProjectName)' == 'Raylib-cs' And '$(RuntimeIdentifier)' == 'browser-wasm'">
<OutputType>Library</OutputType>
</PropertyGroup>
<!-- Raylib-cs 8.1.0 is not on nuget.org yet; pack locally so Examples and tests resolve the package with native runtimes. -->
<Target Name="_EnsureLocalRaylibCsPackage"
BeforeTargets="Restore"