2

In VS2015 running on Windows 10 x64 machine, I am getting below error while trying to build the .net core web project.

The Dnx Runtime package needs to be installed. See output window for more details

Here is the output window log (only relevant portion)

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 ==========

Going behind the log, I checked Microsoft.DNX.targets file and found this line

<Error Text="The Dnx Runtime package needs to be installed. See output window for more details." Condition="!Exists('$(RuntimeToolingExe)')" />

Seems like it is trying to find-out the dnx path from $(RuntimeToolingExe) but I am not able to figure-out where it is being set.

Note: The dnx runtimes are already installed and I am able to run the application from command prompt using following command

dnx web

The application is running fine with this. I believe it is an issue with the VS2015 tooling which I am not able to figure-out. Could you please help me on this?

PS: Followed all the steps provided in this SO thread nothing seems to be working.

Community
  • 1
  • 1
NaveenBhat
  • 3,248
  • 4
  • 35
  • 48

1 Answers1

4

The issue finally resolved once I uninstall styleCop. Seems like the StyleCop was overriding the dnx path which Visual Studio was looking for. However, this is just a guess, I am not particularly sure why it worked!

NaveenBhat
  • 3,248
  • 4
  • 35
  • 48
  • I have been having this same problem as well. I managed to track the issue down to Microsoft.DNX.targets. The RuntimeToolingDirectory should be set to the dnx path and use the version/runtime etc. in global.json to determine the correct runtime. e.g. "%USERPROFILE%\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update2" For some reason with stylecop installed it was just using the version name e.g. "1.0.0-rc1-update2". I've not the slightest clue why, but thank you so much for pointing me at stylecop. Would not have thought of that in a million years. – Mark May 03 '16 at 13:26
  • What I find strange is I only get this condition when I start an *Empty* project. If I select *Web API*, or *Web Application* (which are nearly the same, API has views??) then I get no such error, even with StyleCop installed. Busy installing StyleCop to see if I can get a working *Empty*. ReSharper's StyleCop extension suites me more as it's real time. – ProfK May 08 '16 at 08:14
  • I meant, "Busy UNinstalling StyleCop...". It didn't help. But in my `global.json` it only has the version name: "sdk": { "version": "1.0.0-rc1-update1" } And, I wonder why I'm on `update1` after running update 2 for VS2015 yesterday. – ProfK May 08 '16 at 08:28