clockworklabs / clockworklabs/SpacetimeDB

Cannot run `spacetime publish` when csproj + sln live in same folder

Open
#2,599 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
25.2k
Forks
1.1k
Avg merge
2d 7h
Merged PRs (30d)
46

Description

I've been going through https://spacetimedb.com/docs/unity/part-3.

When opening the server-csharp folder in VS Code:

cd C:\dev\unity-games\blackholio\server-csharp
code .

It (C# DevKit?) automatically creates a server-csharp.sln file in the same folder as StdbModule.csproj.

After this, if I run spacetime publish --server local blackholio I get an error:

MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.
Error: command ["dotnet", "publish", "-c", "Release", "-v", "quiet"] exited with code 1

There is no way to specify that StdbModule.csproj should be built.

--build-options is only used to specify additional options to the spacetime build command which gets invoked as part of spacetime publish.

Static dotnet publish execution:
https://github.com/clockworklabs/SpacetimeDB/blob/651f79d22cc4bb1c3c996ef2436186501a5d83bd/crates/cli/src/tasks/csharp.rs#L70C5-L70C65

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The publish path is in crates/cli/src/tasks/csharp.rs, with the static dotnet publish invocation at line 70. Start there and reproduce with StdbModule.csproj and server-csharp.sln in one directory; done means spacetime publish --server local blackholio can build the intended project without MSB1011.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, rust
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.