msbuildmsbuildextensionpackpackagereference

Unified primary reference


I am facing issue getting my project to build on server. The same project build fine locally on my machine (VS 2017 15.8). Teamcity sever also has the same msbuild tool version installed. It doesn't have VS 2017.

Project build on server results in following error:

"error CS0433: The type 'OracleCommand' exists in both 'Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342' and 'Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342'

So far I have been able to pin point the cause of the error to due to autounify not triggering/working at resolving package reference (I am using package reference for nuget packages) for project build.

I also confirmed that teamcity server doesn't contain Microsoft.NET.Build.Extensions.

Any idea on how shall I proceed towards resolving this issue. I know installing VS 2017 on TC server will likely resolve this, but that's not an option now. Any ideas people?


Solution

  • Here's how I solved the problem on team-city server: - Copied Microsoft.NET.Build.Extensions folder from my local machine to MSBuild/Microsoft older - Copied Microsoft.NET.Build.Extensions.targets file to MSBuild\15.0\Microsoft.Common.Targets\ImportAfter folder

    Above steps resolved the build issue on TC server.