We recently upgraded our solution from Framework 4.5.1 to 4.6.2. It all worked and compiled fine, until we checked out an older branch targeting to Framework 4.5.1.
We started getting number of errors suggesting
All projects referencing MyProject.csproj must install nuget package Microsoft.Bcl.Build
Due to this compilation gets failing. The same branch is compiling without any errors on the systems where the branch having newer .NET framework is never checked out.
One of the project in that solution has reference of Microsoft.Bcl.Build Nuget package, so just to verify how this behaves on older git branches, I also tried taking a very old branch which is not having "Microsoft.Bcl.Build" reference, and started getting error
The type or namespace name 'XXX' does not exist in the namespace 'MyProject'
Eventhough I can see the DLLs are getting created, the compilation is failing with above error.
This is the same issue in all machines where branch with .NET Fx 4.6 was checked out for atleast once. Even the older branches are not compiling which were previously compiling and publishing without any issues, and are unchanged since than.
I believe this has something to do with Microsoft.Bcl.Build. Though that package is not referenced in older branches, it might had done something at system level which seems to be inferring with MsBuild.
Would like to know if anyone has any idea about this?
Also, I would be happy to provide more information:
Till now, I have already tried -
- Uninstalling .NET Framework 4.6.2
- Restarted the machine
- Cleaned Temp folder, as well as Temporary ASP.NET Websites folder
- Cleared Packages folder, and restored Nuget packages for the solution
But nothing has worked so far.
* UPDATE 1 *
MyProject.csproj file contains following line:
<Import Project="..\..\ZerochaosWeb\ZCW\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\ZerochaosWeb\ZCW\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
Does it have to do anything with the issue I am facing?