ASP.NET, visual studio won't build

1

I'm an absolute beginner in asp.net and I want to follow this Microsoft tutorial.

Problem is, right at the beginning, just after I have created my project, and try to "build without debugging", an error appears that says to me that build errors have been encountered.

The output display this message :

1>------ Build started: Project: RazorPagesMovie, Configuration: Debug Any CPU ------
1>Failed to load the dll from [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.11\hostpolicy.dll], HRESULT: 0x800700C1
1>An error occurred while loading required library hostpolicy.dll from [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.11]
1>C:\Users\Owner\.nuget\packages\microsoft.aspnetcore.razor.design\2.2.0\build\netstandard2.0\Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets(79,5): error : rzc discover exited with code -2147450750.
1>Done building project "RazorPagesMovie.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

The error list says in the description column : "rzc discover exited with code -2147450750" and in the file column : "Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets"

Has anyone any idea about what it's about and how to fix it ?

Again I'm not at ease with Visual Studio and .net stuff so if you're so kind to try and help me, please dumb it down as much as possible.

asp.net
visual-studio-2019
asked on Super User May 18, 2019 by Michelignax • edited May 19, 2019 by DavidPostill

2 Answers

0

Strangely, as it can be seen in the output, VS was going into the "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.11" folder. It seems to me that it is the 64-bit Program Files folder, and I don't know why I had a "dotnet" folder located in this directory with the SDK.

After uninstalling Visual Studio, when trying to reinstall, I've seen to my surprise that the SDK folder (grayed out) was the one in the "Program Files" folder (and not the "Program Files(x86)" folder). So I uninstalled all SDK, x86 and x64, and reinstalled Visual Studio then only the x86 .Net Core 2.2 SDK, and this seems to have solved my problem.

answered on Super User May 19, 2019 by Michelignax • edited Oct 24, 2019 by Ramhound
0

In my case I solved this error: "rzc discover exited with code 1.", by turning of "Real-time protection" in in Windows Security. I exclude "dotnet.exe" from "Windows Defender Antivirus" scan and/or allow it through "Controlled folder access".

answered on Super User Oct 24, 2019 by Stanislav Prusac

User contributions licensed under CC BY-SA 3.0