Jenkins not restoring NuGet packages with new MSBuild restore target

后端 未结 3 1856
抹茶落季
抹茶落季 2020-12-25 12:16

We have a .net full framework WPF application that we\'ve moved from .net 4.6.2 to 4.7.1 along with changing to PackageReference in the csp

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-25 12:42

    For us it was indeed an issue with bitness!

    The problem specifically is that MSBuild is actually looking for the nuget packages in the following directory:

    C:\Windows\SysWOW64\config\systemprofile\.nuget\packages
    

    Even though the logs actually say:

    C:\Windows\System32\config\systemprofile\.nuget\packages
    

    Because the msbuild being called is a 32-bit process running on a 64-bit platform, when it looks in System32, it's actually looking into SysWOW64.

    This is done by file system redirection.

    The solution for us was to simply call the 64-bit version of MSBuild, located at:

    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\amd64\MSBuild.exe
    

    Notice the amd64 in the path.

提交回复
热议问题