Mac Sft Config Microsoft Visual

Jun 01, 2017  Last month, Microsoft announced the release of Visual Studio for Mac: a full-featured development environment to help developers on the Mac create apps, games, and services for mobile, cloud, and web.

-->

Git is a distributed version control system that allows teams to work on the same documents simultaneously. This means there is a single server that contains all the files, but whenever a repository is checked out from this central source, the entire repository is cloned locally to your machine.

There are many remote hosts that allow you to work with Git for version control, however the most common host is GitHub. The following example uses a GitHub host, but you can use any Git host for version control in Visual Studio for Mac.

If you wish to use GitHub, make sure that you have an account created and configured before following the steps in this article.

Creating a remote repo on GitHub

The following example uses a GitHub host, but you can use any Git host for version control in Visual Studio for Mac.

To set up a Git repository, execute the following steps:

  1. Create a new Git repo at github.com:

  2. Set Repo Name, description, and privacy. Do not initialize Repo. Set .gitignore and license to None:

  3. The next page gives you an option to display and copy either the HTTPS or SSH address to the repo you have created:

    You'll need the HTTPS address to point Visual Studio for Mac to this repo.

Publishing an existing project

If you have an existing project that is not already in version control, use the following steps to set it up in Git:

  1. Select the Solution name from the Solution Pad in Visual Studio for Mac.

  2. In the Menu bar, select Version Control > Publish in Version Control to display the Select Repository dialog:

    If this menu item appears greyed out in the menu, make sure you have selected the Solution name.

  3. Choose the Registered Repositories tab and press the Add button:

  4. Enter the name of the repository as you would like it to display locally, and paste in the URL from step #3. Your Repository Configuration dialog should look similar to the following. Press OK:

    It is also possible to use SSH to connect to Git.

  5. To attempt to publish the app to Git, select the repository, and ensure that both Module Name and Message text fields are completed:

  6. Click Okay, and then Publish from the alert dialog.

  7. In the Git Credentials window, enter your GitHub username and password.

Note

If your account has two-factor authentication (2FA) enabled, you will need to create an Access Token, which is used in place of a password. If you have not created an access token, follow the steps in the Git Access Token documentation.

  1. Enter the username and Personal Access Token, and press Okay:

  2. After a few seconds, the Solution should be published with its initial commit. Confirm it has been published by browsing the Version Control menu item, which should now be populated with many options:

  3. Once you start to make additional changes, select Push Changes to push the changes to the remote repository. This will allow all appropriate users to view it on github.com:

Mac Soft Config Microsoft Visual Software

Publishing a new project

The new project dialog can be used to create a new project with a local git repository. To enable it, select the Use git for version control checkbox, as illustrated in the following screenshot. This will initialize your repo and add an optional .gitignore file:

Follow the steps below to push your new local repository to a new GitHub repository:

Note

If you have not already created a GitHub repository, refer to the Creating a remote repo on GitHub section.

  1. Create your first commit by going to Version Control > Review Solution and Commit in the Menu Bar.

  2. In the Status tab, choose Commit in the top left.

  3. Write a commit message, for example 'First Commit', then click on Commit:

  4. Next, in the Menu Bar go to Version Control > Manage Branches and Remotes.

  5. Go to the Remote Sources tab, then click Add.

  6. In the Remote Source window, add the details of your previously created GitHub repository and click OK:

  7. Close the Git Repository Configuration window, then in the Menu Bar go to Version Control > Push Changes.

  8. In the Push to Repository window click on the Push Changes button:

  9. When prompted, enter your GitHub username and password.

Note

If your account has two-factor authentication (2FA) enabled, you will need to create an Access Token, which is used in place of a password. If you have not created an access token, follow the steps in the Git Access Token documentation.

Visual Studio for Mac will now push the changes to your remote GitHub repository:

Check out an existing repository

It's likely that you'll have to work with a GitHub repo that exists only on the remote, not on your local machine. Visual Studio for Mac allows you to check this repo out quickly. Follow the steps below to clone it to your machine:

  1. In the Menu bar, select Version Control > Checkout:

  2. This displays the Connect to Repository tab:

  3. On the GitHub page of the remote repository, press the Clone or Download button and copy the URL provided:

  4. Replace all the text in the URL entry field in the Connect to Repository tab. This will populate most other fields in this tab for you, as illustrated in the image in step #2.

  5. Enter the directory that you want to clone the repo into and press Checkout.

Note

You may experience issues if the repo is over 4 GB in size.

Troubleshooting

If you have issues with initializing your project with an empty remote repository, you can try the following steps:

  1. Go to your solution folder.
  2. Press Command + Shift + . to show the hidden files and folders.
  3. If there's a .git folder, delete it.
  4. If there's a gitignore file, delete it.
  5. Press Command + Shift + . to hide the files and folders.
  6. Open your solution in VS for Mac.
  7. On the solution Pad, select your solution node.
  8. Browse to the Version Control menu and choose Publish in Version Control.
  9. Follow the steps of the above tutorial starting from the step 6.

See also

-->

You can use this guide to uninstall each component in Visual Studio for Mac individually by navigating to the relevant section, or you can use the scripts provided in the Uninstall Script section to uninstall everything.

Note

This information will only remove Visual Studio 2019 or 2017 for Mac from your machine. to uninstall Visual Studio Code, see this issue for details.

Uninstall Script

There are two scripts that can be used to uninstall Visual Studio for Mac and all components for your machine:

The following sections provide information on downloading and using the scripts.

Visual Studio for Mac and Xamarin script

You can uninstall Visual Studio and Xamarin components in one go by using the uninstall script.

This uninstall script contains most of the commands that you will find in the article. There are three main omissions from the script and are not included due to possible external dependencies. To remove this, jump to the relevant section below and remove them manually:

To run the script, do the following steps:

  1. Right-click on the script and select Save As to save the file on your Mac.

  2. Open Terminal and change the working directory to where the script was downloaded:

  3. Make the script executable and the run it with sudo:

  4. Finally, delete the uninstall script and remove Visual Studio for Mac from the dock (if it's there).

.NET Core script

The uninstall script for .NET Core is located in the dotnet cli repo

To run the script, do the following steps:

Mac Sft Config Microsoft Visual Studio

  1. Right-click on the script and select Save As to save the file on your Mac.

  2. Open Terminal and change the working directory to where the script was downloaded:

  3. Make the script executable and the run it with sudo:

  4. Finally, delete the .NET Core uninstall script.

Uninstall Visual Studio for Mac

The first step in uninstalling Visual Studio from a Mac is to locate Visual Studio.app in the /Applications directory and drag it to the Trash Can. Alternatively, right-click and select Move to Trash as illustrated in the following image:

Deleting this app bundle removes Visual Studio for Mac, even though there may be other files related to Xamarin still on the file system.

To remove all traces of Visual Studio for Mac, run the following commands in Terminal:

You may also want to remove the following directory containing various Xamarin files and folders. However, before you do you should be aware that this directory contains the Android signing keys. For more information refer to the section Uninstalling Android SDK and Java SDK:

Uninstall Mono SDK (MDK)

Mono is an open-source implementation of Microsoft's .NET Framework and is used by all Xamarin Products—Xamarin.iOS, Xamarin.Android, and Xamarin.Mac to allow development of these platforms in C#.

Warning

There are other applications outside of Visual Studio for Mac that also use Mono, such as Unity.Be sure that there are no other dependencies on Mono before uninstalling it.

To remove the Mono Framework from a machine, run the following commands in Terminal:

Uninstall Xamarin.Android

There are a number of items required for the installation and use of Xamarin.Android, such as the Android SDK and Java SDK.

Mac

Use the following commands to remove Xamarin.Android:

Uninstall Android SDK and Java SDK

The Android SDK is required for development of Android applications. To completely remove all parts of the Android SDK, locate the file at ~/Library/Developer/Xamarin/ and move it to Trash.

Warning

You should be aware that Android signing keys that are generated by Visual Studio for Mac are located in ~/Library/Developer/Xamarin/Keystore. Make sure to back these up appropriately, or avoid removing this directory if you wish to keep your keystore.

The Java SDK (JDK) does not need to be uninstalled, as it is already pre-packaged as part of Mac OS X / macOS.

Uninstall Android AVD

Warning

There are other applications outside of Visual Studio for Mac that also use Android AVD and these additional android components, such as Android Studio.Removing this directory may cause projects to break in Android Studio.

Mac Soft Config Microsoft Visual Key

To remove any Android AVDs and additional Android components use the following command:

To remove only the Android AVDs use the following command:

Uninstall Xamarin.iOS

Xamarin.iOS allows iOS application development using C# or F# with Visual Studio for Mac.

Use the following commands in Terminal to remove all Xamarin.iOS files from a file system:

Uninstall Xamarin.Mac

Xamarin.Mac can be removed from your machine using the following two commands to eradicate the product and license from your Mac respectively:

Uninstall Workbooks and Inspector

Starting with 1.2.2, Xamarin Workbooks & Inspector can be uninstalled from a terminal by running:

For older versions, you need to manually remove the following artifacts:

  • Delete the Workbooks app at '/Applications/Xamarin Workbooks.app'
  • Delete the Inspector app at 'Applications/Xamarin Inspector.app'
  • Delete the add-ins: '~/Library/Application Support/XamarinStudio-6.0/LocalInstall/Addins/Xamarin.Interactive' and '~/Library/Application Support/XamarinStudio-6.0/LocalInstall/Addins/Xamarin.Inspector'
  • Delete Inspector and supporting files here: /Library/Frameworks/Xamarin.Interactive.framework and /Library/Frameworks/Xamarin.Inspector.framework

Uninstall the Xamarin Profiler

Uninstall the Visual Studio Installer

Use the following commands to remove all traces of the Xamarin Universal Installer:

Uninstall Visual Studio 2019 for Mac Preview

Visual Studio 2019 for Mac Preview was launched as a separate preview, allowing you to continue to work with your Visual Studio 2017 for Mac install side-by-side.

Mac Soft Config Microsoft Visual Studio

Now that Visual Studio 2019 for Mac has been released, you can now safely remove the Visual Studio 2019 for Mac Preview application.

To uninstall the preview application bundle, select Visual Studio (Preview) from your Applications folder and click Move to Trash, as depicted in the following image:

You can also remove the Preview plist file with the following command:

Mac Soft Config Microsoft Visual Center

See also