Debug in Visual Studio Community

PatrickOnePatrickOne Posts: 3Member
edited October 21 in General Chat

I can edit and run c# scripts written in Visual Studio Community on Godot, But I can't get VS to stop on breakpoints when I run a Godot scene - is some settings needed for debugging?
Attn. Im using the ide Visual Studio Community and not the editor Visual Studio Code.

I saw a message that when you use c# for scripts in Godot, the game want run on Android/IOS, is this true and if so when (if ever) will it be possible?
Without it I don't really see Godot having a future especially when Unity are marketing it self so heavily and getting free advertising from Microsoft.

Answers

  • TwistedTwiglegTwistedTwigleg Posts: 1,716Admin
    edited October 21

    It looks like it is possible to debug Mono/C# Godot projects using Visual Studio Code, so I imagine most of the steps will work with Visual Studio Community as well with some minor adjustments.

    This page on GodotSharp.net has a small tutorial that shows how to setup debugging for Visual Studio Code.
    There is also this post on IdiotCoder.com that shows how to debug a Godot C# project using Jetbrains Rider, which might also be worth taking a look at.


    I believe that C# support is for Android is part of Godot 3.2. The announcement post for Godot 3.2 alpha 1 mentions that C# Android support is one of the reasons they had to change the Android build system, so I expect that Godot 3.2+ projects will have C# support.

    I have no idea on C# support for iOS though. There is an open issue on the Godot GitHub for adding Mono/C# support to iOS, so I think iOS support is not currently added just yet, but it is planned for the future.

    (Side note: Welcome to the forums)

  • PatrickOnePatrickOne Posts: 3Member

    Hi!

    Thanks for the welcome!

    Is there really no guide for setting up debug in the ide versions of Visual Studio?
    I tried and couldn't get it to work. Comments in github even said debugging in Visual Studio Code is broken.

    I runned in to another problem, when building in Godot only the dll in .mono\temp\bin\Debug is updated, I manually have to copy the dll to .mono\temp\bin\Tools to run from godot and to .mono\temp\bin\Release for creating exe. It wasn't like this before, any suggestions?

    Might I suggest that the people who update Godot look at Xamarin when implementing iOS support.

  • TwistedTwiglegTwistedTwigleg Posts: 1,716Admin

    @PatrickOne said:
    Hi!

    Thanks for the welcome!

    Is there really no guide for setting up debug in the ide versions of Visual Studio?
    I tried and couldn't get it to work. Comments in github even said debugging in Visual Studio Code is broken.

    Not that I know of. I did some quick Google searches and I only could find the links that I posted previously.
    It seems most It seems the most common IDE used for C# in Godot is Visual Studio Code, rather than Visual Studio.
    There might be a way to use Visual Studio with Godot and C#, but it seems it isn't as widely spread. If you have not already, maybe ask and see if anyone on the Godot Facebook, Reddit, and/or Discord knows?

    I runned in to another problem, when building in Godot only the dll in .mono\temp\bin\Debug is updated, I manually have to copy the dll to .mono\temp\bin\Tools to run from godot and to .mono\temp\bin\Release for creating exe. It wasn't like this before, any suggestions?

    Sorry, I don't know. I had this issue once with a C# project, and the way I found to get around it was to delete the entire temp folder, close my IDE, and restart Godot. Even then, it didn't always work and took several tries before it suddenly just started working again.

    Might I suggest that the people who update Godot look at Xamarin when implementing iOS support.

    Sure, but the main developers don't really view the Godot forums that often. If you want to suggest using Xamarin, then the Godot proposals repository and/or this GitHub issue is probably where you should suggest the use of Xamarin.

    That said, Xamarin has come up several times for Android and iOS C# support, so the developers are probably already aware of it. I don't know if the plan for iOS C# support is to use Xamarin or not. From what I can gather, C# support on Android uses an Android build of Mono rather than Xamarin, but I have only briefly looked into it and am not really up to date with the latest changes in Godot.

Sign In or Register to comment.