Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The attribute "Version" in element <PackageReference> is unrecognized

I have a solution with many projects that target .net 4.6.1. On our MS build server it builds just fine. I recently added a project that targets .NET Standard 1.3. This will not build on the build server. It builds locally with VS2017 just fine. Build server VS has just been updated with all the latest.

The build error I'm getting is: The attribute "Version" in element <PackageReference> is unrecognized.

I am getting this for a few references. Here's one pulled from the project file: <PackageReference Include="System.Diagnostics.Process" Version="4.3.0"/>

Any ideas?

like image 436
birken25 Avatar asked Mar 19 '19 20:03

birken25


2 Answers

Looks like you are not building using the MSBuild.exe that is included in VS 2017 (/ build tools) but rather the MSBuild.exe that ships with .NET Framework, which is an old version (and won't be updated).

Consider using VSWhere to locate MSBuild.exe

like image 169
Martin Ullrich Avatar answered Nov 04 '22 19:11

Martin Ullrich


If anyone come across this thread, refer below solution for .Net Framework projects.

<PackageReference Include="System.Diagnostics.Process">
    <Version>4.3.0</Version>
</PackageReference>
like image 28
Nirav Bhatt Avatar answered Nov 04 '22 20:11

Nirav Bhatt