Azure DevOps 管道,未设置DOTNET_BUNDLE_EXTRACT_BASE_DIR,并且无法创建读写缓存目录



我正在尝试运行efbundle.exe在我的azure管道,但它给我这个错误。

Failure processing application bundle.
Failed to determine location for extracting embedded files.
DOTNET_BUNDLE_EXTRACT_BASE_DIR is not set, and a read-write cache directory couldn't be created.
##[error]Bash exited with code '159'.

这是我的yml文件(相关部分)

- stage: 'Deploy'  
jobs:
- deployment:
strategy:
runOnce:
deploy:           
steps:
- bash: |
chmod +x $(System.ArtifactsDirectory)/drop/efbundle.exe
$(System.ArtifactsDirectory)/drop/efbundle.exe

这似乎与用户的许可有关。应用程序试图提取包,但用户没有对提取目录的写权限。

解决方案是这样设置提取目录:

- stage: 'Deploy'  
jobs:
- deployment:
strategy:
runOnce:
deploy:           
steps:
- bash: |
export DOTNET_BUNDLE_EXTRACT_BASE_DIR="$(System.ArtifactsDirectory)/.net"
chmod +x $(System.ArtifactsDirectory)/drop/efbundle.exe
$(System.ArtifactsDirectory)/drop/efbundle.exe

最新更新