{"record":{"id":"74b4700654b49a8f","repo":"clockworklabs/SpacetimeDB","slug":"looks-like-your-project-is-using-the-deprecated-n","errorCode":null,"errorMessage":"Looks like your project is using the deprecated .NET 7.0 WebAssembly bindings.\nPlease migrate your project to the new .NET 8.0 template and delete the folders: bin, bin~, obj, obj~","messagePattern":"Looks like your project is using the deprecated \\.NET 7\\.0 WebAssembly bindings\\.\nPlease migrate your project to the new \\.NET 8\\.0 template and delete the folders: bin, bin~, obj, obj~","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/tasks/csharp.rs","lineNumber":433,"sourceCode":"        target_framework.into(),\n        \"-v\".into(),\n        \"quiet\".into(),\n    ]);\n    if matches!(build_path, CsharpBuildPath::Net8Aot | CsharpBuildPath::Net8Jit) {\n        publish_args.push(\"--no-restore\".into());\n        publish_args.push(\"--force\".into());\n        publish_args.push(format!(\"-p:{target_frameworks_override}\").into());\n    }\n    duct::cmd(\"dotnet\", publish_args).dir(project_path).run()?;\n\n    // check for the old .NET 7 path for projects that haven't migrated yet\n    let bad_output_paths = [\n        project_path.join(format!(\"bin/{config_name}/net7.0/StdbModule.wasm\")),\n        // for some reason there is sometimes a tilde here?\n        project_path.join(format!(\"bin~/{config_name}/net7.0/StdbModule.wasm\")),\n    ];\n    if bad_output_paths.iter().any(|p| p.exists()) {\n        anyhow::bail!(concat!(\n            \"Looks like your project is using the deprecated .NET 7.0 WebAssembly bindings.\\n\",\n            \"Please migrate your project to the new .NET 8.0 template and delete the folders: bin, bin~, obj, obj~\"\n        ));\n    }\n    let possible_output_paths = [\n        // Standard publish output paths (JIT and some AOT builds)\n        project_path.join(format!(\n            \"bin/{config_name}/{target_framework}/wasi-wasm/{subdir}/StdbModule.wasm\"\n        )),\n        project_path.join(format!(\n            \"bin~/{config_name}/{target_framework}/wasi-wasm/{subdir}/StdbModule.wasm\"\n        )),\n        // NativeAOT-LLVM outputs to 'native' subdirectory instead of 'publish'\n        project_path.join(format!(\n            \"bin/{config_name}/{target_framework}/wasi-wasm/{subdir}/StdbModule.wasm\"\n        )),\n        project_path.join(format!(\n            \"bin~/{config_name}/{target_framework}/wasi-wasm/{subdir}/StdbModule.wasm\"","sourceCodeStart":415,"sourceCodeEnd":451,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/9e0d92412ff2248f401a8ad12d535f2b5ac30912/crates/cli/src/tasks/csharp.rs#L415-L451","documentation":"After `dotnet publish` succeeds, the CLI checks for stale artifacts of the retired .NET 7 WASM path: bin{,~}/{Debug|Release}/net7.0/StdbModule.wasm (the tilde variants exist because some tooling renames bin to bin~). Finding one means the project still carries the deprecated .NET 7.0 WebAssembly bindings, so the output cannot be trusted and the CLI refuses to proceed.","triggerScenarios":"`spacetime build`/`spacetime publish` on a C# module created from the old .NET 7 template, or one with leftover net7.0 build outputs, using a current SpacetimeDB CLI.","commonSituations":"Upgrading the CLI/toolchain on an old project without cleaning; bin~ backups kept alive by editors, sync, or backup tools; migrating sources into a new template but copying old bin/obj folders along.","solutions":["Migrate the project to the current .NET 8+ template (re-run `spacetime init` and move sources, or update package references and TFM).","Delete bin, bin~, obj, obj~ exactly as the message instructs, then rebuild.","Verify the csproj targets net8.0/net10.0, not net7.0."],"exampleFix":"# before: old project still on net7.0\nspacetime build\n# after\nrm -rf bin bin~ obj obj~\n# update csproj: <TargetFramework>net8.0</TargetFramework>\nspacetime build","handlingStrategy":"validation","validationCode":"# Guard before building: reject .NET 7 targets and stale artifacts\n grep -q 'net7.0' \"$PROJECT\"/*.csproj && { echo \"migrate csproj off net7.0\" >&2; exit 1; }\nls \"$PROJECT\"/bin*/{Debug,Release}/net7.0/StdbModule.wasm 2>/dev/null && { echo \"stale .NET 7 output; rm -rf bin bin~ obj obj~\" >&2; exit 1; }\nspacetime build","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Migrate .NET 7 template projects before upgrading the SpacetimeDB CLI.","Add `rm -rf bin bin~ obj obj~` to upgrade scripts when moving between major templates.","Exclude bin/obj from sync/backup tools so stale copies do not linger as bin~."],"tags":["csharp","dotnet","deprecated-template","build-artifacts","migration"],"backgroundTag":"deprecated-runtime-version","analyzedSha":"9e0d92412ff2248f401a8ad12d535f2b5ac30912","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}