[英]The Dnx Runtime package needs to be installed
在Windows 10 x64計算機上運行的VS2015中,嘗試構建.net core
Web項目時出現以下錯誤。
The Dnx Runtime package needs to be installed. See output window for more details
這是輸出窗口日志(僅相關部分)
1>Done building target "BeforeCompile" in project "WebApplication1.xproj".
1> Target "_TimeStampBeforeCompile" skipped, due to false condition; ('$(RunPostBuildEvent)'=='OnOutputUpdated' or ('$(RegisterForComInterop)'=='true' and '$(OutputType)'=='library')) was evaluated as (''=='OnOutputUpdated' or (''=='true' and 'Library'=='library')).
1> 1>
1>Target "GetRuntimeToolingPathTarget" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DNX\Microsoft.DNX.targets" from project "C:\Users\v-prchep\Documents\Visual Studio 2015\Projects\WebApplication1\src\WebApplication1\WebApplication1.xproj" (target "CoreCompile" depends on it):
1> Using "GetRuntimeToolingPath" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DNX\Microsoft.DNX.Tasks.dll".
1> Task "GetRuntimeToolingPath"
1> Done executing task "GetRuntimeToolingPath".
1> Using "Error" task from assembly "Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1> Task "Error"
1> 1>
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DNX\Microsoft.DNX.targets(126,5): error : The Dnx Runtime package needs to be installed. See output window for more details.
1> Done executing task "Error" -- FAILED.
1> 1>
1>Done building target "GetRuntimeToolingPathTarget" in project "WebApplication1.xproj" -- FAILED.
1> 1>
1>Target "_CheckForCompileOutputs" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\v-prchep\Documents\Visual Studio 2015\Projects\WebApplication1\src\WebApplication1\WebApplication1.xproj" (target "_CleanGetCurrentAndPriorFileWrites" depends on it):
1> 1>
1>Done building target "_CheckForCompileOutputs" in project "WebApplication1.xproj".
1> Target "_SGenCheckForOutputs" skipped, due to false condition; ('$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('@(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')) was evaluated as ('Off' == 'On' or (''!='' and 'Off' == 'Auto')).
1> 1>
1>Target "_CleanGetCurrentAndPriorFileWrites" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\v-prchep\Documents\Visual Studio 2015\Projects\WebApplication1\src\WebApplication1\WebApplication1.xproj" (target "_CleanRecordFileWrites" depends on it):
1> Task "ReadLinesFromFile"
1> Done executing task "ReadLinesFromFile".
1> Using "ConvertToAbsolutePath" task from assembly "Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1> Task "ConvertToAbsolutePath"
1> Done executing task "ConvertToAbsolutePath".
1> Task "FindUnderPath"
1> Comparison path is "C:\Users\v-prchep\Documents\Visual Studio 2015\Projects\WebApplication1\src\WebApplication1".
1> Done executing task "FindUnderPath".
1> Task "FindUnderPath"
1> Comparison path is "..\..\artifacts\bin\WebApplication1\".
1> Done executing task "FindUnderPath".
1> Task "FindUnderPath"
1> Comparison path is "..\..\artifacts\obj\WebApplication1\Debug\".
1> Done executing task "FindUnderPath".
1> Task "RemoveDuplicates"
1> Done executing task "RemoveDuplicates".
1> 1>
1>Done building target "_CleanGetCurrentAndPriorFileWrites" in project "WebApplication1.xproj".
1> 1>
1>Target "_CleanRecordFileWrites" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\v-prchep\Documents\Visual Studio 2015\Projects\WebApplication1\src\WebApplication1\WebApplication1.xproj" (target "CoreBuild" depends on it):
1> Task "RemoveDuplicates"
1> Done executing task "RemoveDuplicates".
1> Task "MakeDir"
1> Done executing task "MakeDir".
1> Task "WriteLinesToFile"
1> Done executing task "WriteLinesToFile".
1> 1>
1>Done building target "_CleanRecordFileWrites" in project "WebApplication1.xproj".
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.02
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
在日志后面,我檢查了Microsoft.DNX.targets
文件並找到了這一行
<Error Text="The Dnx Runtime package needs to be installed. See output window for more details." Condition="!Exists('$(RuntimeToolingExe)')" />
似乎它正在嘗試從$(RuntimeToolingExe)
查找dnx
路徑,但是我無法弄清楚它的設置位置。
注意: dnx
運行時已安裝,我可以使用以下命令從命令提示符運行應用程序
dnx web
應用程序與此運行良好。 我相信這是VS2015工具的問題,我無法解決。 您能幫我嗎?
PS:遵循此SO線程中提供的所有步驟,似乎沒有任何效果。
一旦我卸載styleCop ,問題終於解決了。 似乎StyleCop覆蓋了Visual Studio正在尋找的dnx
路徑。 但是,這只是一個猜測,我不確定它為什么起作用!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.