-1

Hi I am moving an IOS project from Xamarin.IOS to DontNet6. I am also trying to move the build from an Intel Mac mini to an Apple silicon Mac.

I tried real hard not to install rosetta 2 but I had to give in and install it (but that is another issue), now I can build the project on the Apple silicon using the Visual Studio IDE, but I am trying to get the command line working but when I type MSBuild on the command line It says "zsh: command not found: MSBuild".

what do I need to do in order to get msbuild to work on a Mac ?

Regards Christian Stœr Arild Andersen

Jonathan Dodds
  • 2,654
  • 1
  • 10
  • 14
canderse
  • 299
  • 1
  • 15
  • You have installed Visual Studio for Mac, correct? Was your terminal session running prior to installing Visual Studio for Mac and if so, have you run `rehash` to pick up changes to `PATH`? Or have you started a new shell session? Does your `PATH` include `/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild`? – Jonathan Dodds May 03 '23 at 12:48
  • I can compile from the IDE but I have no path (or directory) /Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild I will try to reinstall and see if that helps but I have my doubts – canderse May 03 '23 at 22:56
  • I just checked the installer and it looks like every thing was installed ok but I chose not to install Xamarin IOS because I want to move to use dotnet6 only from now on. I should still be able to compile from the command line without xamarin ios i would have thourght – canderse May 03 '23 at 23:03
  • Mono.framework and Xamarin.iOS.framework are different. Visual Studio for Mac is based on MonoDevelop (aka Xamarin Studio) and many of the components and tools are still located in the Mono.framework folder. – Jonathan Dodds May 03 '23 at 23:57
  • You are trying to run the command as `msbuild` and not `MSBuild`, right? Case makes a difference on Unix. – Jonathan Dodds May 04 '23 at 00:04
  • I know. I have tried both. I have also tried vstool build – canderse May 04 '23 at 02:23
  • I dont have a mono.framework forlder (or I cant find it). I did not click the check box install the xamarin ios components of (and I managed to do a ide build with out it) – canderse May 04 '23 at 03:58
  • I think I am getting somewhere I am using "dotnet msbuild" command and now it gives me the error "error NETSDK1147: To install these workloads, run the following command: dotnet workload restore" so it is still bad in a better way. the ide showed this error when I first loaded the project and I installed it and it worked but how do I do this from the command Line (oh yes I can feel a nuget for Apple silicone question comming next) – canderse May 04 '23 at 08:22

1 Answers1

0

the command I needed to use is

dotnet publish

that lets me build an IPA file for distribution

canderse
  • 299
  • 1
  • 15