Unable to build IdentityServer4 on Windows 10 machine

1k Views Asked by At

I am getting the error message "exited with code -532462766" when I attempt to build IdentityServer4. The error appears to be happening inside the "MinVer" Nuget package.

I downloaded the IdentityServer4 zip file onto a Windows 10 machine from the github site at https://github.com/IdentityServer/IdentityServer4 and unzipped it into a local directory, then followed the directions, which are:

  1. Download the latest .Net Core SDK. I already had the latest sdk installed, but after getting the errors in the "MinVer" nuget package (see below) I decided to download a couple of older version as well. My C:\Program Files\dotnet folder contains the following sub-folders in the "sdk" folder:

    • 2.1.202
    • 2.1.803
    • 2.2.108
    • 3.0.101
    • 3.1.100
    • 3.1.101
  2. Run build.ps1 in the root directory. Build.ps1 does a nuget restore and then executes 5 other build files, this is the contents:

$ErrorActionPreference = "Stop";

New-Item -ItemType Directory -Force -Path ./nuget

dotnet tool restore

pushd ./src/Storage
./build.ps1 $args
popd

pushd ./src/IdentityServer4
./build.ps1 $args
popd

pushd ./src/EntityFramework.Storage
./build.ps1 $args
popd

pushd ./src/EntityFramework
./build.ps1 $args
popd

pushd ./src/AspNetIdentity
./build.ps1 $args
popd

When I run build.ps1 I see that "dotnet tool restore" succeeds in updating all nuget packages.

I then get the same "exited with code -532462766" error message for all 5 build.ps1 commands, here is one of the error messages:

C:\Users\tregan.nuget\packages\minver\2.0.0\build\MinVer.targets(39,5): error MSB3073: The command "dotnet "C:\Users\tregan.nuget\packages\minver\2.0.0\build../minver/MinVer.dll" --auto-increment "" --build-metadata "" --default-pre-release-phase "" --minimum-major-minor "" --repo "C:\Repo\Core\IdentityServer4-master\src\Storage\build" --tag-prefix "" --verbosity "" --version-override """ exited with code -532462766. [C:\Repo\Core\IdentityServer4-master\src\Storage\build\build.csproj]

I have verified that the paths it is looking for all exist (C:\Users\tregan.nuget\packages\minver\2.0.0\build, C:\Repo\Core\IdentityServer4-master\src\Storage\build\build.csproj).

Extracting from the error message, it appears this command is failing:

dotnet "C:\Users\tregan.nuget\packages\minver\2.0.0\build../minver/MinVer.dll"

The error message complains about the file MinVer.Targets, line 39. That points to the following section of the file, which is obviously responsible for creating the command that is failing to execute:

    <Exec Command="dotnet &quot;$(MSBuildThisFileDirectory)../minver/MinVer.dll&quot; @(MinVerInputs->'%(Identity)', ' ')" ConsoleToMSBuild="true" StandardOutputImportance="Low" >
  <Output TaskParameter="ConsoleOutput" ItemName="MinVerConsoleOutput" />
</Exec>
1

There are 1 best solutions below

1
On BEST ANSWER

This failed because Git was not installed on my machine.

I discovered this by running the command that build.ps1 was trying to execute in a command prompt:

dotnet "C:\Users\tregan.nuget\packages\minver\2.0.0\build../minver/MinVer.dll"

This gave me the error message that the command failed because Git is not installed. Since I have Choclately installed, I just had to run this from a command prompt running as administrator:

choco install git

You may need to refresh your enviornment variables (and close/reopen Visual Studio if that's what you're using):

refreshenv