首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >构建asp.net5应用程序-不使用自托管代理的Prebuild.ps1

构建asp.net5应用程序-不使用自托管代理的Prebuild.ps1
EN

Stack Overflow用户
提问于 2016-03-02 23:28:49
回答 1查看 142关注 0票数 0

此msdn站点上,我找到了如何使用构建asp.net5应用程序并将其部署到Azure的指南。第一步是使用以下powershell预构建脚本安装dnx

代码语言:javascript
复制
    # bootstrap DNVM into this session.
&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}

# load up the global.json so we can find the DNX version
$globalJson = Get-Content -Path $PSScriptRoot\global.json -Raw -ErrorAction Ignore | ConvertFrom-Json -ErrorAction Ignore

if($globalJson)
{
    $dnxVersion = $globalJson.sdk.version
}
else
{
    Write-Warning "Unable to locate global.json to determine using 'latest'"
    $dnxVersion = "latest"
}

# install DNX
# only installs the default (x86, clr) runtime of the framework.
# If you need additional architectures or runtimes you should add additional calls
# ex: & $env:USERPROFILE\.dnx\bin\dnvm install $dnxVersion -r coreclr
& $env:USERPROFILE\.dnx\bin\dnvm install $dnxVersion -Persistent

 # run DNU restore on all project.json files in the src folder including 2>1 to redirect stderr to stdout for badly behaved tools
Get-ChildItem -Path $PSScriptRoot\src -Filter project.json -Recurse | ForEach-Object { & dnu restore $_.FullName 2>1 }

当我使用宿主代理时,这个脚本可以工作,但是当我想使用自托管代理时,我会收到以下错误:

代码语言:javascript
复制
out-file : Access to the path 'C:\1' is denied.
At C:\Users\xy\Desktop\agent\_work\1\s\Prebuild.ps1:28 char:88
+ ... ject.json -Recurse | ForEach-Object { & dnu restore $_.FullName 2>1 }

我的自托管代理工作位置是C:\Users\xy\Desktop\agent_work。我看不出有那么多的一个powershell,所以我想请你,帮助。谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-03-03 02:00:50

这是因为默认情况下,您的自构建代理是以“网络服务”帐户作为服务运行的。

要解决此问题,可以通过命令将其更改为具有管理员权限的帐户运行:

代码语言:javascript
复制
C:\Users\xy\Desktop\agent\Agent\VsoAgent.exe /ChangeWindowsServiceAccount

或将生成代理配置为交互式运行,然后以管理员身份运行。

有关详细信息,请参阅此链接:运行代理程序

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35760318

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档