C# intellisense not working
- Installed spacetimedb cli
- Installed .net 8.0.407 SDK
- Installed wasi-experimental
- Created project with spacetime init --lang csharp server
- When i open project
- Closed VS, saved sln file and reopen project
- Installed MSBuild 17.8.3 and still same error
Ok my mistake. I saved sln file to the same folder of project file. Some errors because of this. I properly saved the sln file and then all errors gone except this. I checked the project target it is .net 8.0.
Interesting we should not use vs build and should use spacetime cli then it builds. But there is no intelli sense code completion in vs 2022.
I deleted everything and started again but this time I used vscode then it works and also intelli sense code completion works but when i close vscode and reopen project then intelli sense not working again. Also it gives same error.
Thanks for reporting! We're going to try to reproduce this on our end and report back.
@volkans80 have you moving the global,json up a level? That got me past VS Code yelling about .Net 9
Yes you are right, it solved the problem. Thanks.
Is this issue fully resolved? Is anything else still going wrong with intellisense?
@bfops it would be great if when someone runs spacetime init --lang csharp server it puts the global.json in the right spot.
@bfops it would be great if when someone runs
spacetime init --lang csharp serverit puts theglobal.jsonin the right spot.
What's "the right" spot for you? It's definitely in a right spot, but it sounds like it gets confused if you also create a .sln.
What's the final directory structure that works for you?
You are probably right about the .sln, I didn't manually create it, though. I thought it came from the init cmd.
You are probably right about the
.sln, I didn't manually create it, though. I thought it came from the init cmd.
I think it's created by Visual Studio when it's open the .csproj. spacetime init just creates the .csproj.
I think all of the issues in here have been resolved. Feel free to reopen if that's not the case!
For the record, trying to use Visual Studio proper still doesn't work. All of the above errors continue to pop up.
For the record, trying to use Visual Studio proper still doesn't work. All of the above errors continue to pop up.
Hm, rats.. And that's true for you even after trying the solution here? https://github.com/clockworklabs/SpacetimeDB/issues/2469#issuecomment-2791562030
Sadly, yes.
It's obvious something changed in .NET 9, but I'm having a hard time figuring out what the new method of creating a pure wasm module/binary would be. It would be nice if we could just use the latest stuff.
...VS Intellisense now works after restarting my machine... I very confused as to why there was a problem to begin with. Maybe it should be a general recommendation to restart after installing everything.
I don't think this is the end of the problem, however. This fix feels fragile, as VS Code still reports similar errors during project restore. (but intellisense works at least.)
2025-06-18 16:19:55.667 [info] Determining projects to restore...
2025-06-18 16:19:55.751 [info] C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.workload.mono.toolchain.current\9.0.6\WorkloadManifest.Wasi.targets(14,5): error : The 'wasi-experimental' workload is not supported in .NET 9. [E:\SpacetimeDB\Server\StdbModule.csproj]
Yes, the project is still targetting .NET 8
It might have something to do with the fact that downloading wasi-experimental downloads a version that targets .NET 9 for whatever reason (I guess I didn't have 8's SDK installed at the time), but building with the spacetime command seemed to download a different version? Both those things happened, along with installing 8's SDK separately, before restarting.
If those are the reasons why this now works for me, then maybe there needs to be a few more things added to the Quick Start guide.
I'm giving as much information as possible so we can understand the issue.
Ah thank you for the extra detail. We'll look into adding more clarity into the quick start guide, or a "Common issues" or something like that.