Godot Version
v4.4.1.stable.mono.official [49a5bc7b6]
JetBrains Rider 2025.1.4
Framework net9.0, C# LangVersion 12.0
Question
How do I remove this warning when building my NUnit test project (poco tests – no Godot tests)?
Warning CS8785 : Generator 'ScriptPathAttributeGenerator' failed to generate source.
It will not contribute to the output and compilation errors may occur as a result.
Exception was of type 'InvalidOperationException' with message 'Property 'GodotProjectDir' is null or empty.'.
the csproj file starts with:
<Project Sdk="Microsoft.NET.Sdk">
and has no Godot project settings – I assume it’s the
<Using Include="NUnit.Framework"/>
causing the Godot.SourceGenerators analyzer to get included.
I’ve tried the PropertyGroup <IsTestProject>true</IsTestProject>, but the warning persists.
I’ve tried setting GodotProjectDir a number of ways in the csproj file.
I’ve blocked all analyzers, this removes warning but then the test cases are not available in the Test Viewer.