May 07, 2018 Last year at Build, we launched Visual Studio for Mac, our native macOS IDE for developers building cloud, web, and mobile applications using.NET. Updates have been rolling out at a steady pace ever since, and we’re excited to announce the release of Visual Studio for Mac.
Microsoft today announced the release of Visual Studio 2019 Preview for PC and Mac. Visual Studio 2019 is now faster, more reliable, more productive for individuals and teams, easier to use, and easier to get started with. Some of the new features included in this release are IntelliCode for AI-assisted IntelliSense, expanded refactoring capabilities, smarter debugging and more.
Read about what’s new in Visual Studio 2019 Preview below.
IDE
- Collaborate with others using Visual Studio Live Share, which is installed by default. Additional language support for C++, VB.NET, and Razor gives guests a solution view and sharing of source control diffs.
- Open code you recently worked on or start from one of the most commonly used flows like clone, open, or new project through the new start window.
- Create new projects with an improved search experience and filters using the new list of templates sorted by popularity.
- Have more vertical room for your code and a modernized look and feel through a set of new visual changes in the shell.
- View a sharper version of your IDE regardless of your display configuration and/or scaling, as we have improved support for per monitor awareness.
- Use an improved search capability in Visual Studio for menus, commands, options, and installable components.
- Quickly understand your code file’s ‘health’ with a document indicator. Run and configure through a one-click code cleanup from the indicator.
- Easily manage the preview features you are opted in to with a new Preview Features page in the Options dialog.
- MSBuild and Visual Studio now target .NET Framework 4.7.2 by default.
Performance
- Take control of how solutions load by using Visual Studio’s new performance improvements that affect stepping speed, branch switching speed, and more.
- See solution load progress in the Task Status Center.
- Choose which projects to load on solution open with solution filter files.
- Improve your typing performance by limiting the impact of auxiliary components.
- Toggle the new option to disable restoring of your project hierarchy state and tool window state.
General Debugging
- Search keywords within the Watch, Autos, and Locals windows while debugging to improve your ability to find objects or values.
- View a dropdown of format specifiers in the Watch, Autos, and Locals windows when inspecting data.
- Use a custom visualizer, now compatible with .NET Core.
- Debug very large applications with large numbers of modules and PDBs.
Source Control and Team Explorer
- Temporarily store changes so you can work on another task by using Team explorer’s Git tools support for Git stash.
- Check out the optional extension available on the Visual Studio Market Place, Pull Requests for Visual Studio, that integrates Pull Request reviews into Visual Studio.
- Use the new Azure DevOps work item experience that focuses on developer workflows, including user-specific work item views, creating a branch from a work item, searching for work items with #mentions, and inline editing.
Programming Languages
- Save time when writing C++ and XAML code by using Visual Studio IntelliCode, an optional extension that gives AI-assisted recommendations for your code.
- Learn about the F# language and tools open source contributions that have been incorporated. These changes have stabilized the existing F# feature set.
- Easily add Python virtual and conda environments using the Python Add Environment dialog.
Web Technologies
- Take advantage of the added support for working with .NET Core 3.0 projects.
- Check out CPU profiling of ASP.NET.
- Use snapshot debugger for .NET web apps running on Virtual Machines, Virtual Machine Scale Sets, and Azure Kubernetes Service.
Mobile Development with Xamarin
- Experience improvements to Xamarin.Android initial and incremental build performance.
- Take advantage of enhanced productivity in the Xamarin Android Designer.
- Check out the new property panel for Xamarin.Forms controls.
- Improve performance through the shortened the workload size for Xamarin and improved the Android emulator.
- Use Intellicode with Xamarin.Forms XAML.
Universal Windows Platform (UWP)
- Use the IntelliCode extension with XAML with the help of our added support.
You can download the preview from Microsoft here.
Learn to use Xamarin.Forms to build user interfaces for your Visual Studio Mac extensions.
Introduction
Ever since I commercialised MFractor in June 2017, I've been pulled to the idea of using XAML and Xamarin.Forms to build user interfaces for Visual Studio Mac extensions.
For MFractor, developing tools like the Image Wizard or localisation wizard cost days to weeks of engineering effort. This time-cost makes it prohibitively expensive to develop tools that are UI-centric.
Therefore, there are compelling reasons to use Xamarin.Forms to build Visual Studio Mac extensions:
- XAML is much, much easier to work with than XWT, Visual Studio Macs UI framework. This dramatically lowers the barrier to entry for developing Visual Studio Mac extensions.
- We can use code and can also make use of value converters, triggers and behaviours.
- With a Xamarin.Forms WPF backend available, user interfaces are reusable in both Visual Studio Mac and Visual Studio Windows.
- By using XAML to build MFractors UIs, I can use MFractor to build itself; an awesome process of dogfooding to accelerate product development.
![Visual Studio For Mac Forms Visual Studio For Mac Forms](/uploads/1/2/6/2/126276392/773543669.jpg)
There are huge productivity gains here!
To prove that this technique is valid for production-ready tooling and is not just a toy, we'll be building an image asset browser you can use to visually explore images inside a solution:
So, read on to learn how to use Xamarin.Forms inside Visual Studio Mac to build rich user interfaces for your tooling.
Using Xamarin.Forms Inside Visual Studio Mac
Let's get started!
First things first, you must have version 1.4.2 of the Addin Maker installed into Visual Studio Mac. Based on my many, many failed attempts at getting this to work, AddinMaker v1.4.2 is the one that works.
Next, you'll need to create a new Visual Studio Mac extension that is an SDK style project and references the NuGet MonoDevelop.Addins v0.4.4. I've found that the Xamarin.Forms bootstrapping process does not work in Visual Studio Mac extensions that are not SDK style projects.
If you have an existing extension, you'll need to upgrade your main extensions project to an SDK style project and reference NuGet MonoDevelop.Addins v0.4.4. I've found the best way to do this is to create a new extension project within
- Add Xamarin.Forms and Xamarin.Forms.Platform.GTK nugets to the project.
Next, we need to add Xamarin.Forms into our project.
Add the following packages into your Visual Studio Mac extension:
- Xamarin.Forms.Platform.GTK.
- Initialise Xamarin.Forms, create a startup command to do so.
Before we can build any UIs Now we need to startup Xamarin.Forms
InitXamarinFormsCommand.cs
And then in our
Manifest.addin.xml
we insert our InitXamarinFormsCommand
into the /MonoDevelop/Ide/StartupHandlers
extension point:Manifest.addin.xml
When the IDE opens, the
Run()
method of InitXamarinFormsCommand
will be invoked.In future, Microsoft and the Visual Studio Mac team will need
- Create our Xamarin.Forms user interface.
- ImageAssetBrowserView.xaml: Our XAML view
- ImageAssetBrowserViewModel.cs:
Let's quickly run through what we have here:
- Use native embedding to inject the view and viewmodel into a GTK dialog.
ImageAssetBrowserWindow.cs&
This creates a reusable window
- Show our UI using a command handler in the tools menu.
Lastly, we create a
CommandHandler
to show our user interface:BrowseImageAssetsCommand.cs
And then we expose the
BrowseImageAssetsCommand
through the tools menu:Manifest.addin.xml
Summary
- We need to make an official Visual Studio Mac Xamarin.Forms extension to prevent multiple calls to Forms.Init() and potential assembly version conflicts.
- My