NuGet restore fails with error MSB1009: Project file does not exist when running Bamboo agent service as LOCAL SYSTEM

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

問題

NuGet restore during a MSBuild Task fails with error MSB1009: Project file does not exist when running Bamboo agent service as the LOCAL SYSTEM account. The following appears in the build log:

build	13-Jan-2020 15:07:00	MSBUILD : error MSB1009: Project file does not exist. [C:\Bamboo\bamboo-agent-home\xml-data\build-dir\PROJ-PLAN-JOB1\BUILD_msbuild.proj]
build	13-Jan-2020 15:07:00	  Switch: C:\windows\system32\config\systemprofile\AppData\Local\Temp\NuGetScratch\dtuk4fmu.hcu.nugetinputs.targets

診断

環境

  • Bamboo agent running as a Windows Service under the LOCAL SYSTEM account.

原因

NuGet is unable to write to C:\windows\system32\config\systemprofile\AppData\Local\Temp while running under this context

回避策

Option 1: Override the TMP and TEMP directory environment variables values to a different location

Configure the MSBuild task at Plan Configuration >> Tasks >> MSBuild and set the Environment Variables field to override the values. Example:

TMP="C:\Bamboo\bamboo-agent-home\temp" TEMP="C:\Bamboo\bamboo-agent-home\temp"
Option 2: Configure the Bamboo agent Windows Service to run under a local user account context
  1. Start >> Run >> services.msc
  2. Find the Atlassian Bamboo remote agent service
  3. Right click >> Properties >> Log On
  4. Configure the service to run as a local user account of your choosing
  5. Ensure this local user account as full ownership over the $BAMBOO_AGENT_HOME directory
  6. Restart the agent



説明 NuGet restore during a MSBuild Task fails with error MSB1009: Project file does not exist when running Bamboo agent service as the LOCAL SYSTEM account.
製品Bamboo

最終更新日: 2020 年 1 月 23 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.