title: How can I resolve this build issue? MSBuild Error: MSB4216
body: <p>I'm trying to build a dotnet project, and I don't believe there is anything wrong with the project file. I suspect it is something wrong with my environment. Currently I am using windows 10. Below is the error I received and the project file. I should also mention I am performing this through CLI</p>
  
  <p>Console Output</p>
  
  <pre><code>PS C:\Users\Jon\WowFishingAssist&gt; dotnet build .\WowFishingAssist.sln
  Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Core
  Copyright (C) Microsoft Corporation. All rights reserved.
  
    Nothing to do. None of the projects specified contain packages to restore.
  C:\Program Files\dotnet\sdk\3.1.201\Microsoft.Common.CurrentVersion.targets(3032,5): error MSB4216: Could not run the "GenerateResource" task because MSBuild could not create or connect to a task host with runtime "CLR4" and architecture "x86".  Please ensure that (1) the requested runtime and/or architecture are available on the machine, and (2) that the required executable "C:\Program Files\dotnet\sdk\3.1.201\MSBuild.exe" exists and can be run. [C:\Users\Jon\WowFishingAssist\WowFishingAssist\WowFishingAssist.csproj]
  
  Build FAILED.
  
  C:\Program Files\dotnet\sdk\3.1.201\Microsoft.Common.CurrentVersion.targets(3032,5): error MSB4216: Could not run the "GenerateResource" task because MSBuild could not create or connect to a task host with runtime "CLR4" and architecture "x86".  Please ensure that (1) the requested runtime and/or architecture are available on the machine, and (2) that the required executable "C:\Program Files\dotnet\sdk\3.1.201\MSBuild.exe" exists and can be run. [C:\Users\Jon\WowFishingAssist\WowFishingAssist\WowFishingAssist.csproj]
      0 Warning(s)
      1 Error(s)
  
  Time Elapsed 00:00:02.69
  PS C:\Users\Jon\WowFishingAssist&gt; 
  </code></pre>
  
  <p>csproj file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    &lt;Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /&gt;
    &lt;PropertyGroup&gt;
      &lt;Configuration Condition=" '$(Configuration)' == '' "&gt;Debug&lt;/Configuration&gt;
      &lt;Platform Condition=" '$(Platform)' == '' "&gt;AnyCPU&lt;/Platform&gt;
      &lt;ProjectGuid&gt;{BDE46AC5-715B-4700-AB85-A31D0412507F}&lt;/ProjectGuid&gt;
      &lt;OutputType&gt;WinExe&lt;/OutputType&gt;
      &lt;RootNamespace&gt;WowFishingAssist&lt;/RootNamespace&gt;
      &lt;AssemblyName&gt;WowFishingAssist&lt;/AssemblyName&gt;
      &lt;TargetFrameworkVersion&gt;v4.6.1&lt;/TargetFrameworkVersion&gt;
      &lt;FileAlignment&gt;512&lt;/FileAlignment&gt;
      &lt;AutoGenerateBindingRedirects&gt;true&lt;/AutoGenerateBindingRedirects&gt;
      &lt;Deterministic&gt;true&lt;/Deterministic&gt;
      &lt;PublishUrl&gt;publish\&lt;/PublishUrl&gt;
      &lt;Install&gt;true&lt;/Install&gt;
      &lt;InstallFrom&gt;Disk&lt;/InstallFrom&gt;
      &lt;UpdateEnabled&gt;false&lt;/UpdateEnabled&gt;
      &lt;UpdateMode&gt;Foreground&lt;/UpdateMode&gt;
      &lt;UpdateInterval&gt;7&lt;/UpdateInterval&gt;
      &lt;UpdateIntervalUnits&gt;Days&lt;/UpdateIntervalUnits&gt;
      &lt;UpdatePeriodically&gt;false&lt;/UpdatePeriodically&gt;
      &lt;UpdateRequired&gt;false&lt;/UpdateRequired&gt;
      &lt;MapFileExtensions&gt;true&lt;/MapFileExtensions&gt;
      &lt;ApplicationRevision&gt;0&lt;/ApplicationRevision&gt;
      &lt;ApplicationVersion&gt;1.0.0.%2a&lt;/ApplicationVersion&gt;
      &lt;IsWebBootstrapper&gt;false&lt;/IsWebBootstrapper&gt;
      &lt;UseApplicationTrust&gt;false&lt;/UseApplicationTrust&gt;
      &lt;BootstrapperEnabled&gt;true&lt;/BootstrapperEnabled&gt;
      &lt;DisableOutOfProcTaskHost&gt;true&lt;/DisableOutOfProcTaskHost&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "&gt;
      &lt;DisableOutOfProcTaskHost&gt;true&lt;/DisableOutOfProcTaskHost&gt;
      &lt;PlatformTarget&gt;AnyCPU&lt;/PlatformTarget&gt;
      &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;
      &lt;DebugType&gt;full&lt;/DebugType&gt;
      &lt;Optimize&gt;false&lt;/Optimize&gt;
      &lt;OutputPath&gt;bin\Debug\&lt;/OutputPath&gt;
      &lt;DefineConstants&gt;DEBUG;TRACE&lt;/DefineConstants&gt;
      &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
      &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "&gt;
      &lt;DisableOutOfProcTaskHost&gt;true&lt;/DisableOutOfProcTaskHost&gt;
      &lt;PlatformTarget&gt;AnyCPU&lt;/PlatformTarget&gt;
      &lt;DebugType&gt;pdbonly&lt;/DebugType&gt;
      &lt;Optimize&gt;true&lt;/Optimize&gt;
      &lt;OutputPath&gt;bin\Release\&lt;/OutputPath&gt;
      &lt;DefineConstants&gt;TRACE&lt;/DefineConstants&gt;
      &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
      &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
      &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;
      &lt;AllowUnsafeBlocks&gt;false&lt;/AllowUnsafeBlocks&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup&gt;
      &lt;StartupObject&gt;
      &lt;/StartupObject&gt;
    &lt;/PropertyGroup&gt;
    &lt;ItemGroup&gt;
      &lt;Reference Include="AForge, Version=2.2.5.0, Culture=neutral, PublicKeyToken=c1db6ff4eaa06aeb, processorArchitecture=MSIL"&gt;
        &lt;HintPath&gt;..\packages\AForge.2.2.5\lib\AForge.dll&lt;/HintPath&gt;
      &lt;/Reference&gt;
      &lt;Reference Include="AForge.Imaging, Version=2.2.5.0, Culture=neutral, PublicKeyToken=ba8ddea9676ca48b, processorArchitecture=MSIL"&gt;
        &lt;HintPath&gt;..\packages\AForge.Imaging.2.2.5\lib\AForge.Imaging.dll&lt;/HintPath&gt;
      &lt;/Reference&gt;
      &lt;Reference Include="AForge.Math, Version=2.2.5.0, Culture=neutral, PublicKeyToken=abba2e25397ee8c9, processorArchitecture=MSIL"&gt;
        &lt;HintPath&gt;..\packages\AForge.Math.2.2.5\lib\AForge.Math.dll&lt;/HintPath&gt;
      &lt;/Reference&gt;
      &lt;Reference Include="AForge.Vision, Version=2.2.5.0, Culture=neutral, PublicKeyToken=b612fa915eefaa06, processorArchitecture=MSIL"&gt;
        &lt;HintPath&gt;..\packages\AForge.Vision.2.2.5\lib\AForge.Vision.dll&lt;/HintPath&gt;
      &lt;/Reference&gt;
      &lt;Reference Include="SharpDX, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL"&gt;
        &lt;HintPath&gt;..\packages\SharpDX.4.2.0\lib\net45\SharpDX.dll&lt;/HintPath&gt;
      &lt;/Reference&gt;
      &lt;Reference Include="SharpDX.Direct3D11, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL"&gt;
        &lt;HintPath&gt;..\packages\SharpDX.Direct3D11.4.2.0\lib\net45\SharpDX.Direct3D11.dll&lt;/HintPath&gt;
      &lt;/Reference&gt;
      &lt;Reference Include="SharpDX.DXGI, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL"&gt;
        &lt;HintPath&gt;..\packages\SharpDX.DXGI.4.2.0\lib\net45\SharpDX.DXGI.dll&lt;/HintPath&gt;
      &lt;/Reference&gt;
      &lt;Reference Include="System" /&gt;
      &lt;Reference Include="System.Core" /&gt;
      &lt;Reference Include="System.Xml.Linq" /&gt;
      &lt;Reference Include="System.Data.DataSetExtensions" /&gt;
      &lt;Reference Include="Microsoft.CSharp" /&gt;
      &lt;Reference Include="System.Data" /&gt;
      &lt;Reference Include="System.Deployment" /&gt;
      &lt;Reference Include="System.Drawing" /&gt;
      &lt;Reference Include="System.Net.Http" /&gt;
      &lt;Reference Include="System.Windows.Forms" /&gt;
      &lt;Reference Include="System.Xml" /&gt;
      &lt;Reference Include="WindowsInput, Version=1.0.6.0, Culture=neutral, PublicKeyToken=de2685b4776e9c2e, processorArchitecture=MSIL"&gt;
        &lt;HintPath&gt;..\packages\InputSimulatorPlus.1.0.7\lib\net20\WindowsInput.dll&lt;/HintPath&gt;
      &lt;/Reference&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;Compile Include="DXGIScreenGrab.cs" /&gt;
      &lt;Compile Include="MainForm.cs"&gt;
        &lt;SubType&gt;Form&lt;/SubType&gt;
      &lt;/Compile&gt;
      &lt;Compile Include="MainForm.Designer.cs"&gt;
        &lt;DependentUpon&gt;MainForm.cs&lt;/DependentUpon&gt;
      &lt;/Compile&gt;
      &lt;Compile Include="Program.cs" /&gt;
      &lt;Compile Include="Properties\AssemblyInfo.cs" /&gt;
      &lt;EmbeddedResource Include="MainForm.resx"&gt;
        &lt;DependentUpon&gt;MainForm.cs&lt;/DependentUpon&gt;
      &lt;/EmbeddedResource&gt;
      &lt;EmbeddedResource Include="Properties\Resources.resx"&gt;
        &lt;Generator&gt;ResXFileCodeGenerator&lt;/Generator&gt;
        &lt;LastGenOutput&gt;Resources.Designer.cs&lt;/LastGenOutput&gt;
        &lt;SubType&gt;Designer&lt;/SubType&gt;
      &lt;/EmbeddedResource&gt;
      &lt;Compile Include="Properties\Resources.Designer.cs"&gt;
        &lt;AutoGen&gt;True&lt;/AutoGen&gt;
        &lt;DependentUpon&gt;Resources.resx&lt;/DependentUpon&gt;
        &lt;DesignTime&gt;True&lt;/DesignTime&gt;
      &lt;/Compile&gt;
      &lt;None Include="packages.config" /&gt;
      &lt;None Include="Properties\Settings.settings"&gt;
        &lt;Generator&gt;SettingsSingleFileGenerator&lt;/Generator&gt;
        &lt;LastGenOutput&gt;Settings.Designer.cs&lt;/LastGenOutput&gt;
      &lt;/None&gt;
      &lt;Compile Include="Properties\Settings.Designer.cs"&gt;
        &lt;AutoGen&gt;True&lt;/AutoGen&gt;
        &lt;DependentUpon&gt;Settings.settings&lt;/DependentUpon&gt;
        &lt;DesignTimeSharedInput&gt;True&lt;/DesignTimeSharedInput&gt;
      &lt;/Compile&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;None Include="App.config" /&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;BootstrapperPackage Include=".NETFramework,Version=v4.6.1"&gt;
        &lt;Visible&gt;False&lt;/Visible&gt;
        &lt;ProductName&gt;Microsoft .NET Framework 4.6.1 %28x86 and x64%29&lt;/ProductName&gt;
        &lt;Install&gt;true&lt;/Install&gt;
      &lt;/BootstrapperPackage&gt;
      &lt;BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"&gt;
        &lt;Visible&gt;False&lt;/Visible&gt;
        &lt;ProductName&gt;.NET Framework 3.5 SP1&lt;/ProductName&gt;
        &lt;Install&gt;false&lt;/Install&gt;
      &lt;/BootstrapperPackage&gt;
    &lt;/ItemGroup&gt;
    &lt;Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /&gt;
  &lt;/Project&gt;
  </code></pre>