我正在开发一个在 .net 框架上的应用程序,代码在 github 上,有人可以帮助我了解 buidspec.yml 文件以及我在 CICD 构建项目的项目环境中使用的任何额外文件:
aws/codebuild/windows-base:2.0-19.11.15
buildspec.yml file
--------------------------------
version: 0.2
env:
variables:
SOLUTION: .\CSharpHelloWorld.sln
PACKAGE_DIRECTORY: .\packages
DOTNET_FRAMEWORK: 4.6.2
phases:
build:
commands:
- '& "C:\ProgramData\chocolatey\bin\NuGet.exe" restore $env:SOLUTION -PackagesDirectory $env:PACKAGE_DIRECTORY'
- '& "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" -p:FrameworkPathOverride="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v$env:DOTNET_FRAMEWORK" $env:SOLUTION'
artifacts:
files:
- .\CSharpHelloWorld\bin\Debug\*
-------------------------------
当代码构建发生时,会出现如下错误:
---------------------------
[Container] 2020/02/01 09:23:49 Phase complete: BUILD State: FAILED
[Container] 2020/02/01 09:23:49 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: & "C:\Program Files (x86)\MSBuild\15.0\Bin\MSBuild.exe" -p:FrameworkPathOverride="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v$env:DOTNET_FRAMEWORK" $env:SOLUTION. Reason: exit status 1
[Container] 2020/02/01 09:23:49 Entering phase POST_BUILD
------------------------------