*.dll.licenses file in obj directory not created with msbuild in TeamCity

后端 未结 8 2039
眼角桃花
眼角桃花 2020-12-23 17:20

I am working on upgrading our TeamCity projects from VS2012 to VS2015 and I am running into an issue compiling our MVC application.

Old MSBuild (v4.0.30319.34209) g

8条回答
  •  感动是毒
    2020-12-23 18:03

    In our case we use Atlassian Bamboo as build server with build agents running Windows Server 2012 (not R2). So installing the Windows 10 SDK or Visual Studio Build Tools 2017 or 2019 was not an option because it won't install on Windows Server 2012 because it does not meet system requirements.

    I got it working with a pre-build event added to the VS project. (Thanks Joseph Haslinger for the idea)

    The pre-build event added to the project properties calls a PowerShell script with the following command: powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File $(ProjectDir)pre-build.ps1 $(ProjectDir) $(TargetFileName)

    The command is based on the one from Jiří Činčura of tabs ↹ over ␣ ␣ ␣ spaces

    I’m setting ExecutionPolicy to Bypass in case somebody would not have it set to Unrestricted.

提交回复
热议问题