I am trying to compile the source code for HandyControls. The instructions provide two options:
1.) Compile source code. Please confirm that your development environment meets the requirements before compiling.
Visual Studio 2019
.Net greater than or equal to 5.0.100
Open HandyControl.sln and select the specified environment to compile in the Solution Configuration drop-down box:
Debug: Release
HandyControlDemo_Net_GE45 > Framework (netcoreapp 3.0) > netcoreapp3.0
2.) Compile source code with Powershell Go to Build folder and open Powershell here, then execute this command .\build.ps1
My first attempt with Visual Studio 2019 resulted in more than 3,000 errors. After some research, I determined that 60% of the errors were due to C# 10: File-scoped namespaces, but I was using VS 2019ce, so I switched to VS 2022ce. This reduced the errors down to 3:
2>C:\Program Files\dotnet\sdk\7.0.305\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(376,5):
error NETSDK1073: The FrameworkReference 'Microsoft.NETCore.App' was not recognized
2>C:\Program Files\dotnet\sdk\7.0.305\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(376,5):
error NETSDK1073: The FrameworkReference 'Microsoft.WindowsDesktop.App.WPF' was not recognized
2>C:\Program Files\dotnet\sdk\7.0.305\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(376,5): error NETSDK1073:
The FrameworkReference 'Microsoft.WindowsDesktop.App' was not recognized
The Microsoft documentation for the error, NETSDK1073, is located here and reads as follows: This error typically means there is a version of a particular FrameworkReference that the SDK cannot find. Try deleting your obj and bin folders and running dotnet restore to redownload the latest targeting packs.
I found the following associated StackOverflow article that attempts to address the issue: NETSDK1073: The FrameworkReference 'Microsoft.AspNetCore.App' was not recognized
I tried all of the suggestions, leading to no resolution.
Along the way I have downloaded the runtime and sdk for .NET 7.0, 5.0 and .NET Core 3.0.
I added Microsoft.WindowsDesktop.App.WPF as a dependency in the Class Library.
I have exhausted all avenues that I could think of an would appreciated any assistance that anyone would be able to provide. Thanks.
With the help of "mm8" (see comments), I was able to resolve the problem. For anyone wishing to compile the source code here are my notes:
Make sure that you have installed the .NET desktop development workload in Visual Studio 2022.
Select which version you want to download. The original version named HandyControl is located here. The modified version named HandyControls (note the plural) that contains additional controls is located here.
Once you have downloaded the code, right click on the folder, select properties, check "Unblock", click "Apply" then click "Ok".
Using VS 2022 open the solution.
Change "Debug" to "Release". In the solution explorer window, Right-Click on "HandyControlDemo_Net_GE45". Click "Set as the Startup Project". Return to the tool-bar and select the dropdown arrow to the right of the second "HandyControlDemo_Net_GE45". Select "Framework (netcoreapp3.0)". Look to the left and make certain "netcoreapp3.0" is checked.
Bring up "Developer PowerShell for VS 2022". (I opened it as Admin, not certain if this is needed). Use the Set_Location Powershell command to set the path of the "build" folder.
Example: Set-Location -Path "C:\PS\WPF HandyControls\HandyControls-develop\build"
Key in the name of the Powershell Build Script and press enter: .\build.ps1
When the application comes up the default language is Chinese. You can change the language by clicking on the settings icon in the upper-top-right corner and select the flag of your choice.
I hope this helps someone, happy coding!