- Visual Studio Code For React On Macos Pc
- Visual Studio 2019 Macos
- Visual Studio Code For React On Macos Mac
Visual Studio Code for React on MacOS. There are plenty of editors and IDEs out there to develop web applications. Depending on your personal, project or company requirements, you can choose from a range of lightweight editors to full-blown IDEs. Visual Studio Code is a solution in between.
-->Visual Studio Code is a cross-platform script editor by Microsoft. Together with thePowerShell extension, it provides a rich and interactive script editing experience, makingit easier to write reliable PowerShell scripts. Visual Studio Code with the PowerShell extension isthe recommended editor for writing PowerShell scripts.
It supports the following PowerShell versions:
- PowerShell 7 and up (Windows, macOS, and Linux)
- PowerShell Core 6 (Windows, macOS, and Linux)
- Windows PowerShell 5.1 (Windows-only)
Note
Visual Studio Code is not the same as Visual Studio.
Getting started
Before you begin, make sure PowerShell exists on your system. For modern workloads on Windows,macOS, and Linux, see the following links:
For traditional Windows PowerShell workloads, see Installing Windows PowerShell. Traffic apps for macos.
Important
The Windows PowerShell ISE is still available for Windows. However, it is no longer inactive feature development. The ISE does not work with PowerShell 6 and higher. As a component ofWindows, it continues to be officially supported for security and high-priority servicing fixes.We have no plans to remove the ISE from Windows.
Editing with Visual Studio Code
- Install Visual Studio Code. For more information, see the overviewSetting up Visual Studio Code.There are installation instructions for each platform:
- Windows: follow the installation instructions on theRunning Visual Studio Code on Windows page.
- macOS: follow the installation instructions on theRunning Visual Studio Code on macOS page.
- Linux: follow the installation instructions on theRunning Visual Studio Code on Linux page.
- Install the PowerShell Extension.
- Launch the Visual Studio Code app by typing
code
in a console orcode-insiders
if you installed Visual Studio Code Insiders. - Launch Quick Open on Windows or Linux by pressing Ctrl+P. On macOS,press Cmd+P.
- In Quick Open, type
ext install powershell
and press Enter. - The Extensions view opens on the Side Bar. Select the PowerShell extension from Microsoft.You should see a Visual Studio Code screen similar to the following image:
- Click the Install button on the PowerShell extension from Microsoft.
- After the install, if you see the Install button turn into Reload, Click on Reload.
- After Visual Studio Code has reloaded, you're ready for editing.
For example, to create a new file, click File > New. To save it, click File > Save and thenprovide a file name, such as
HelloWorld.ps1
. To close the file, click the X
next to the filename. To exit Visual Studio Code, File > Exit.Visual Studio Code For React On Macos Pc
Installing the PowerShell Extension on Restricted Systems
Some systems are set up to require validation of all code signatures. You may receive the followingerror:
This problem can occur when PowerShell's execution policy is set by Windows Group Policy. Tomanually approve PowerShell Editor Services and the PowerShell extension for Visual Studio Code,open a PowerShell prompt and run the following command:
With any edition of Chocolatey (including the free open source edition), you can and cache or existing community packages.DisclaimerYour use of the packages on this site means you understand they are not supported or guaranteed in any way. ModerationEvery version of each package undergoes a rigorous moderation process before it goes live that typically includes:., consistency, and. Human moderators who give final review and sign offMore detail at. Aws tools for powershell for macos not working after installation. Organizational UseIf you are an organization using Chocolatey, we want your experience to be fully reliable.Due to the nature of this publicly offered repository, cannot be guaranteed.Packages offered here are subject to distribution rights, which means they may need to reach out further to the internet to the official locations to download files at runtime.Fortunately, distribution rights do not apply for internal use.
You're prompted with Do you want to run software from this untrusted publisher? Type
A
to runthe file. Then, open Visual Studio Code and check that the PowerShell extension is functioningproperly. If you still have problems getting started, let us know on GitHub issues.Note
The PowerShell extension for Visual Studio Code does not support running in constrained languagemode. For more information, see GitHub issue #606.
Choosing a version of PowerShell to use with the extension
With PowerShell Core installing side-by-side with Windows PowerShell, it's now possible to use aspecific version of PowerShell with the PowerShell extension. This feature looks at a few well-knownpaths on different operating systems to discover installations of PowerShell.
Use the following steps to choose the version:
- Open the Command Palette on Windows or Linux withCtrl+Shift+P. On macOS, useCmd+Shift+P.
- Search for Session.
- Click on PowerShell: Show Session Menu.
- Choose the version of PowerShell you want to use from the list, for example: PowerShell Core.
If you installed PowerShell to a non-typical location, it might not show up initially in the SessionMenu. You can extend the session menu by adding your own custom pathsas described below.
Note
The PowerShell session menu can also be accessed from the green version number in the bottom rightcorner of status bar. Clicking this version number opens the session menu.
Configuration settings for Visual Studio Code
First, if you're not familiar with how to change settings in Visual Studio Code, we recommendreading Visual Studio Code's settings documentation.
After reading the documentation, you can add configuration settings in
settings.json
.If you don't want these settings to affect all files types, Visual Studio Code also allowsper-language configurations. Create a language-specific setting by putting settings in a
[<language-name>]
field. For example:Tip
For more information about file encoding in Visual Studio Code, see Understanding file encoding.
Also, check out How to replicate the ISE experience in Visual Studio Code for othertips on how to configure Visual Studio Code for PowerShell editing.
Adding your own PowerShell paths to the session menu
You can add other PowerShell executable paths to the session menu through theVisual Studio Code setting:
powershell.powerShellAdditionalExePaths
.Add an item to the list
powershell.powerShellAdditionalExePaths
or create the list if it doesn'texist in your settings.json
:Each item must have:
exePath
: The path to thepwsh
orpowershell
executable.versionName
: The text that will show up in the session menu.
To set the default PowerShell version, set the value
powershell.powerShellDefaultVersion
to thetext displayed in the session menu (also known as the versionName
):After you've configured this setting, restart Visual Studio Code or to reload the current VisualStudio Code window from the Command Palette, type Developer: Reload Window.
If you open the session menu, you now see your additional PowerShell versions!
Note
If you build PowerShell from source, this is a great way to test out your local build ofPowerShell.
Using an older version of the PowerShell Extension for Windows PowerShell v3 and v4
The current PowerShell extension doesn't support PowerShell v3 and v4. However, you canuse the last version of the extension that supports PowerShell v3 and v4.
Caution
There will be no additional fixes to this older version of the extension. It's provided 'AS IS'but is available for you if you are still using Windows PowerShell v3 and Windows PowerShell v4.
First, open the Extension pane and search for
PowerShell
. Then click the gear and selectInstall another version...Then select the 2020.1.0 version. This version of the extension was the last version tosupport v3 and v4. Be sure to add the following setting so that your extension version doesn'tupdate automatically:
Version 2020.1.0 will work for the foreseeable future. However, Visual Studio Code couldimplement a change that breaks this version of the extension. Because of this, and lack of support,we recommend:
- Upgrading to Windows PowerShell 5.1
- Install PowerShell 7, which is a side-by-side install to Windows PowerShell and works thebest with the PowerShell extension
Debugging with Visual Studio Code
No-workspace debugging
In Visual Studio Code version 1.9 (or higher), you can debug PowerShell scripts without opening thefolder that contains the PowerShell script.
- Open the PowerShell script file with File > Open File..
- Set a breakpoint - select a line then press F9
- Press F5 to start debugging
You should see the Debug actions pane appear which allows you to break into the debugger,step, resume, and stop debugging.
Workspace debugging
Workspace debugging refers to debugging in the context of a folder that you've opened from theFile menu using Open Folder... The folder you open is typically your PowerShell projectfolder or the root of your Git repository. Workspace debugging allows you to define multiple debugconfigurations other than just debugging the currently open file.
Follow these steps to create a debug configuration file:
- Open the Debug view on Windows or Linux by pressingCtrl+Shift+D. On macOS, pressCmd+Shift+D.
- Click the create a launch.json file link.
- From the Select Environment prompt, choose PowerShell.
- Choose the type of debugging you'd like to use:
- Launch Current File - Launch and debug the file in the currently active editor window
- Launch Script - Launch and debug the specified file or command
- Interactive Session - Debug commands executed from the Integrated Console
- Attach - Attach the debugger to a running PowerShell Host Process
Visual Studio Code creates a directory and a file
.vscodelaunch.json
in the root of yourworkspace folder to store the debug configuration. If your files are in a Git repository, youtypically want to commit the launch.json
file. The contents of the launch.json
file are:This file represents the common debug scenarios. When you open this file in the editor, you see anAdd Configuration.. button. You can click this button to add more PowerShell debugconfigurations. One useful configuration to add is PowerShell: Launch Script. With thisconfiguration, you can specify a file containing optional arguments that are used whenever youpress F5 no matter which file is active in the editor.
After the debug configuration is established, you can select which configuration you want to useduring a debug session. Select a configuration from the debug configuration drop-down in theDebug view's toolbar.
Troubleshooting the PowerShell extension for Visual Studio Code
If you experience any issues using Visual Studio Code for PowerShell script development, see thetroubleshooting guide on GitHub.
Useful resources
There are a few videos and blog posts that may be helpful to get you started using the PowerShellextension for Visual Studio Code:
Videos
Blog posts
PowerShell extension project source code
The PowerShell extension's source code can be found on GitHub.
If you're interested in contributing, Pull Requests are greatly appreciated. Follow along with thedeveloper documentation on GitHub to get started.
-->Visual Studio 2019 Macos
In this article, you'll learn how to install .NET Core on macOS. .NET Core is made up of the runtime and the SDK. The runtime is used to run a .NET Core app and may or may not be included with the app. The SDK is used to create .NET Core apps and libraries. The .NET Core runtime is always installed with the SDK.
The latest version of .NET Core is 3.1.
Supported releases
The following table is a list of currently supported .NET Core releases and the versions of macOS they're supported on. These versions remain supported either the version of .NET Core reaches end-of-support.
- A ✔️ indicates that the version of .NET Core is still supported.
- A ❌ indicates that the version of .NET Core isn't supported.
Operating System | .NET Core 2.1 | .NET Core 3.1 | .NET 5 Preview |
---|---|---|---|
macOS 10.15 'Catalina' | ✔️ 2.1 (Release notes) | ✔️ 3.1 (Release notes) | ✔️ 5.0 Preview (Release notes) |
macOS 10.14 'Mojave' | ✔️ 2.1 (Release notes) | ✔️ 3.1 (Release notes) | ✔️ 5.0 Preview (Release notes) |
macOS 10.13 'High Sierra' | ✔️ 2.1 (Release notes) | ✔️ 3.1 (Release notes) | ✔️ 5.0 Preview (Release notes) |
macOS 10.12 'Sierra' | ✔️ 2.1 (Release notes) | ❌ 3.1 (Release notes) | ❌ 5.0 Preview (Release notes) |
Unsupported releases
The following versions of .NET Core are ❌ no longer supported. The downloads for these still remain published:
- 3.0 (Release notes)
- 2.2 (Release notes)
- 2.0 (Release notes)
Runtime information
The runtime is used to run apps created with .NET Core. When an app author publishes an app, they can include the runtime with their app. If they don't include the runtime, it's up to the user to install the runtime.
There are three different runtimes you can install on macOS:
ASP.NET Core runtime
Runs ASP.NET Core apps. Includes the .NET Core runtime.
Runs ASP.NET Core apps. Includes the .NET Core runtime.
.NET Core runtime
This runtime is the simplest runtime and doesn't include any other runtime. It's highly recommended that you install ASP.NET Core runtime for the best compatibility with .NET Core apps.
This runtime is the simplest runtime and doesn't include any other runtime. It's highly recommended that you install ASP.NET Core runtime for the best compatibility with .NET Core apps.
SDK information
Visual Studio Code For React On Macos Mac
The SDK is used to build and publish .NET Core apps and libraries. Installing the SDK includes both runtimes: ASP.NET Core and .NET Core.
Dependencies
.NET Core is supported on the following macOS releases:
.NET Core Version | macOS | Architectures | |
---|---|---|---|
3.1 | High Sierra (10.13+) | x64 | More information |
3.0 | High Sierra (10.13+) | x64 | More information |
2.2 | Sierra (10.12+) | x64 | More information |
2.1 | Sierra (10.12+) | x64 | More information |
Beginning with macOS Catalina (version 10.15), all software built after June 1, 2019 that is distributed with Developer ID, must be notarized. This requirement applies to the .NET Core runtime, .NET Core SDK, and software created with .NET Core.
The installers for .NET Core (both runtime and SDK) versions 3.1, 3.0, and 2.1, have been notarized since February 18, 2020. Prior released versions aren't notarized. If you run a non-notarized app, you'll see an error similar to the following image:
For more information about how enforced-notarization affects .NET Core (and your .NET Core apps), see Working with macOS Catalina Notarization.
libgdiplus
.NET Core applications that use the System.Drawing.Common assembly require libgdiplus to be installed.
An easy way to obtain libgdiplus is by using the Homebrew ('brew') package manager for macOS. After installing brew, install libgdiplus by executing the following commands at a Terminal (command) prompt:
Install with an installer
macOS has standalone installers that can be used to install the .NET Core 3.1 SDK:
Download and manually install
As an alternative to the macOS installers for .NET Core, you can download and manually install the SDK and runtime. Manual install is usually performed as part of continuous integration testing. For a developer or user, it's generally better to use an installer.
If you install .NET Core SDK, you don't need to install the corresponding runtime. First, download a binary release for either the SDK or the runtime from one of the following sites:
- ✔️ .NET 5.0 preview downloads
- ✔️ .NET Core 3.1 downloads
- ✔️ .NET Core 2.1 downloads
Next, extract the downloaded file and use the
export
command to set variables used by .NET Core and then ensure .NET Core is in PATH.To extract the runtime and make the .NET Core CLI commands available at the terminal, first download a .NET Core binary release. Then, open a terminal and run the following commands from the directory where the file was saved. The archive file name may be different depending on what you downloaded.
Use the following command to extract the runtime:
Use the following command to extract the SDK:
Tip
The preceding
export
commands only make the .NET Core CLI commands available for the terminal session in which it was run.You can edit your shell profile to permanently add the commands. There are a number of different shells available for Linux and each has a different profile. For example:
- Bash Shell: ~/.bash_profile, ~/.bashrc
- Korn Shell: ~/.kshrc or .profile
- Z Shell: ~/.zshrc or .zprofile
Edit the appropriate source file for your shell and add
:$HOME/dotnet
to the end of the existing PATH
statement. If no PATH
statement is included, add a new line with export PATH=$PATH:$HOME/dotnet
.Also, add
export DOTNET_ROOT=$HOME/dotnet
to the end of the file.This approach lets you install different versions into separate locations and choose explicitly which one to use by which application.
Install with Visual Studio for Mac
Visual Studio for Mac installs the .NET Core SDK when the .NET Core workload is selected. To get started with .NET Core development on macOS, see Install Visual Studio 2019 for Mac. For the latest release, .NET Core 3.1, you must use the Visual Studio for Mac 8.4 Preview.
Install alongside Visual Studio Code
Visual Studio Code is a powerful and lightweight source code editor that runs on your desktop. Visual Studio Code is available for Windows, macOS, and Linux.
While Visual Studio Code doesn't come with an automated .NET Core installer like Visual Studio does, adding .NET Core support is simple.
- Download and install Visual Studio Code.
- Download and install the .NET Core SDK.
- Install the C# extension from the Visual Studio Code marketplace.
Install with bash automation
The dotnet-install scripts are used for automation and non-admin installs of the runtime. You can download the script from the dotnet-install script reference page.
The script defaults to installing the latest long term support (LTS) version, which is .NET Core 3.1. You can choose a specific release by specifying the
current
switch. Include the runtime
switch to install a runtime. Otherwise, the script installs the SDK.Note
The command above installs the ASP.NET Core runtime for maximum compatability. The ASP.NET Core runtime also includes the standard .NET Core runtime.
Docker
Containers provide a lightweight way to isolate your application from the rest of the host system. Containers on the same machine share just the kernel and use resources given to your application.
.NET Core can run in a Docker container. Official .NET Core Docker images are published to the Microsoft Container Registry (MCR) and are discoverable at the Microsoft .NET Core Docker Hub repository. Each repository contains images for different combinations of the .NET (SDK or Runtime) and OS that you can use.
Microsoft provides images that are tailored for specific scenarios. For example, the ASP.NET Core repository provides images that are built for running ASP.NET Core apps in production.
For more information about using .NET Core in a Docker container, see Introduction to .NET and Docker and Samples.
Next steps
- How to check if .NET Core is already installed.
- Working with macOS Catalina notarization.
- Tutorial: Get started on macOS.
- Tutorial: Create a new app with Visual Studio Code.
- Tutorial: Containerize a .NET Core app.