IOW, Pressing Tab at the start of a new paragraph does not indent the paragraph, it simply tabs in to the first default [.5'] tab stop. With the insertion point at the beginning of the 1st sentence Tab sets a first line indent at the.5' tab stop. Hats off to Microsoft for releasing the new Visual Studio for Mac. Unfortunately, this does not, at present and in all cases, enable us to properly develop.NET web applications on a Mac.
-->Developer Community |System Requirements |Compatibility |Distributable Code |Documentation |Blogs |Servicing |
Download
Install the most recent Preview version of Visual Studio for Mac by changing the updater channel to Beta.
Note
This release is not 'go-live' and not intended for use on production computers or for creating production code.
To learn more about Visual Studio 2017 for Mac, see Mac System Requirementsand Mac Platform Targeting and Compatibility.
To learn more about other related downloads, see the Downloads page.
Feedback
We would love to hear from you! You can report a problem through the Report a Problem option in Visual Studio for Mac IDE.You can track your feedback in the Developer Community portal. For suggestions, let us know through UserVoice.
Release History
- February 6, 2019 – Visual Studio 2017 for Mac version 7.8 Preview 3
- January 23, 2019 – Visual Studio 2017 for Mac version 7.8 Preview 2
- December 18, 2018 – Visual Studio 2017 for Mac version 7.8 Preview 1
Release Highlights
This release focuses on improving the quality in Visual Studio for Mac through bug fixes, performance improvements, and reliability improvements.
Visual Studio 2017 for Mac version 7.8 Preview 3 (7.7.0.1607)
released February 6, 2019
![Visual studio for mac os Visual studio for mac os](http://edn.embarcadero.com/print/images/42160/03000018.png)
Shell
- We fixed an issue where custom key bindings for Remove Unused and Sort (Usings) don't work.
.NET Core
- We fixed an issue where the create button doesn't create new project for .NET Core 3.0 preview 2.
- We fixed an issue where .NET Core 3.0 can be selected in the New Project dialog when it is not supported.
Web Tools
- We fixed an issue where Publish to Azure creates a profile with the wrong name.
Xamarin
- We fixed an issue when attempting to drag and drop controls to iOS storyboards from the Tool Box after searching for controls does not work.
Xamarin.Android
- We fixed an issue where the JDK notification was shown on the welcome page, even for non-Android projects.
- We fixed an issue where launching Visual Studio for Mac without any Java installed shows 2 system prompts to install Java.
Visual Studio 2017 for Mac version 7.8 Preview 2 (7.7.0.1547)
released January 23, 2019
Code Editor
- We fixed an issue where Using statement indenting is incorrect.
- We fixed an issue where Roslyn throws a fatal exception (System.ArgumentOutOfRangeException).
- We fixed an issue where formatting of parameters across multiple lines is incorrect.
- We fixed an issue where the constructor generator would cause Visual Studio for Mac to crash.
- We fixed an issue where smart semicolon placement causes incorrect semicolon placement.
Shell
- We fixed an issue where switching from the application and returning, does not focus on the editor correctly.
- We fixed an issue where the cursor in editor window is lost when switching applications.
- We fixed an issue where focusing out/into Visual Studio changes the default focused element on the UI.
- We fixed an issue where Visual Studio for Mac would fail to track file changes for files in certain folders.
- We fixed an issue where Visual Studio for Mac doesn't remember opened files.
- We fixed an issue where the Toolbar selector for build configuration is disabled.
NuGet
- We fixed an issue where Visual Studio for Mac crashes after 'Could not add packages' error.
.NET Core
- We removed the VB.NET option from .NET Core projects.
ASP.NET Core
- We fixed an issue where the Folder profile would be created with 'Default' configuration instead of 'Release'.
Web Tools
- We fixed an issue where application arguments are not passed to the Azure Functions host.
- We added the following additional Azure Functions templates
- CosmosDB trigger
- EventHub trigger
- IoT Hub trigger
- SendGrid trigger
- ServiceBus Queue trigger
- ServiceBus Topic trigger
Xamarin
Xamarin.Android
- We fixed an issue where the Android resource update could occur at the same time as a build which could then cause build issues.
- We fixed an issue where Visual Studio for Mac would fail to upload APK to Acer Chromebook R11.
Debugger
- We fixed an issue where the debugger would fail when running on an external console on Mojave.
Test Tools
- We fixed an issue where xUnit Fact 'DisplayName' not shown in test explorer if the name has a period at the end.
- We fixed an issue where the text editor unit test integration ('Unit test 'name' could not be loaded') would fail.
F#
- We fixed an issue where open statements for F# must be manually added when pasting/writing code.
Visual Studio 2017 for Mac version 7.8 Preview 1 (7.7.0.1471)
released December 18, 2018
Code Editor
- We fixed an issue where typing can be slow in large files when accessibility is enabled.
- We fixed an issue where a fatal error can occur when trying to navigate inside the editor using VoiceOver.
- We fixed an issue where the caret location in quick fix margin is incorrect.
- We fixed a performance issue where indent correcting is taking up too much time on large files.
- We fixed an issue where Intellisense soft-selection is confusing.
- We fixed an issue where Visual Studio for Mac can't open .targets files.
- We fixed an issue where the display updates partially when commenting a collapsed method.
- We fixed an issue where C# syntax highlight doesn't work for some of the keywords.
- We fixed an issue where invoking some snippets from the toolbox in .cs files leads to poorly formatted code.
- We fixed an issue where pressing Down to choose the closing tag completion in XAML IntelliSense closes the completion window.
- We fixed an issue where the file 'redacted' could not be opened.
- We fixed an issue where sometimes pasting fails in XAML files.
- We fixed an issue where, when adding an attribute via Intellisense, it does not trim 'Attribute' from the name.
- We fixed an issue where code suggestion does the wrong thing when
(
is pressed after a stray arrow key.
Project System
- We fixed an issue where the copy & paste of a XAML file causes a disassociation between the .xaml and .xaml.cs files.
- We fixed an issue where files are being added to ItemGroup.Compile(Remove) and this related issue - Error type of namespace not found.
- We fixed an issue where an invalid C# file is created with a new library project.
- We fixed an issue where it is not possible to create a culture specific .resx file through the 'New File ..' menu in the Solutions Explorer context menu.
Shell
- We fixed an issue where adding a new folder to a project does not allow instant renaming.
- We fixed an issue where Start Debugging after Start without Debugging results in an exception for ASP.Net projects.
- We fixed a performance issue with build output search.
- The Run Item command on the Solution Explorer has been renamed to Run Project.
- We fixed an issue where the welcome page is shown when loading a solution from finder.
NuGet
- We updated the version of NuGet to 4.8.
- NuGet package diagnostic warnings are now shown in the Solution Explorer. Any diagnostics warnings will be rendered with a warning icon and the full text of the warning available as a tool tip.
- We fixed a set of issues with NuGet:
- problem while restoring NuGet packages which don't have stable version.
- The VS4Mac bundle nuget version is too old: 4.3.1.
- Referencing packages conditionally using variable does not work correctly.
- Xamarin.Forms app with multi target framework library referenced fail to build.
- Visual Studio Mac Csproj build not support Item contidion.
- Support conditional NuGet PackageReferences in multi-targeting projects.
- Show per-framework dependencies when multi-targeting.
- VS cannot build F# dotnet core solution.
- Nuget restore ignore build targets.
- NuGet restores the wrong version of Microsoft.AspNetCore.App.
Assembly Browser
- We fixed an issue where the Assembly Browser shows the wrong icon for properties.
- We fixed an issue where
System.DayOfWeek
enum (Wednesday
) does not appear to be assigned a value.
Web Tools
- We fixed an issue where it was not possible to publish to Azure API App instances.
Xamarin
- We updated the Xamarin Test Cloud agent NuGet version.
- We fixed an issue where the View Archives command would appear in .NET Core projects.
Designers
- We fixed an issue where the toolbox regressed Android designer usage.
Xamarin.iOS
![Visual studio for mac os Visual studio for mac os](/uploads/1/2/5/8/125846890/665763938.png)
- It is now possible to choose .pdf files for image assets that do not support vector images.
- We fixed an issue where Visual Studio for Mac erroneously indicates that a Xamarin.Mac property is unavailable.
- We fixed an issue where it is not possible to choose devices for named colors in the asset catalog.
- We fixed an issue where the iOS simulator is no longer brought to front when starting a debug session.
- We fixed an issue where Native References not working in iOS library projects and appear to be ignored.
- We fixed an issue where deleting a Native Reference does not delete the the file on disk.
- We fixed an issue where the Debugger doesn't connect to a keyboard extension on any device.
Xamarin.Android
- We fixed an issue where new Android apps have uppercase letters in the package name.
- We fixed an issue where 'Your project is not referencing the 'Mono.Android.Version=v8.1' framework' when AndroidUseLatestPlatformSDK is true.
- We fixed an issue where Visual Studio for Mac does not recognize
AndroidManifest
in specific build configurations.. - We fixed an issue where opening the Report A Problem dialog also displays 'Install JDK' dialog.
- We fixed an issue where the Google Play SDK warning is shown even when publishing Ad-Hoc.
Xamarin.Forms
- Intellisense in Xamarin.Forms XAML files for FontFamily is now available.
Xamarin.Mac
- We fixed an issue where .xib templates seem to need
customObjectInstantitationMethod='direct'
added. - We fixed an issue where it is not possible to change the target framework version for Xamarin.Mac full on re-opening project options.
- We fixed an issue where the project options for a Mac build (classic) shows incorrect UI.
Test Tools
- We fixed a performance issue where the 'Test Results' pane has bad performance when very large amounts of text are shown.
- We fixed an issue where the unit test integration in the editor does not properly trigger test cases.
- We fixed an issue that could cause xunit to fail to restore.
Accessibility
- We fixed a number of accessibility issues in this release, including several VoiceOver issues in the Debugger and in creating iOS developer certificates, and Keyboard issues in the Android SDK Manager.
Other
- We fixed an issue where new F# projects shows IntelliSense errors.
- We fixed an issue where unchecking the Organize Using > Place System directives first setting does not save.
- We fixed an issue where Visual Studio for Mac is not remembering settings.
- We fixed an issue for F# projects where Visual Studio for Mac overwrites the project GUID to be lowercase instead of uppercase.
- We fixed an issue for F# projects where Visual Studio for Mac overwrites the project GUID to be lowercase instead of uppercase.
Visual Studio 2017 for Mac Preview Release Notes History
You can view prior Preview versions of Visual Studio 2017 for Mac release notes:
Visual Studio for Mac makes it easy to develop your app’s service with its support for the latest ASP.NET Core Web development platform. ASP.NET Core runs on .NET Core, the latest evolution of the .NET Framework and runtime. It’s been tuned for fast performance, factored for small install sizes, and reimagined to run on Linux and macOS, as well as Windows.
Installing .NET Core
.NET Core 2.1 is automatically installed when you install Visual Studio for Mac.
Creating an ASP.NET Core app in Visual Studio for Mac
Open Visual Studio for Mac. On the Start Screen, select New Project...
This will display the New Project dialog, allowing you to select a template to create your application.
There are a number of projects that will provide you with a pre-built template to start building your ASP.NET Core Application. These are:
- .NET Core > Empty
- .NET Core > API
- .NET Core > Web Application
- .NET Core > Web Application (Model-View-Controller)
Select the ASP.NET Core Empty Web Application and press Next. Give the Project a Name and press Create. This creates a new ASP.NET Core app. In the solution pad's left pane, expand the second arrow and then select Startup.cs. It should look similar to the image below:
The ASP.NET Core Empty template creates a web application with two default files: Program.cs and Startup.cs, which are explained below. It also creates a Dependencies folder, which contains your project’s NuGet package dependencies such as ASP.NET Core, the .NET Core framework, and the MSBuild targets that build the project:
Program.cs
Open and inspect the Program.cs file in your project. Notice that several things are happening in the
Main
method – the entry into your app:An ASP.NET Core app creates a web server in its main method by configuring and launching a host via an instance of
WebHostBuilder
. This builder provides methods to allow the host to be configured. In the template app the following configurations are used:.UseStartup<Startup>()
: Specifies the Startup class.
However, you can also add additional configurations, such as:
UseKestrel
: Specifies the Kestrel server will be used by the appUseContentRoot(Directory.GetCurrentDirectory())
: Uses the web project's root folder as the app's content root when the app is started from this folder.UseIISIntegration()
: Specifies that the app should work with IIS. To use IIS with ASP.NET Core bothUseKestrel
andUseIISIntegration
need to be specified.
Startup.cs
The Startup class for your app is specified in the
UseStartup()
method on the CreateWebHostBuilder
. It is in this class that you will specify the request handling pipeline, and where you configure any services.Open and inspect the Startup.cs file in your project:
This Startup class must always adhere to the following rules:
- It must always be public
- It must contain the two public methods:
ConfigureServices
andConfigure
The
ConfigureServices
method defines the services that will be used by your app.The
Configure
allows you to compose your request pipeline using Middleware. These are components used within an ASP.NET application pipeline to handle requests and responses. The HTTP pipeline consists of a number of request delegates, called in sequence. Each delegate can choose to either handle the request itself, or pass it to the next delegate.You can configure delegates by using the
Run
,Map
, and Use
methods on IApplicationBuilder
, but the Run
method will never call a next delegate and should always be used at the end of your pipeline.The
Configure
method of the pre-built template is built to do a few things. First, it configures an exception handling page for use during development. Then, it sends a response to the requesting web page with a simple 'Hello World'.This simple Hello, World project can run now without any additional code being added. To run the app, you can either select which browser you want to run app the app in using the dropdown right of the Play button, or simply hit the Play (triangular) button to use your default browser:
Visual Studio for Mac uses a random port to launch your web project. To find out what port this is, open the Application Output, which is listed under View > Pads. You should find output similar to that shown below:
Once the project is running, your default web browser should launch and connect to the URL listed in the Application Output. Alternatively, you can open any browser of your choice, and enter
http://localhost:5000/
, replacing the 5000
with the port that Visual Studio output in the Application Output. You should see the text Hello World!
:Adding a Controller
ASP.NET Core Apps use the Model-View-Controller (MVC) design pattern to provide a logical separation of responsibilities for each part of the app. MVC consists of the following:
- Model: A class that represents the data of the app.
- View: Displays the app's user interface (which is often the model data).
- Controller: A class which handles browser requests, responds to user input and interaction.
For more information on using MVC refer to Overview of ASP.NET Core MVC guide.
To add a controller, do the following:
- Right-click on the Project name and select Add > New Files. Select General > Empty Class, and enter a controller name:
- Add the following code to the new controller:
- Add the
Microsoft.AspNetCore.Mvc
dependency to the project by right-clicking the Dependency folder, and selecting Add Package.... - Use the Search box to browse the NuGet library for
Microsoft.AspNetCore.Mvc
, and select Add Package. This may take a few minutes to install and you may be prompted to accept various licenses for the required dependencies: - In the Startup class, remove the
app.Run
lambda and set the URL routing logic used by MVC to determine which code it should invoke to the following:Make sure to remove theapp.Run
lambda, as this will override the routing logic.MVC uses the following format, to determine which code to run:/[Controller]/[ActionName]/[Parameters]
When you add the code snippet above, you are telling the app to default to theHelloWorld
Controller, and theIndex
action method. - Add the
services.AddMvc();
call to theConfigureServices
method, as illustrated below:You can also pass parameter information from the URL to the controller. - Add another method to your HelloWorldController, as illustrated below:
- If you run the app now, it should automatically open your browser:
- Try to browse to
http://localhost:xxxx/HelloWorld/Xamarin?name=Amy
(replacingxxxx
with the correct port), you should see the following:
Troubleshooting
If you need to install .NET Core manually on Mac OS 10.12 (Sierra) and higher, do the following:
- Before you start installing .NET Core, ensure that you have updated all OS updates to the latest stable version. You can check this by going to the App Store application, and selecting the Updates tab.
- Follow the steps listed on the .NET Core site.
Make sure to complete all steps successfully to ensure that .NET Core is installed successfully.
Summary
This guide gave an introduction to ASP.NET Core. It describes what it is, when to use it, and provided information on using it in Visual Studio for Mac.For more information on the next steps from here, refer to the following guides:
- ASP.NET Core docs.
- Creating Backend Services for Native Mobile Applications, which shows how to build a REST service using ASP.NET Core for a Xamarin.Forms app.
- ASP.NET Core hands-on lab.