{"record":{"id":"709491eef9459a63","repo":"clockworklabs/SpacetimeDB","slug":"for-some-reason-your-project-has-both-a-bin-and","errorCode":null,"errorMessage":"For some reason, your project has both a `bin` and a `bin~` folder.\nI don't know which to use, so please delete both and rerun this command so that we can see which is up-to-date.","messagePattern":"For some reason, your project has both a `bin` and a `bin~` folder\\.\nI don't know which to use, so please delete both and rerun this command so that we can see which is up-to-date\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/tasks/csharp.rs","lineNumber":455,"sourceCode":"        )),\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\"\n        )),\n        // Also check for raw wasm output without wasi-wasm RID folder (NativeAOT-LLVM sometimes does this)\n        project_path.join(format!(\"bin/{config_name}/{target_framework}/native/StdbModule.wasm\")),\n        project_path.join(format!(\"bin~/{config_name}/{target_framework}/native/StdbModule.wasm\")),\n    ];\n    // Check if both bin and bin~ variants exist for the same output path (indicates a conflict)\n    for i in (0..possible_output_paths.len()).step_by(2) {\n        if i + 1 < possible_output_paths.len() {\n            let bin_path = &possible_output_paths[i];\n            let bin_tilde_path = &possible_output_paths[i + 1];\n            if bin_path.exists() && bin_tilde_path.exists() {\n                anyhow::bail!(concat!(\n                    \"For some reason, your project has both a `bin` and a `bin~` folder.\\n\",\n                    \"I don't know which to use, so please delete both and rerun this command so that we can see which is up-to-date.\"\n                ));\n            }\n        }\n    }\n    for output_path in &possible_output_paths {\n        if output_path.exists() {\n            return Ok(output_path.clone());\n        }\n    }\n\n    // Diagnostic: list what we expected and what actually exists in the output directories\n    eprintln!(\"Build path: {build_path:?}, target_framework: {target_framework}, subdir: {subdir}\");\n    eprintln!(\"Expected output in one of:\");\n    for p in &possible_output_paths {\n        eprintln!(\"  {}\", p.display());\n    }","sourceCodeStart":437,"sourceCodeEnd":473,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/tasks/csharp.rs#L437-L473","documentation":"Error \"For some reason, your project has both a `bin` and a `bin~` folder.\nI don't know which to use, so please delete both and rerun this command so that we can see which is up-to-date.\" thrown in clockworklabs/SpacetimeDB.","triggerScenarios":"Thrown at crates/cli/src/tasks/csharp.rs:455 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}