leonardochaia/dotnet-affected

Internal MSBuild Error: ../my-solution.sln unexpectedly not a rooted path

Closed this issue ยท 2 comments

Did anyone face similar issue? I recently upgraded from 3.1.1 to 3.2.0

Running the following command

dotnet dotnet-affected -v --format text traversal --solution-path ../my-solution.sln --output-dir ../ --from origin/feat-upgrade --to origin/develop

I now get the following error

Unhandled exception: Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: ../awork-backend.sln unexpectedly not a rooted path

Any ideas or suggestions?

Hi @vdurante , I think you figure it out yourself, however, wanna share what happened for the next person to stumble on this error? At a glance I don't really know how you fixed it ๐Ÿ‘

Thanks and thanks for using the tool, hope it works for you ๐Ÿ‘

@leonardochaia hey! I can definitely explain what happened and what I did to fix, but it had nothing to do with dotnet-affected.

The solution path has to be an absolute path, not a relative one. That's why it is failing. MSBuild expects absolute paths.

In my specific case, I was using dotnet-affected inside a Nuke pipeline. When I updated Nuke and dotnet-affected, I noticed my code for getting affected projects started failing, so I thought it was caused by a change in dotnet-affected. I later found out it was actually a change in how Nuke handles arguments that are passed to cli tools, which made dotnet-affected get the path argument encoded in a way that made MSBuild treat it as a relative path.

I changed the way the path argument was built and the dotnet-affected CLI worked perfectly.