Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build.cake: make sure to use the last MSBuild version
Somehow, cake was defaulting to use the old MSBuild (whole path being `C:/windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe`) instead of the one in the VS2019 folder (which should be in `%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe` but is better to be located via vswhere). This fixes many build problems happening in the GitHubActions VM: ``` "D:\a\ZXing.Net.Xamarin\ZXing.Net.Xamarin\ZXing.Net.Mobile.sln" (Build target) (1) -> "D:\a\ZXing.Net.Xamarin\ZXing.Net.Xamarin\Source\ZXing.Net.Mobile.Android\ZXing.Net.Mobile.Android.csproj" (default target) (5) -> D:\a\ZXing.Net.Xamarin\ZXing.Net.Xamarin\Source\ZXing.Net.Mobile.Android\ZXing.Net.Mobile.Android.csproj(82,60): error MSB4066: The attribute "Version" in element <PackageReference> is unrecognized. "D:\a\ZXing.Net.Xamarin\ZXing.Net.Xamarin\ZXing.Net.Mobile.sln" (Build target) (1) -> "D:\a\ZXing.Net.Xamarin\ZXing.Net.Xamarin\Source\ZXing.Net.Mobile.iOS\ZXing.Net.Mobile.iOS.csproj" (default target) (6) -> D:\a\ZXing.Net.Xamarin\ZXing.Net.Xamarin\Source\ZXing.Net.Mobile.iOS\ZXing.Net.Mobile.iOS.csproj(72,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. "D:\a\ZXing.Net.Xamarin\ZXing.Net.Xamarin\ZXing.Net.Mobile.sln" (Build target) (1) -> "D:\a\ZXing.Net.Xamarin\ZXing.Net.Xamarin\Source\ZXing.Net.Mobile.WindowsUniversal\ZXing.Net.Mobile.WindowsUniversal.csproj" (default target) (7) -> D:\a\ZXing.Net.Xamarin\ZXing.Net.Xamarin\Source\ZXing.Net.Mobile.WindowsUniversal\ZXing.Net.Mobile.WindowsUniversal.csproj(155,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v11.0\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. ``` Solution taken from https://stackoverflow.com/a/45251462/544947 Hint taken from https://stackoverflow.com/a/55269143/544947
- Loading branch information