I have a strange problem where msbuild on my local development machine will restore packages but the version on my build server will not.
Local machine version: 17.12.12.57101 Build server version: 17.12.12.57101
My data.csproj
file contains the following package reference:
<ItemGroup>
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
</ItemGroup>
The data
project is referenced by my web
project.
If I run msbuild targeting the web project on my local machine, it will put a copy of System.ComponentModel.Annotations
version 4.7.0 in the bin\debug
folder of the project.
If I do the same on my build server, the reference will not be restored and the bin\debug
folder is not created.
I have also tried running nuget restore
at the root level of my project - it does not search through each project and restore the packages in the *proj
files, only the packages contained in package.config
files. Should it do this or have I misunderstood?
I have also tried calling msbuild with the -t:restore
option but that also does not work.
My local development machine has full Visual Studio installed on it, where as my build server does not so I think something is missing from the build server to tell msbuild to restore packages but I have no idea what it could be!
I have a strange problem where msbuild on my local development machine will restore packages but the version on my build server will not.
Local machine version: 17.12.12.57101 Build server version: 17.12.12.57101
My data.csproj
file contains the following package reference:
<ItemGroup>
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
</ItemGroup>
The data
project is referenced by my web
project.
If I run msbuild targeting the web project on my local machine, it will put a copy of System.ComponentModel.Annotations
version 4.7.0 in the bin\debug
folder of the project.
If I do the same on my build server, the reference will not be restored and the bin\debug
folder is not created.
I have also tried running nuget restore
at the root level of my project - it does not search through each project and restore the packages in the *proj
files, only the packages contained in package.config
files. Should it do this or have I misunderstood?
I have also tried calling msbuild with the -t:restore
option but that also does not work.
My local development machine has full Visual Studio installed on it, where as my build server does not so I think something is missing from the build server to tell msbuild to restore packages but I have no idea what it could be!
Share Improve this question asked Feb 2 at 14:07 RemotecRemotec 10.8k28 gold badges117 silver badges159 bronze badges 1 |1 Answer
Reset to default 0This was a problem with my build server which is a Bitbucket Runner Agent running on Windows.
The runner agent cannot run as the local system account, it must run as a full user for MSBuild to properly work.
msbuild
executable is only distributed with Visual Studio. On the build server is the web project actually being built? That there is no output folder suggests it is not being built. Also note thatpackage.config
andPackageReference
don't mix and can't be used together for the same project. – Jonathan Dodds Commented Feb 2 at 15:25