This repository has been archived by the owner on May 1, 2024. It is now read-only.
How to make "dotnet build" work on Mac with VS 2022 17.3? #15587
Unanswered
kasimier-vireq
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is "dotnet build" on a Mac working for someone out there?
I have VS 2022 for Mac (version 17.3) installed (latest as of today).
I get the following error when trying to build the iOS project:
"error MSB4019: The imported project "/usr/local/share/dotnet/sdk/6.0.402/iOS/Xamarin.iOS.CSharp.targets" was not found. Confirm that the expression in the Import declaration "/usr/local/share/dotnet/sdk/6.0.402//iOS/Xamarin.iOS.CSharp.targets" is correct, and that the file exists on disk."
On my Mac, the file "Xamarin.iOS.CSharp.targets" is located only here:
"/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/msbuild/iOS/Xamarin.iOS.CSharp.targets"
Since the import in the csproj (comes with the project template) has a relative path which will never resolve to the existing file, I changed
Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets"
to
Import Project="$(MSBuildExtensionsPath)\iOS\Xamarin.iOS.CSharp.targets"
and added "/p:MSBuildExtensionsPath=/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/msbuild" to the dotnet build console command.
The build is now finding the targets file.
But now I'm getting the following error further down the line and can't figure out how to proceed further.
"error : Invalid restore input. Missing required property 'OutputPath' for project type 'PackageReference'."
Any hints out there?
(Side note: dotnet build works fine on Windows for Android projects (VS 2022 17.4.0 Preview 4.0). Although I had to provide custom file paths as well.)
Beta Was this translation helpful? Give feedback.
All reactions