Hi There,
I am trying to configure Jenkins for my .Net Core Web API. We are using VS 2017 to build our code. So, when I try to build the project using command line "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" /target:Clean,Build /property:Configuration=Release,VisualStudioVersion=15.0 "projectName.sln" I get the below error: NETSDK1064: Package Microsoft.VisualStudio.Web.CodeGeneration, version 2.1.1 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions.
Can anyone help me in resolving the issue.
Pass /restore as one of the arguments to msbuild so that it runs a restore and acquires the packagereferences for your projects.
If this does not work, let us know and we can re-activate the issue to look further into what is going on.
I have same issue.
building xunit C# project/solution using msbuild visual studio 2019
C:\Program Files\dotnet\sdk\2.1.700\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198,5): error NETSDK1064: Package xunit.analyzers, version 0.10.0 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions. [C:\Jenkins\workspace\test_C_sharp_testsxunit_githib_test.csproj]
Use : /t:Restore;Build
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" t:Restore;Build ProjectXXX.sln
@nik331 Do not use /t:Restore;Build
. It results in subtle bugs. Instead, use the separate argument /restore
.
Most helpful comment
I have same issue.
building xunit C# project/solution using msbuild visual studio 2019
C:\Program Files\dotnet\sdk\2.1.700\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198,5): error NETSDK1064: Package xunit.analyzers, version 0.10.0 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions. [C:\Jenkins\workspace\test_C_sharp_testsxunit_githib_test.csproj]