C# Mono Build Failure with C# script

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

I have some inherited scenes that I have a button for a script to return to a mainMenu.

I know with C# you have to rebuild with export variables. But i can’t seem to build the project, the errors I get are highlighted below. Anything I missed out or overlooked? Thank you for your help! :slight_smile:

My code for the simple script

using Godot;
using System;

public class MenuButton : Button
{
    [Export]
    public string scene_to_load;

}

My Output Build Errors:

 Failed to get modified time for: C:/Users/Godot/Scenes/Main%20Menu/Buttons/MenuButton.cs
 modules/mono/utils/string_utils.cpp:168 - Condition ' err != OK ' is true. returned: err
 modules/mono/editor/script_class_parser.cpp:650 - Method/Function Failed, returning: ferr
 modules/mono/editor/csharp_project.cpp:183 - Parse error: 
 Failed to determine namespace and class for script: res://Scenes/Main%20Menu/Buttons/MenuButton.cs
 modules/mono/editor/mono_bottom_panel.cpp:168 - Condition ' metadata_err != OK ' is true.
:bust_in_silhouette: Reply From: Holo74

Currently in 3.1, if the folder paths have a space in them that lead to a script you will get these errors. The best way to handle it is to just eliminate the space, go to the csproj and open it with a text editor and delete the previous scripts that were in the folder. Then go back to godot and build the project under mono. This should fix the problem.