How do I trigger a C# rebuild from an editor plugin?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By falconfetus8

I have an editor plugin that runs C# unit tests. I’d like to tweak it so that, right before tests are run, the C# project recompiles. How do I do that? Does Godot expose an API for that to editor plugins?

The editor uses the MSBuildPanel and calls ‘BuildSolution’ when the button is pressed; I can’t see from a cursory glance how it does this from elsewhere but, it might just be simpler to launch a process/cli that calls msbuild (in GodotSharp), feeding it the solution file (for example, when you initialise the test).

spaceyjase | 2021-11-15 09:48

:bust_in_silhouette: Reply From: spaceyjase

Perhaps also consider using an IDE such as Visual Studio or Rider. Assuming the test code has its own project, and has the main project as a dependency, both will build the game independently of godot.