Skip to content

FAQ | Visual Studio for Mac

Matthew Leibowitz edited this page Mar 19, 2019 · 2 revisions

Because Visual Studio for Mac does not yet support building multi-targeted projects, you have to make use of the command line.

This, however, is just for building the core library, as the samples still work in the IDE because they are not multi-targeted projects.

Working on the library

To make changes to the library, open the Xamarin.Essentials.sln in the IDE as you would normally do. Once the IDE has finished restoring packages, you can switch to the command line and trigger a full build:

$ msbuild /restore Xamarin.Essentials/Xamarin.Essentials.csproj

If you try build directly from the IDE before running the build, you will get an error:
Error CS0006: Metadata file 'bin/Debug/netstandard2.0/Xamarin.Essentials.dll' could not be found.
This is because the IDE can only build the first target, which is .NET Standard 1.0.

As you work on the library, you will have to build using the same command line. This will ensure that you are building everything that you expect.

Working on the samples

Once you have made changes to the library and now want to make changes to the samples or tests, you can just run the build from the IDE and deploy the app to devices.

Make sure the correct sample app is set as the startup project, and then click run.

Before you try and run the samples, you need to make sure the library is built by following the directions above. This is only needed once.