{"id":230225,"date":"2020-08-05T11:55:43","date_gmt":"2020-08-05T18:55:43","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=230225"},"modified":"2020-11-04T14:21:42","modified_gmt":"2020-11-04T22:21:42","slug":"visual-studio-2019-for-mac-version-8-7-is-now-available","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/visual-studio-2019-for-mac-version-8-7-is-now-available\/","title":{"rendered":"Visual Studio 2019 for Mac version 8.7 is now available"},"content":{"rendered":"<p>Visual Studio 2019 for Mac version 8.7 is available today and includes support for gRPC \/ OpenAPI client generation and improved unit testing integration. Additionally, it includes several improvements for Xamarin developers, including Xamarin.Forms 4.8 Support. This release also includes initial support for macOS Big Sur, with the exception of Xamarin support. macOS Big Sur support for Xamarin is expected in one of the first servicing releases for Visual Studio for Mac 8.7.<\/p>\n<p><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/visualstudio.microsoft.com\/vs\/mac\/\" target=\"_blank\">Download Visual Studio for Mac<\/a><\/div><\/p>\n<p>Are you ready for the latest version of Visual Studio 2019 for Mac? If so, version 8.7 is available for you to <a href=\"https:\/\/visualstudio.microsoft.com\/vs\/mac\/\">download today<\/a>! With this release, we\u2019ve continued to polish the existing experience, paying close attention to many of the problem areas mentioned by our users.<\/p>\n<h2>gRPC and OpenAPI Client Generation<\/h2>\n<p>Visual Studio for Mac now includes support for generating an API client from an OpenAPI or gRPC service. This allows you to generate the client from a local file or URL, manage service references, and regenerate the client code if the service changes.<\/p>\n<p>To add a new reference to an OpenAPI or gRPC service, right-click on the Connected Services node in the Solution pad and select Open Service Gallery.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-230226\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/word-image.png\" alt=\"Visual Studio for Mac screenshot showing the new Connected Services node in the Solution Pad\" width=\"465\" height=\"523\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/word-image.png 465w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/word-image-267x300.png 267w\" sizes=\"(max-width: 465px) 100vw, 465px\" \/><\/p>\n<p>Once you\u2019ve opened the Connected Services Gallery, you have the option to add either an OpenAPI or gRPC reference.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-230227\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/word-image-1.png\" alt=\"Screenshot showing the Connected Services Gallery in Visual Studio for Mac\" width=\"1102\" height=\"494\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/word-image-1.png 1102w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/word-image-1-300x134.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/word-image-1-1024x459.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/word-image-1-768x344.png 768w\" sizes=\"(max-width: 1102px) 100vw, 1102px\" \/><\/p>\n<p>Clicking on either of the options will launch a prompt allowing you to enter the service reference, either by file path or URL.<\/p>\n<p>You can also select whether to generate the following client class types when generating a gRPC client:<\/p>\n<ul>\n<li>Client<\/li>\n<li>Server<\/li>\n<li>Client and Server<\/li>\n<li>Messages Only (used to generate strongly typed classes based on message properties, with no generated server or client code)<\/li>\n<\/ul>\n<p>When generating an OpenAPI client, you can specify the namespace and <a href=\"https:\/\/docs.microsoft.com\/en-us\/aspnet\/core\/web-api\/microsoft.dotnet-openapi#add-url\">additional options<\/a> which are passed through to the code generator. Code generation is based on the <a href=\"https:\/\/docs.microsoft.com\/aspnet\/core\/grpc\/dotnet-grpc\">dotnet-grpc<\/a> and <a href=\"https:\/\/docs.microsoft.com\/aspnet\/core\/web-api\/microsoft.dotnet-openapi\">dotnet-openapi<\/a> command-line tools.<\/p>\n<p>After generating a service reference, you can view and modify it in the Connected Services Gallery as shown below.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-230228\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/word-image-2.png\" alt=\"Screenshot showing an added gRPC service in the Connected Services Gallery\" width=\"824\" height=\"580\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/word-image-2.png 824w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/word-image-2-300x211.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/word-image-2-768x541.png 768w\" sizes=\"(max-width: 824px) 100vw, 824px\" \/><\/p>\n<p>For more information on using a generated OpenAPI client, see the <a href=\"https:\/\/docs.microsoft.com\/en-us\/aspnet\/core\/tutorials\/getting-started-with-nswag#code-generation\">Getting Started with NSwag<\/a> tutorial.<\/p>\n<p>For more information on using a generated gRPC client, see the <a href=\"https:\/\/docs.microsoft.com\/en-us\/aspnet\/core\/tutorials\/grpc\/grpc-start?tabs=visual-studio-mac\">Create a gRPC client and server in ASP.NET Core<\/a> tutorial.<\/p>\n<h2>Right-Click to Run Unit Tests<\/h2>\n<p>When editing a C# class that contains unit tests, a developer can run tests using the \u201cRun Test(s)\u201d item in a context menu by right clicking in the file, the body of a test class, or the body of a test method. The context menu for the editor has been updated to include Run\/Debug Test options:<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-230229\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/a-screenshot-of-a-cell-phone-description-automati.png\" alt=\"Screenshot of Visual Studio for Mac showing the Run Tests and Debug Tests options in the code editor context menu\" width=\"495\" height=\"533\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/a-screenshot-of-a-cell-phone-description-automati.png 495w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/a-screenshot-of-a-cell-phone-description-automati-279x300.png 279w\" sizes=\"(max-width: 495px) 100vw, 495px\" \/><\/p>\n<p>These new commands can be run using the following keyboard shortcuts (in the Visual Studio for Mac key bindings):<\/p>\n<ul>\n<li>Run Test(s): \u2318T<\/li>\n<li>Debug Test(s): \u2318\u2325T<\/li>\n<\/ul>\n<p>The Run command will run tests based on the rules below, in the \u201cRules for determining which tests to run\u201d section. Running a test is the same as selecting it in the Unit Test pad and running that test.<\/p>\n<p>The Debug command will run tests the same as described above but will also attach the debugger when running the tests. You can customize these key bindings in the Visual Studio for Mac preferences (<strong>Visual Studio<\/strong> &gt; <strong>Preferences<\/strong> &gt; <strong>Environment<\/strong> &gt; <strong>Key Bindings<\/strong>) as explained in the <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/mac\/customizing-the-ide?view=vsmac-2019&quot; \\l &quot;key-bindings\">documentation<\/a>.<\/p>\n<h2>Rules for determining which tests to run<\/h2>\n<p>The Run\/Debug Test(s) commands will run one or more tests, based on the following rules.<\/p>\n<ul>\n<li>Run all tests in a file by right-clicking in the body of a file with test methods, and choose Run Tests.<\/li>\n<li>Run a single test by right-clicking in a test method, or on the method signature, and choose Run Test.<\/li>\n<li>Run all tests in a single class by right clicking in the body of a class definition, or the method signature, and choose Run Tests.<\/li>\n<\/ul>\n<p>As an example, using the code below\u2026<\/p>\n<pre class=\"prettyprint\">using Microsoft.VisualStudio.TestTools.UnitTesting;\r\n\r\nnamespace GardenTracker.Test\r\n{\r\n    [TestClass]\r\n    public class UnitTest1\r\n    {\r\n        [TestMethod]\r\n        public void TestMethod1()\r\n        {\r\n        }\r\n\r\n        [TestMethod]\r\n        public void TestMethod2()\r\n        {\r\n            Assert.IsTrue(true);\r\n        }\r\n    }\r\n\r\n    [TestClass]\r\n    public class UnitTest2\r\n    {\r\n        [TestMethod]\r\n        public void TestMethod3()\r\n        {\r\n            Assert.IsTrue(true);\r\n        }\r\n    }\r\n}<\/pre>\n<p>Here&#8217;s what happens when you right-click in different places:<\/p>\n<ul>\n<li>When you right-click inside a test method (e.g. inside <code>TestMethod1()<\/code>), just that test is executed.<\/li>\n<li>When you right-click inside a test class but not in a specific test method (e.g. directly on the <code>UnitTest1<\/code> class), all tests in that class are executed.<\/li>\n<li>When you right-click outside of a class, all tests in that file are executed.<\/li>\n<\/ul>\n<h2>Right-click in the solution pad to run tests<\/h2>\n<p>From the solution pad, a .cs file can be right-clicked and Run\/Debug Tests commands used to run or debug all the tests in the file.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-230230\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/a-screenshot-of-a-cell-phone-description-automati-1.png\" alt=\"Screenshot showing the Run Tests and Debug Tests options when right-clicking on a test class in the Solution Pad\" width=\"372\" height=\"488\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/a-screenshot-of-a-cell-phone-description-automati-1.png 372w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/a-screenshot-of-a-cell-phone-description-automati-1-229x300.png 229w\" sizes=\"(max-width: 372px) 100vw, 372px\" \/><\/p>\n<h2>Configuring Keybindings<\/h2>\n<p><img decoding=\"async\" class=\"alignnone wp-image-230231\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/a-screenshot-of-a-cell-phone-description-automati-2.png\" alt=\"Screenshot showing Key Bindings configuration in Visual Studio for Mac\" width=\"587\" height=\"326\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/a-screenshot-of-a-cell-phone-description-automati-2.png 587w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/a-screenshot-of-a-cell-phone-description-automati-2-300x167.png 300w\" sizes=\"(max-width: 587px) 100vw, 587px\" \/><\/p>\n<p>When customizing the keyboard shortcuts for the new test commands, the description field reads as follows:<\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Debug Test(s)<\/td>\n<td>Debug tests based on where your cursor is in the code editor.<\/td>\n<\/tr>\n<tr>\n<td>Run Test(s)<\/td>\n<td>Run tests based on where your cursor is in the code editor.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2>Smarter integration with Unity<\/h2>\n<p>This release includes more Unity-specific diagnostics to help you catch problematic code sooner. We&#8217;ve added these new diagnostics which also include suggested code fixes that you can apply automatically:<\/p>\n<ul>\n<li>Detect incorrect method signature with <code>InitializeOnLoadMethod<\/code> or <code>RuntimeInitializeOnLoadMethod<\/code> attribute.<\/li>\n<li>Using <code>Invoke<\/code>, <code>InvokeRepeating<\/code>, <code>StartCoroutine<\/code> or <code>StopCoroutine<\/code> with a first argument being a string literal is not type safe.<\/li>\n<li>SetPixels invocation is slow.<\/li>\n<\/ul>\n<p>If you have an idea for how Visual Studio for Mac can provide even better diagnostic best practices and suggestions for Unity projects, visit our <a href=\"https:\/\/github.com\/microsoft\/Microsoft.Unity.Analyzers\">open source project on GitHub<\/a> and make a suggestion.<\/p>\n<h2>Xamarin Forms 4.8<\/h2>\n<p>This release of Visual Studio for Mac includes additional support for Xamarin Forms 4.8. This update to Xamarin.Forms is primarily focused on stabilizing current features, moving experimental features to stable, and delivering Gradient Brush support.<\/p>\n<p>Here\u2019s a quick walkthrough showing how you can try out the new Gradient Brush:<\/p>\n<ol>\n<li>First, update the Xamarin.Forms NuGet packages in your solution to version 4.8.<\/li>\n<li>Brushes are an experimental preview. First add the flag to your App.xaml.cs at the top of the constructor:\n<pre>Device.SetFlags(new string[]{ \"Brush_Experimental\" });<\/pre>\n<\/li>\n<li>You can now apply a GradientBrush using the new Background property of any Page, Layout, or View:<\/li>\n<\/ol>\n<pre class=\"prettyprint\">&lt;StackLayout Orientation=\"Vertical\" Padding=\"30,24,30,24\" Spacing=\"10\"&gt;\r\n    &lt;StackLayout.Background&gt;\r\n        &lt;LinearGradientBrush StartPoint=\"0,0\" EndPoint=\"1,1\"&gt;\r\n            &lt;GradientStop Color=\"#59CEFF\" Offset=\"0.0\" \/&gt;\r\n            &lt;GradientStop Color=\"#FB6EEE\" Offset=\"1.0\" \/&gt;\r\n        &lt;\/LinearGradientBrush&gt;\r\n    &lt;\/StackLayout.Background&gt;\r\n&lt;\/StackLayout&gt;\r\n<\/pre>\n<p><img decoding=\"async\" class=\"alignleft wp-image-230244 size-full\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/Screen-Shot-2020-08-05-at-11.46.13-AM.png\" alt=\"Visual Studio for Mac screenshot showing the Xamarin Forms 4.8 Gradient Brush editing experience\" width=\"1883\" height=\"889\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/Screen-Shot-2020-08-05-at-11.46.13-AM.png 1883w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/Screen-Shot-2020-08-05-at-11.46.13-AM-300x142.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/Screen-Shot-2020-08-05-at-11.46.13-AM-1024x483.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/Screen-Shot-2020-08-05-at-11.46.13-AM-768x363.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/Screen-Shot-2020-08-05-at-11.46.13-AM-1536x725.png 1536w\" sizes=\"(max-width: 1883px) 100vw, 1883px\" \/><\/p>\n<h2>Quick Actions and Refactorings<\/h2>\n<p>Visual Studio for Mac 8.7 introduces several useful new actions to Quick Actions and Refactorings:<\/p>\n<ul>\n<li>Generate comparison operators for types that implement <code>IComparable<\/code><\/li>\n<li>Generate <code>IEquatable<\/code> operators when generating .Equals for structs<\/li>\n<li>Create and initialize properties or fields for all unused constructor parameters<\/li>\n<li>IntelliSense completion in <code>DateTime<\/code> and <code>TimeSpan<\/code> string literals<\/li>\n<li>Warning and code fix when a suppression operator is present but has no effect<\/li>\n<li>Generate properties when generating a constructor in a type<\/li>\n<\/ul>\n<p>While these are all handy, I especially like the IntelliSense completions for <code>DateTime<\/code> and <code>TimeSpan<\/code> string literals:<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-230232\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/a-screenshot-of-a-cell-phone-description-automati-3.png\" alt=\"Screenshot of Visual Studio for Mac showing IntelliSense completion for DateTime literals\" width=\"1036\" height=\"492\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/a-screenshot-of-a-cell-phone-description-automati-3.png 1036w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/a-screenshot-of-a-cell-phone-description-automati-3-300x142.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/a-screenshot-of-a-cell-phone-description-automati-3-1024x486.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/08\/a-screenshot-of-a-cell-phone-description-automati-3-768x365.png 768w\" sizes=\"(max-width: 1036px) 100vw, 1036px\" \/><\/p>\n<h2>Keep sending us your feedback!<\/h2>\n<p>We\u2019ve been working hard to address issues our users encounter in Visual Studio for Mac in their average day. As part of our efforts on improving the overall experience, we\u2019ve released a handful of new changes that address some of the top reported issues, with highest priority given to unhealthy (crashing and hanging) sessions. Your bug reports are very important to us as we continue to improve the product \u2013 please keep those <a href=\"https:\/\/aka.ms\/vsmac-suggestion\">suggestions<\/a> and <a href=\"https:\/\/docs.microsoft.com\/visualstudio\/mac\/report-a-problem\">problem reports<\/a> coming!<\/p>\n<h2>Update to the latest today<\/h2>\n<p>We hope you enjoy Visual Studio 2019 for Mac 8.7 as much as we enjoyed working on it. To update to this version, you can download the installer from the <a href=\"https:\/\/visualstudio.microsoft.com\/vs\/mac\/\">Visual Studio for Mac website<\/a> or <a href=\"https:\/\/docs.microsoft.com\/visualstudio\/mac\/update?view=vsmac-2019\">use the in-product updater<\/a> to update an existing installation.<\/p>\n<p>If you have any feedback on this, or any version of Visual Studio for Mac, please leave it in the comments below this post or reach out to us on Twitter at <a href=\"https:\/\/twitter.com\/VisualStudioMac\">@VisualStudioMac<\/a>. If you run into any issues while using Visual Studio for Mac, you can use <a href=\"https:\/\/docs.microsoft.com\/visualstudio\/mac\/report-a-problem?view=vsmac-2019\">Report a Problem<\/a> to notify the team. In addition to reports on issues in the product, we\u2019d also appreciate hearing from you on what\u2019s important to you via <a href=\"https:\/\/aka.ms\/vsmac-suggestion\">feature suggestions<\/a> on the <a href=\"https:\/\/aka.ms\/feedback\/vsm-home\">Visual Studio Developer Community website<\/a>.<\/p>\n<p><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/visualstudio.microsoft.com\/vs\/mac\/\" target=\"_blank\">Download Visual Studio for Mac<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Visual Studio 2019 for Mac version 8.7 is available today and includes support for gRPC \/ OpenAPI client generation and improved unit testing integration. Additionally, it includes several improvements for Xamarin developers, including Xamarin.Forms 4.8 Support. This release also includes initial support for macOS Big Sur, with the exception of Xamarin support. macOS Big Sur [&hellip;]<\/p>\n","protected":false},"author":470,"featured_media":226537,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[155],"tags":[3743,452],"class_list":["post-230225","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio","tag-visual-studio-2019-for-mac","tag-visual-studio-for-mac"],"acf":[],"blog_post_summary":"<p>Visual Studio 2019 for Mac version 8.7 is available today and includes support for gRPC \/ OpenAPI client generation and improved unit testing integration. Additionally, it includes several improvements for Xamarin developers, including Xamarin.Forms 4.8 Support. This release also includes initial support for macOS Big Sur, with the exception of Xamarin support. macOS Big Sur [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/230225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/470"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=230225"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/230225\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/226537"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=230225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=230225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=230225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}