我试图在(即)中设置一个构建定义(visual ),并得到以下错误:
C:\Program (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DNX\Microsoft.DNX.targets(126,5):错误:需要安装Dnx包。有关详细信息,请参阅“输出”窗口。
我尝试添加一个运行Command Line pre-build step的dnvm upgrade,但它仍然没有工作。我也尝试过dnvm install 1.0.0-rc1-final -r clr -arch x86,但没有成功。
这个项目只是一个空的web应用程序模板。
另外,我应该提到,我对这个工具链非常陌生,我意识到我可能错过了一两步。谢谢。
编辑:--我尝试了提出这里 (dnvm升级)的解决方案,但是它没有工作,并产生了许多错误(这正是我可以在ss中安装的):参见这里的错误。我要补充的是,我无法运行dnu restore,因为很明显,它没有被识别为命令。
而且,我觉得奇怪的是,由于这是您可以设置的最基本的操作,所以它没有像预期的那样工作。
发布于 2016-03-11 03:31:44
您可以创建一个power脚本来安装dnx运行时并恢复dnu包。
# 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 }有关详细信息,请参阅此链接中的power部分:构建ASP.NET 5应用程序并将其部署到Azure。
https://stackoverflow.com/questions/35914097
复制相似问题