I'm using C# for the scripts in my Godot project. So far I've been using Visual Studio Code, but thought I'd give Visual Studio a try since it is one of the available editors and since I find the Visual Studio Code IDE is not as easy to use as other IDEs I've tried.

I switched my project over to using Visual Studio and got everything se up and can even compile the project and run it form Godot. However, when I try to run it from within Visual Studio, before the project launches I get the error

A project with an Output Type of Class Library cannot be started directly.

In order to debug this project, add an executable project to this solution which references the library project.  Set the executable project as the startup project.

How to I fix this?

I'm not totally sure if this is the case, but I think you can only run the Godot project by hitting the "run" button in the Godot editor. I think the IDE integration for Visual Studio and Visual Studio Code is just to make the editing of scripts easier. I could be completely wrong though! But right off, I don't think it's possible to tell Godot to run the project from an external IDE.

I can run it from Visual Studio Code and debug it there too. I've not found a way to do it with Visual Studio yet.

Oh, I stand corrected then! I didn't realize it was possible.

Maybe you need a plugin to debug and launch Godot from Visual Studio? This plugin that appears to allow for debugging and launching Godot from Visual Studio, at least according to the readme.

I'm looking into it now, I think it should work.

The problem is that the the plugin hasn't been updated in like a year. It still works, but Microsoft I guess updated Visual Studio so now you need a few more extra steps. I found out how to do it in this video.

If you want to skip the long video, here is the code you need to modify the Visual Studio solution so it links up with Godot.

I would also recommend creating an issue on https://github.com/godotengine/godot-csharp-visualstudio and explaining how the plugin doesn't work anymore and needs to be fixed.

a year later