aspdotnet core project build fail on new machin

1

Hi I am facing a strange problem,

I have create a asp.net core 2.1 web project, it works/build fine on my machine.

Then I have zipped the project folder with .sln file and moved it to new machin, this also have visual studio 2017, .net core 2.1(it is a VM).

I open the project and when build I get:

Error rzc generate exited with code -2147450750. DEVPROJECT_1 C:\Users\abc.nuget\packages\microsoft.aspnetcore.razor.design\2.1.1\build\netstandard2.0\Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets 121

I have even checked the dependency version and they are the same. Both machine are win 7 service pack 1(machine where it works is 64 bit and new machine or vm is 32 bit OS).

Need some way to solve this.

enter image description here

[UPDATE 1:]

Hi I did he clean build as suggested but same issue

: ------ Rebuild All started: Project: DEVPROJECT_1 , Configuration: Debug Any CPU ------ Failed to load the dll from [C:\Program Files\dotnet\host\fxr\2.1.3\hostfxr.dll], HRESULT: 0x80070057 The library hostfxr.dll was found, but loading it from C:\Program Files\dotnet\host\fxr\2.1.3\hostfxr.dll failed - Installing .NET Core prerequisites might help resolve this problem. http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409 C:\Users\dev.nuget\packages\microsoft.aspnetcore.razor.design\2.1.1\build\netstandard2.0\Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets(69,5): error : rzc discover exited with code -2147450750. Done building project "DEVPROJECT_1 .csproj" -- FAILED. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

but when I double click it it redirect me to razor config file and points to this line:

<RazorGenerate
  Debug="$(_RazorDebugGenerateCodeTask)"
  DebugTool="$(_RazorDebugGenerateCodeTool)"
  ToolAssembly="$(_RazorToolAssembly)"
  UseServer="$(UseRazorBuildServer)"
  ForceServer="$(_RazorForceBuildServer)"
  SuppressCurrentUserOnlyPipeOptions="$(_RazorSuppressCurrentUserOnlyPipeOptions)"
  PipeName="$(_RazorBuildServerPipeName)"
  Version="$(RazorLangVersion)"
  Configuration="@(ResolvedRazorConfiguration)"
  Extensions="@(ResolvedRazorExtension)"
  Sources="@(RazorGenerateWithTargetPath)"
  ProjectRoot="$(MSBuildProjectDirectory)"
  TagHelperManifest="$(_RazorTagHelperOutputCache)" />
.net-core
visual-studio-2017
nuget-package
asp.net-core-2.1
asked on Stack Overflow Sep 9, 2018 by user614946 • edited Sep 10, 2018 by user614946

3 Answers

0

This is odd. Could be caching foul play.

  1. Close the Visual Studio
  2. Try to get rid of all .vs (hidden), bin and obj folders in your solution
  3. Start empty visual studio (don't open the solution yet!)
  4. Go to Tools > NuGet Package Manager > Package Manager Settings > Clear All NuGet Cache(s)
  5. Open your solution, let it restore all NuGet and rebuild
answered on Stack Overflow Sep 9, 2018 by Xeevis
0

After some helpful pointers the issue was that "KB2533623" was not installed on the machine, after that it worked.

answered on Stack Overflow Sep 11, 2018 by user614946
0

I got this issue after upgrading dotnet SDK to 3.0.

I resolved it by adding a global.json file and setting SDK to 2.1.504

msdn page: https://docs.microsoft.com/en-us/dotnet/core/versions/selection

answered on Stack Overflow Nov 28, 2019 by Raj Kamal

User contributions licensed under CC BY-SA 3.0