Asp Editor For Mac

среда 12 февраляadmin
-->

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.

Aug 27, 2009  Coda has a 'asp-html' syntax mode, but I don't know.asp so I have no idea how it handles it. They offer a 15 day trial though so give it a whirl. Coda is by far my editor of choice. At the bottom of the app window there's a bar and one of the drop down boxes lets you choose which programming language you're using. Editor PSPad - freeware HTML editor, PHP editor, XHTML, JavaScript, ASP, Perl, C, HEX editor.

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 app
  • UseContentRoot(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 both UseKestrel and UseIISIntegration 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 and Configure

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:

  1. Right-click on the Project name and select Add > New Files. Select General > Empty Class, and enter a controller name:

  2. Add the following code to the new controller:

  3. Add the Microsoft.AspNetCore.Mvc dependency to the project by right-clicking the Dependency folder, and selecting Add Package...

  4. 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:

  5. 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 the app.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 the HelloWorld Controller, and the Index action method.

  6. Add the services.AddMvc(); call to the ConfigureServices method, as illustrated below:

    You can also pass parameter information from the URL to the controller.

  7. Add another method to your HelloWorldController, as illustrated below:

  8. If you run the app now, it should automatically open your browser:

  9. Try to browse to http://localhost:xxxx/HelloWorld/Xamarin?name=Amy (replacing xxxx 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:

  1. 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.

  2. 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.

Related Video

-->

Developer Community System Requirements Compatibility Distributable Code Documentation Blogs Servicing

Click the button to download the latest version of Visual Studio 2019 for Mac. For information on the system requirements see the see Mac System Requirementsand Mac Platform Targeting and Compatibility guides.

For instructions on installing and updating Visual Studio 2019 for Mac, see theInstall Visual Studio for Mac guide.

To learn more about other related downloads, see the Downloads page.

What's New in Visual Studio 2019 for Mac

Visual Studio 2019 for Mac Releases

  • March 3, 2020 - Visual Studio 2019 for Mac version 8.4.8
  • February 25, 2020 - Visual Studio 2019 for Mac version 8.4.7
  • February 19, 2020 - Visual Studio 2019 for Mac version 8.4.6
  • February 10, 2020 - Visual Studio 2019 for Mac version 8.4.5
  • February 4, 2020 - Visual Studio 2019 for Mac version 8.4.4
  • January 28, 2020 - Visual Studio 2019 for Mac version 8.4.3
  • January 21, 2020 - Visual Studio 2019 for Mac version 8.4.2
  • January 14, 2020 - Visual Studio 2019 for Mac version 8.4.1
  • January 8, 2020 — Visual Studio 2019 for Mac version 8.4

Visual Studio 2019 for Mac Blog Posts

The Visual Studio Blog is the official source of product insight from the Visual Studio Engineering Team. You can find in-depth information about the Visual Studio 2019 for Mac releases in the following posts:

Release Highlights

  • This release adds support for .NET Core 3.1.100.
  • This release focuses on improving the overall experience using assistive technologies in Visual Studio for Mac.
  • This release brings additional features for .NET Core developers including:
    • Scaffolding support for ASP.NET Core projects.
    • The ability to develop and publish ASP.NET Core Blazor Server applications.
    • Editor refinement, including support for .razor files.
    • Pack support for creating NuGet packages from .NET Core library projects.

Known Issues

Refer to the Known Issues section.

Visual Studio 2019 for Mac version 8.4.8 (8.4.8.2)

released March 3, 2020

This service release fixes the following issues:

  • Templates are missing after updating Azure Functions templates and restarting Visual Studio for Mac.

Visual Studio 2019 for Mac version 8.4.7 (8.4.7.17)

released February 25, 2020

This service release addresses a number of additional accessibility issues and also fixes the following issues:

  • Report a problem dialog hidden when attaching a new file.
  • Cmd + . file search now has to be pressed twice.
  • Navigate to shortcut won't focus search text box.
  • Copy in a .resx file clears clipboard instead of copying.
  • Unable to copy/paste from Specflow .feature file.
  • Copy and paste from the old editor to the Xaml editor doesn't work.
  • launchSettings.json are changed on save.

Visual Studio 2019 for Mac version 8.4.6 (8.4.6.36)

released February 19, 2020

This service release addresses a number of additional accessibility issues and also fixes the following issues:

  • Can't expand a list item in the Review Solution and Commit page after doing a Update Solution command.

Visual Studio 2019 for Mac version 8.4.5 (8.4.5.19)

released February 10, 2020

This service release fixes the following issues:

  • MVC scaffolding doesn't include 'MVC Controller with views, using Entity Framework' scaffolder.
  • Scaffolding in a ASP.NET Core project uses LocalDB instead of Sqlite leading to PlatformNotFoundException.

Visual Studio 2019 for Mac version 8.4.4 (8.4.4.91)

released February 4, 2020

This release of Visual Studio 2019 for Mac brings a refreshed color palette, new icons, and updated warning and error status messages. Color contrast ratios for text and icons have been increased to improve clarity. Visual Studio for Mac also now fully suports macOS High Contrast Mode.

In addition to the visual changes, this release of Visual Studio 2019 for Mac has made a number changes to increase overall accessibility of the IDE. These include:

  • Improvements to focus order and visibility when using VoiceOver in the debugger, NuGet Package Manager and project options dialog.
  • Areas previously inaccessible by keyboard navigation, such as the pin and eye icon, are now navigable by keyboard.
  • Enhanced feedback from VoiceOver for debugger status.
  • 'Project created' was not previously announced and now is.
  • Fixes to the NuGet Package Manager that allow keyboard access to the Browse, Installed, Update and Consolidate tabs.
  • VoiceOver now announces the selected version in the NuGet 'New version' dropdown.
  • VoiceOver now announces more information when using version control, the publish to Azure feature, and in a number of additional areas.
  • New PList editor source view implementation with improved keyboard navigation and VoiceOver support.

This service release also fixes the following issues:

  • We fixed an issue where .aspx files have no IntelliSense.

Visual Studio 2019 for Mac version 8.4.3 (8.4.3.12)

released January 28, 2020

This service release fixes the following issues:

  • We fixed an issue where it is not possible to install Android material on macOS Catalina.
  • We added support for launchSettings.json to Worker projects.
  • We fixed an issue where the debug mode is browser when creating a Worker Service project instead of default.

Visual Studio 2019 for Mac version 8.4.2 (8.4.2.59)

released January 21, 2020

This service release fixes the following issues:

  • We shipped the .NET Core January update (2.1.15 runtime and 3.1.101 SDK).
  • We fixed some additional accessibility issues with VoiceOver and keyboard navigation.
  • We fixed an issue where the Value Visualizer is always blank in 8.3.3 (Build 8).
  • We fixed an issue where inspecting nested variables in the hierarchy takes a long time.
  • We fixed an issue where Blazor debugging tool tips do not show any icons.
  • We fixed an issue where the Start Window shows when launching from Unity and can't be closed.
  • We fixed an issue where the 'Create' button doesn't work and .NET crashes.
  • We fixed an issue where Visual Studio for Mac cannot create .NET Core 3.1 projects after installing .NET Core 3.1.

Visual Studio 2019 for Mac version 8.4.1 (8.4.1.2)

released January 14, 2020

Atok2017mac-mdl atok 2017 for mac

Asp editor for mac free

This service release fixes the following issues:

  • We fixed an issue where the bottom toolbar in the Xamarin Designer is being cut off.
  • We addressed a high volume crash.

Visual Studio 2019 for Mac version 8.4 (8.4.0.2657)

released January 8, 2020

New Features

Accessibility

We made a number of changes to improve the accessibility of Visual Studio for Mac in this release including:

  • Increasing contrast for text and icons throughout the IDE.
  • Improving keyboard navigation and shortcuts.
  • Refining focus order when navigating using assistive technologies.
  • Reducing the number of steps needed to move between certain elements on the Start Page while using VoiceOver.
  • The 'Pin button' on the Start Page can now be accessed with VoiceOver.
  • Improving VoiceOver dictation and navigation throughout the IDE in the following areas and more:
    • Recently used templates page
    • Font picker
    • Document view tabs
    • Global Search Results
    • Code editor
    • Code snippets
    • Updater
    • Version control
    • Project options
  • Mitigating keyboard traps in Xamarin designer property panels and made previously inaccessible areas in those property panels accessible.
  • Completely rewriting previously inaccessible IDE components to make them accessible.

Web and Azure

  • We added support for ASP.NET Core Scaffolding.
  • We added support for editing .razor files.
  • We added support for provisioning Azure SignalR Service for Blazor Server projects during publish to Azure App Service.
  • We added support to Pack .NET Standard library projects.

Editor

  • All files should now open in the new editor unless legacy editor is explicitly needed.
  • We fixed some performance leaks in the editor.
  • We updated to use the latest FSharp.CompilerService.
  • We improved support for .csx files.
  • We have added support for TypeScript 3.7, with new features like Optional Chaining and Nullish Coalescing.
  • Blazor support has improved IntelliSense and debugger integration.

Shell

  • We have added a native and fully accessible (keyboard and VoiceOver) property pad control from the Android designer to the shelland enabled it by default for all solution items.

Debugger

  • We have implemented native controls for the debugger tooltips, locals pad and watch pads, and the exception caught dialog which allowed for us to re-enable pinned watches in the editor.

Xamarin

  • XAML Hot Reload for Xamarin.Forms is now on by default and built-in to the IDE. To learn more about XAML Hot Reload, see the XAML Hot Reload documentation.
  • You can now create Android App Bundles when publishing your Android applications in Visual Studio. App Bundles provide users with with optimized APKs per their device specifications when downloading an app from the Google Play Store or various Android App Stores.
  • You can now use an AndroidX migration wizard to convert your existing Android application to AndroidX from the Android Support Library.
  • You are now provided a set of common issues when editing your layouts inside the Android designer.

Installer

  • The installer now supports dark theme.
  • The installer will now clean up older minor versions of .NET Core that were previously installed using the installer.
  • HAXM and AVD creation support have been removed from the installer. Creation of AVDs should be done using Visual Studio for Mac's device manager.
  • The installer, and Visual Studio for Mac, no longer supports macOS Sierra.

Bug Fixes

Shell and Tools

We fixed the following issues with the IDE:

  • We added notarization support for macOS Catalina.
  • Dialog locations are inconsistent.
  • The accounts Window is always on top, even when leaving Visual Studio for Mac.
  • The IDE opens in the wrong Desktop if the Start Window is dragged to a new desktop.
  • 'New' is cut off at the bottom in the Start Window in some languages.
  • If you choose not to sign in on first run, you'll continually get prompted through the first run experience.
  • Hitting return in a search field doesn't search.
  • Tab key to change between views seems to be broken.
  • Visual Studio Community lacks UTF-8 (no signature) format.
  • Preferences menu item does not open.
  • We fixed an issue where extension manager cannot be closed once opened.

Editor

We fixed the following issues with editing source code:

  • The IDE would re-default to 'case sensitive' search.
  • When creating a breakpoint, selected lines would not be auto-filled.
  • When copy/pasting a word-wrapped line, only the first line would be copied.
  • The emoji selector would not display.
  • Commenting commands does not work in .js/.ts files.
  • We fixed an issue where code formatting in .js/.ts files could delete user code unexpectedly.
  • The insert line command (shift+enter) would not work.
  • The 'Show quick info' and 'Focus Document' commands would not work.
  • We removed some obsolete refactorings.
  • We fixed an issue where font weight was being ignored.
  • More msbuild files (such as .props) are now syntax-highlighted.
  • We fixed an issue where editor commands sometimes stopped working when tabs were moved into separate windows.
  • We fixed an issue where files sometimes opened scrolled to the right.
  • We fixed an issue where some tooltips were missing from Find.
  • We fixed an issue where quick info tooltips were not displayed for some properties.
  • Blazor support received several fixes to productivity features such as Go To Defintion and debugger tooltips.
  • The IntelliSense completion list now responds properly to text zoom commands.

Web and Azure

We fixed the following issues with .NET Core support:

  • The Blazor template has been added to the New Project dialog.
  • Razor component and Worker Service templates added to New Item dialog.
  • Launch settings were previously generated with https but project doesn't support https.
  • When creating a new ASP.NET Core project the port number was not unique.
  • We improved ASP.NET Core project loading times, especially in projects with extensive File Nesting.
  • We fixed an issue where updating to 3.0 Azure Functions Templates in the Project Creation Wizard causes Azure Functions to disappear as an option.

We fixed the following issues with Azure Functions support:

  • Azure Functions was missing templates for AzureFunctionsVersion, v2.

Version Control

We fixed the following issues with Version Control:

  • Cancelling an SVN checkout can accidentally delete user files.

Project System

We fixed the following issues with Projects:

  • Manually adding DefaultTargets to csproj gets overridden when VS modifies the project.
  • Inconsistent naming for removal on files and projects.
  • Project context menu is missing 'Add Reference'.
  • Renaming a file in the solution pad does not re-apply nesting rules.
  • Change title of window from 'Edit References' to 'References'.
  • Project model reports wrong references for certain projects.
  • We fixed an issue where Define Constants would not be defined correctly when defined in imported projects.
  • We fixed an issue where Visual Studio for Mac could get stuck in a loop saving a project that was under source control.

Debugging

We fixed the following issues with Debugging:

  • We added a missing 'Debug All Tests' command.
  • Hovering over an expression may change the value of variables in the .NET Core debugger.
  • Opening the Exception Caught dialog makes the IDE hang.
  • We fixed an issue where pinning properties in debug doesn't work.

Xamarin

We fixed the following issues with the Xamarin support:

  • Visual Studio for Mac reporting iOS specific classes, methods and enums unavailable in iOS.
  • We improved an unhelpful error message when signing an archive for distribution.
  • We fixed an issue where document outlines in storyboards are empty.
  • We fixed an error where the Xamarin.Forms multiplatform templates would add files to disk, but not add them to the solution itself.
  • We fixed an issue where Visual Studio for Mac was failing to upload Android archives to the Google Playstore with the message: 'API has been deprecated'.

Testing

We fixed the following issues with Testing:

  • 'Show Test Source Code' does nothing if you right click a test class name.
  • 'Run Test' does not run the test if a compile is required.
  • We fixed an issue where the debugger doesn't open a file on failure during test debugging.

Installer

We squashed a handful of behind-the-scenes bugs in the installer.

Updater

We fixed the following issues with the updater:

  • Progress indicator was empty after an unsuccessful download.
  • Updater does not wait for IDE to exit before installing updates.

Known Issues

  • After adding a new file using the Razor Component file template, the project may fail to build. The issue is caused by some unneeded elements in the project file (.csproj file), remove elements referencing the new file from the project file, and the project should build successfully.
  • When developing ASP.NET Core projects, if .NET Core SDK 3.1 Preview is installed, https connections may be refused. The browser may not launch, or when using docker, certificate errors are shown. To workaround this, run the following commands in the terminal; dotnet dev-certs https —clean and then dotnet dev-certs https —trust.
  • Pressing backspace does not delete a watch from the Watches pad.

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, including suggestions, in the Developer Community portal.

Top of Page