I recently had a mega-merge with a load of conflicts to resolve for a SaaS I built and run. After resolving each conflict, the web project in the solution failed to load.
Here was the error:
Imported Project "C:\Microsoft.CSharp.targets Was Not Found
Everything I read suggested changing this line in the project file from this:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
To this:
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
That didn’t work.
~
Git-Fu
In the end, I had to run the following Git command:
git clean -xdf
I had a feeling temp files, merge conflict files, and other build artefacts were causing the issue.
This command removes unwanted files from your working directory.
It worked.
Learn more about the client command the respective parameters here.
~
The Lesson Learned
I should know better than to let a feature branch run for so long.
Leave a Reply