Repository: godot
Issue: Using the new `--import` parameter in combination with `--build-solutions`  or `--headless` shows still plugin loading errors
Labels: discussion,topic:editor,documentation,needs testing,topic:dotnet

### Tested versions

v4.2.2.stable.mono.official [15073afe3]

### System information

Windows

### Issue description

I tested the new `--import` option to remove the Godot cache rebuild hack.
But it shows still the same plugin loading errors when using in combination with `--build-solutions`
` $GODOT_BIN --path ./ --import --build-solutions --headless`

```
Godot Engine v4.2.2.stable.mono.official.15073afe3 - https://godotengine.org

WARNING: Custom cursor shape not supported by this display server.
     at: cursor_set_custom_image (servers/display_server.cpp:505)
WARNING: Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
     at: _editor_init (modules/gltf/register_types.cpp:63)
SCRIPT ERROR: Parse Error: Identifier "GdUnitSettings" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:21)
SCRIPT ERROR: Parse Error: Identifier "GdUnitSettings" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:31)
SCRIPT ERROR: Parse Error: Identifier "GdUnit4CSharpApiLoader" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:34)
SCRIPT ERROR: Parse Error: Identifier "GdUnit4CSharpApiLoader" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:35)
SCRIPT ERROR: Parse Error: Identifier "GodotVersionFixures" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:46)
ERROR: Failed to load script "res://addons/gdUnit4/plugin.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:2726)
SCRIPT ERROR: Parse Error: Identifier "GdUnitSettings" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:21)
SCRIPT ERROR: Parse Error: Identifier "GdUnitSettings" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:31)
SCRIPT ERROR: Parse Error: Identifier "GdUnit4CSharpApiLoader" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:34)
SCRIPT ERROR: Parse Error: Identifier "GdUnit4CSharpApiLoader" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:35)
SCRIPT ERROR: Parse Error: Identifier "GodotVersionFixures" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:46)
ERROR: Failed to load script "res://addons/gdUnit4/plugin.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:2726)
ERROR: Missing required editor-specific import metadata for a texture (please reimport it using the 'Import' tab): 'res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.editor.meta'
   at: (editor/import/resource_importer_texture.cpp:413)
ERROR: Condition "!EditorSettings::get_singleton() || !EditorSettings::get_singleton()->has_setting(p_setting)" is true. Returning: Variant()
   at: _EDITOR_GET (editor/editor_settings.cpp:1144)
```
Using the options in separate calls works without showing any errors.

```
 $GODOT_BIN --path ./ --import --headless
Godot Engine v4.2.2.stable.mono.official.15073afe3 - https://godotengine.org
Loading GdUnit4 Plugin success
Unload GdUnit4 Plugin success

 $GODOT_BIN --path ./ --build-solutions --headless
Godot Engine v4.2.2.stable.mono.official.15073afe3 - https://godotengine.org
Loading GdUnit4 Plugin success
```
And both option do loading the plugins, but it should only reimport resources or compile the c# classes.
More critical is the usage of `--build-solutions --headless` it runs editor forever and needs to be manually killed.
From the documentation:
> --build-solutions                 Build the scripting solutions (e.g. for C# projects). Implies --editor and requires a valid project to edit.

It is not a build only it runs the editor too.

### Steps to reproduce

run this command
```
 rm -rf .godot
 $GODOT_BIN --path ./ --import --build-solutions --headless
```

The editor finally hangs, I would expect the process to do only reimport and compile the c# classes.
Even if it is expected that with `--build-solutions` the editor started it produces the errors and makes `--import` useless

```
 rm -rf .godot
 $GODOT_BIN --path ./ --import --build-solutions
 
 Godot Engine v4.2.2.stable.mono.official.15073afe3 - https://godotengine.org
Vulkan API 1.3.260 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce RTX 4070 Ti

WARNING: Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
     at: _editor_init (modules/gltf/register_types.cpp:63)
SCRIPT ERROR: Parse Error: Identifier "GdUnitSettings" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:21)
SCRIPT ERROR: Parse Error: Identifier "GdUnitSettings" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:31)
SCRIPT ERROR: Parse Error: Identifier "GdUnit4CSharpApiLoader" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:34)
SCRIPT ERROR: Parse Error: Identifier "GdUnit4CSharpApiLoader" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:35)
SCRIPT ERROR: Parse Error: Identifier "GodotVersionFixures" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:46)
ERROR: Failed to load script "res://addons/gdUnit4/plugin.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:2726)
SCRIPT ERROR: Parse Error: Identifier "GdUnitSettings" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:21)
SCRIPT ERROR: Parse Error: Identifier "GdUnitSettings" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:31)
SCRIPT ERROR: Parse Error: Identifier "GdUnit4CSharpApiLoader" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:34)
SCRIPT ERROR: Parse Error: Identifier "GdUnit4CSharpApiLoader" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:35)
SCRIPT ERROR: Parse Error: Identifier "GodotVersionFixures" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:46)
ERROR: Failed to load script "res://addons/gdUnit4/plugin.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:2726)
ERROR: Missing required editor-specific import metadata for a texture (please reimport it using the 'Import' tab): 'res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.editor.meta'
   at: (editor/import/resource_importer_texture.cpp:413)
ERROR: Condition "!EditorSettings::get_singleton() || !EditorSettings::get_singleton()->has_setting(p_setting)" is true. Returning: Variant()
   at: _EDITOR_GET (editor/editor_settings.cpp:1144)

```

at least using `--import --headless` shows also the errors
```
$GODOT_BIN --path ./ --import --headless
Godot Engine v4.2.2.stable.mono.official.15073afe3 - https://godotengine.org

plugin cmd args ["--editor"]
It was recognized that GdUnit4 is running in a test environment, therefore the GdUnit4 plugin will not be activated!
plugin cmd args ["--editor"]
WARNING: Custom cursor shape not supported by this display server.
     at: cursor_set_custom_image (servers/display_server.cpp:505)
WARNING: Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
     at: _editor_init (modules/gltf/register_types.cpp:63)
SCRIPT ERROR: Parse Error: Identifier "GdUnitSettings" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:21)
SCRIPT ERROR: Parse Error: Identifier "GdUnitSettings" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:31)
SCRIPT ERROR: Parse Error: Identifier "GdUnit4CSharpApiLoader" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:34)
SCRIPT ERROR: Parse Error: Identifier "GdUnit4CSharpApiLoader" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:35)
SCRIPT ERROR: Parse Error: Identifier "GodotVersionFixures" not declared in the current scope.
          at: GDScript::reload (res://addons/gdUnit4/plugin.gd:46)
ERROR: Failed to load script "res://addons/gdUnit4/plugin.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:2726)
ERROR: Missing required editor-specific import metadata for a texture (please reimport it using the 'Import' tab): 'res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.editor.meta'
   at: (editor/import/resource_importer_texture.cpp:413)
ERROR: Condition "!EditorSettings::get_singleton() || !EditorSettings::get_singleton()->has_setting(p_setting)" is true. Returning: Variant()
   at: _EDITOR_GET (editor/editor_settings.cpp:1144)
```


### Minimal reproduction project (MRP)

n/a