Create minimal repro project:
dotnet new classlib --no-restore --output /tmp/Foo
cd /tmp/Foo
dotnet new tool-manifest
dotnet tool install cake.tool
touch build.cake
Put this minimal script in build.cake:
Task("Default").Does(() => {
var file = "./Foo.csproj";
Information(FileExists(file).ToString());
var props = ParseProject(file);
});
RunTarget("Default");
Run it:
dotnet cake
Result:
========================================
Default
========================================
True
An error occurred when executing task 'Default'.
Error: Failed to parse project properties
Surely this minimal script should succeed - have I made a mistake, or is this a bug?
My environment: linux, dotnet 6.0.302.