MASSHUU12/godot-yat

Unable to enable plugin

Closed this issue · 4 comments

Describe the bug

When trying to enable plugin, I get a popup with the following error:

Unable to load addon script from path: 'res://addons/yat/Plugin.cs'. This might be due to a code error in that script.
Disabling the addon at 'res://addons/yat/plugin.cfg' to prevent further errors.

Steps to reproduce

  1. Import YAT via AssetLib
  2. Try to enable plugin in Project Settings
  3. An error is thrown

Expected behavior

  1. Plugin should be enabled successfully

Additional information

  • Windows 11 23H2 (22631.3737)
  • Intel(R) Core(TM) i7-8809G CPU
  • YAT 1.31.1-beta
  • Godot v4.2.2.stable.mono.official [15073afe3]
  • dotnet:
> dotnet --list-sdks
8.0.303 [C:\Program Files\dotnet\sdk]
cuddles-skull\dkaszews@Cuddles-Skull:~
> dotnet --list-runtimes
Microsoft.AspNetCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Screenshots

No response

Additional context

No response

From the steps to reproduce, I see that you did not mention compiling the project. Did you follow instructions in the USAGE.md file? It's important to create a C# solution first, compile the project, and then you can activate the plugin.

By "compile", do you mean exporting the project as executable? Sorry but I am completely new to Godot.

I missed those instructions before, but they don't seem to help:

  1. Create empty project
  2. Add C# solution
  3. Edit *.csproj as in usage.md
  4. Export project
  5. Import YAT via AssetLib
  6. Try to enable plugin in Project Settings
  7. An error is thrown

I have noticed the following error in MSBuild tab:

CS0103: The name 'EditorInterface' does not exist in the current context C:\Users\dkaszews\code\Godot\First Game\addons\yat\src\update\UpdaterWindow.cs(108,9)

Alright, now I am a little lost. Can you watch this quick video and tell me if you do something differently, or the same and there are still errors?

By "compile" I mean using dotnet build or clicking the hammer icon in the editor in the upper right corner, but since you are getting an error with MSBuild, you did it.
At this point, the only thing I can think of is some bug in .csproj, or it's an old bug that hasn't gone away.

aaaa.mp4

Thank you for the video, that cleared everything up!

There was something broken with my dotnet installation, as trying to follow those steps resulted in "Failed to create C# project" and "Unable to find .NET SDK". Reinstalling dotnet and rebooting system helped the issue.