Visual studio code windows 7
Visual studio code windows 7
Visual Studio Code on Windows
Installation
Alternatively, you can also download a Zip archive, extract it and run Code from there.
User setup versus system setup
VS Code provides both Windows user and system level setups. Installing the user setup does not require Administrator privileges as the location will be under your user Local AppData (LOCALAPPDATA) folder. User setup also provides a smoother background update experience.
The system setup requires elevation to Administrator privileges and will place the installation under Program Files. This also means that VS Code will be available to all users in the system.
See the Download Visual Studio Code page for a complete list of available installation options.
32-bit versions
If you need to run a 32-bit version of VS Code, both a 32-bit Installer and Zip archive are available.
Updates
VS Code ships monthly releases and supports auto-update when a new release is available. If you’re prompted by VS Code, accept the newest update and it will be installed (you won’t need to do anything else to get the latest bits).
Note: You can disable auto-update if you prefer to update VS Code on your own schedule.
Windows Subsystem for Linux
Windows is a popular operating system and it can be a great cross-platform development environment. This section describes cross-platform features such as the Windows Subsystem for Linux (WSL) and the new Windows Terminal.
Recent Windows build
Make sure you are on a recent Windows 10 build. Check Settings > Windows Update to see if you are up-to-date.
Windows as a developer machine
With WSL, you can install and run Linux distributions on Windows. This enables you to develop and test your source code on Linux while still working locally on your Windows machine.
See the Developing in WSL documentation to learn more or try the Working in WSL introductory tutorial.
New Windows Terminal
Available from the Microsoft Store, the Windows Terminal (Preview) lets you easily open PowerShell, Command Prompt, and WSL terminals in a multiple tab shell.
Next steps
Once you have installed VS Code, these topics will help you learn more about VS Code:
Common questions
What command-line arguments are supported by the Windows Setup?
VS Code uses Inno Setup to create its setup package for Windows. Thus, all the Inno Setup command-line switches are available for use.
Scrolling is laggy and not smooth
On certain devices, editor scrolling is not smooth but laggy for an unpleasant experience. If you notice this issue, make sure you install the Windows 10 October 2018 update where this issue is fixed.
I’m having trouble with the installer
Try using the zip file instead of the installer. To use this, unzip VS Code in your AppData\Local\Programs folder.
Note: When VS Code is installed via a Zip file, you will need to manually update it for each release.
Icons are missing
I installed Visual Studio Code on my Windows 8 machine. Why are some icons not appearing in the workbench and editor?
Using the Command Prompt:
Using the Registry Editor (regedit):
Установка Visual Studio
Вас приветствует Visual Studio 2019! В этой версии можно легко выбрать и установить только необходимые компоненты. Поскольку она занимает меньше памяти, она быстро устанавливается и при установке меньше влияет на систему.
Вас приветствует Visual Studio 2022! В этой версии можно легко выбрать и установить только необходимые компоненты.
Этот раздел относится к Visual Studio в Windows. Информацию о Visual Studio для Mac см. в статье Установка Visual Studio для Mac.
Хотите ознакомиться с другими новыми возможностями этой версии? Обратитесь к заметкам о выпуске.
Хотите ознакомиться с другими новыми возможностями этой версии? Обратитесь к заметкам о выпуске.
Готовы к установке? Мы последовательно опишем каждое действие.
Шаг 1. Подготовка компьютера к установке Visual Studio
Перед началом установки Visual Studio:
Проверьте требования к системе. Так вы узнаете, поддерживает ли ваш компьютер Visual Studio 2019.
Примените актуальные обновления Windows. Эти обновления гарантируют, что на компьютере установлены последние обновления для системы безопасности и необходимые системные компоненты для Visual Studio.
Перезагрузите систему. Перезагрузка гарантирует, что ожидающие установки или обновления компоненты не будут препятствовать установке Visual Studio.
Освободите место. Удалите ненужные файлы и приложения с системного диска. Например, запустите приложение очистки диска.
Проверьте требования к системе. Так вы узнаете, может ли ваш компьютер поддерживать Visual Studio 2022.
Примените актуальные обновления Windows. Эти обновления гарантируют, что на компьютере установлены последние обновления для системы безопасности и необходимые системные компоненты для Visual Studio.
Перезагрузите систему. Перезагрузка гарантирует, что ожидающие установки или обновления компоненты не будут препятствовать установке Visual Studio.
Освободите место. Удалите ненужные файлы и приложения с системного диска. Например, запустите приложение очистки диска.
Сведения об использовании предыдущих версий Visual Studio параллельно с Visual Studio 2019 см. в разделе Целевая платформа и совместимость для Visual Studio 2019.
Visual Studio 2022 можно установить параллельно с предыдущими версиями. Дополнительные сведения см. в разделе Visual Studio 2022: выбор платформы и совместимость и Параллельная установка версий Visual Studio.
Шаг 2. Скачивание Visual Studio
Теперь скачайте файл начального загрузчика Visual Studio.
Для этого нажмите кнопку ниже, выберите нужный выпуск Visual Studio, щелкните Сохранить, а затем Открыть папку.
Для этого нажмите кнопку ниже, выберите нужный выпуск Visual Studio и сохраните его в папке Загрузки.
Шаг 3. Установка установщика Visual Studio
Запустите файл начального загрузчика, чтобы установить Visual Studio Installer. Новый установщик имеет меньший размер и включает все необходимое для установки и настройки Visual Studio.
В папке Загрузки дважды щелкните файл начального загрузчика, имя которого совпадает с именем одного из следующих файлов или похоже на них:
Если появляется оповещение системы контроля учетных записей, нажмите кнопку Да.
Мы попросим вас принять условия лицензии и заявление о конфиденциальности корпорации Майкрософт. Нажмите Продолжить.
Шаг 4. Выбор рабочих нагрузок
Когда завершится установка программы установки, вы можете с ее помощью выбрать нужные наборы функций (рабочих нагрузок). Вот как это сделать.
Найдите нужную рабочую нагрузку в Visual Studio Installer.
Например, выберите рабочую нагрузку «ASP.NET и разработка веб-приложений». В нее входит основной редактор кода по умолчанию, который предоставляет базовую поддержку редактирования кода для более чем 20 языков, возможность открывать и изменять код в любой папке без наличия проекта и интегрированное управление исходным кодом.
Выбрав нужные рабочие нагрузки, нажмите кнопку Установить.
Далее будут отображаться экраны состояния, на которых демонстрируется ход установки Visual Studio.
Выберите нужную рабочую нагрузку в Visual Studio Installer.
Выбрав нужные рабочие нагрузки, нажмите кнопку Установить.
Далее будут отображаться экраны состояния, на которых демонстрируется ход установки Visual Studio.
В любой момент после установки можно установить рабочие нагрузки или компоненты, которые не были установлены изначально. Если среда Visual Studio открыта, выберите пункт Сервис>Получить средства и компоненты. ; откроется Visual Studio Installer. Или откройте Visual Studio Installer из меню «Пуск». Здесь можно выбрать рабочие нагрузки или компоненты, которые нужно установить. Затем выберите Изменить.
Шаг 5. Выбор отдельных компонентов (необязательно)
Если вы не хотите пользоваться функцией рабочих нагрузок для настройки установки Visual Studio или хотите добавить дополнительные компоненты, которые не устанавливает рабочая нагрузка, это можно сделать путем установки или добавления отдельных компонентов на вкладке Отдельные компоненты. Выберите нужные компоненты и следуйте указаниям.
Шаг 6. Установка языковых пакетов (необязательно)
По умолчанию при первом запуске установщик пытается использовать язык операционной системы. Чтобы установить Visual Studio на нужном языке, выберите в Visual Studio Installer вкладку Языковые пакеты и следуйте указаниям.
Изменение языка установщика из командной строки
Шаг 7. Выбор расположения установки (дополнительно)
Вы можете уменьшить место, занимаемое установкой Visual Studio на системном диске. Вы можете переместить кэш загрузки, общие компоненты, пакеты SDK и средства на другие диски и оставить Visual Studio на самом быстром диске.
Вы можете уменьшить место, занимаемое установкой Visual Studio на системном диске. Дополнительные сведения см. в разделе Выбор расположений установки.
Вы можете выбрать другой диск для Visual Studio IDE или кэша загрузки только в том случае, если вы устанавливаете Visual Studio впервые. Если вы уже установили ее и хотите изменить диск, необходимо удалить Visual Studio, а затем переустановить ее.
Если вы уже установили Visual Studio на компьютере, вы не сможете изменить путь к общим компонентам, инструментам и пакетам SDK, этот пункт будет неактивен. Это общее расположение для всех установок Visual Studio.
Шаг 8. Начало разработки
Когда установка Visual Studio завершится, нажмите кнопку Запустить, чтобы приступить к разработке в Visual Studio.
На начальном экране выберите Создать проект.
В поле поиска введите тип приложения, которое вы хотите создать, чтобы просмотреть список доступных шаблонов. Список шаблонов зависит от рабочих нагрузок, выбранных во время установки. Чтобы просмотреть различные шаблоны, выберите разные рабочие нагрузки.
Можно также фильтровать поиск по определенному языку программирования с помощью раскрывающегося списка Язык. Вы также можете выбирать фильтры из списка Платформа и Тип проекта.
Новый проект откроется в Visual Studio, и вы можете приступить к написанию кода!
Когда установка Visual Studio завершится, нажмите кнопку Запустить, чтобы приступить к разработке в Visual Studio.
На начальном экране выберите Создать проект.
В поле поиска шаблонов введите тип приложения, которое вы хотите создать, чтобы просмотреть список доступных шаблонов. Список шаблонов зависит от рабочих нагрузок, выбранных во время установки. Чтобы просмотреть различные шаблоны, выберите разные рабочие нагрузки.
Можно также фильтровать поиск по определенному языку программирования с помощью раскрывающегося списка Язык. Вы также можете выбирать фильтры из списка Платформа и Тип проекта.
Новый проект откроется в Visual Studio, и вы можете приступить к написанию кода!
Поддержка или устранение неполадок
Иногда возникают проблемы. Если установить Visual Studio не удается, воспользуйтесь пошаговыми указаниями в статье Устранение неполадок при установке и обновлении Visual Studio.
Ниже приведены несколько дополнительных вариантов:
Install Visual Studio
Welcome to Visual Studio 2019! In this version, it’s easy to choose and install just the features you need. And because of its reduced minimum footprint, it installs quickly and with less system impact.
Welcome to Visual Studio 2022! In this version, it’s easy to choose and install just the features you need.
This topic applies to Visual Studio on Windows. For Visual Studio for Mac, see Install Visual Studio for Mac.
Want to know more about what else is new in this version? See our release notes.
Want to know more about what else is new in this version? See our release notes.
Ready to install? We’ll walk you through it, step-by-step.
Before you begin installing Visual Studio:
Check the system requirements. These requirements help you know whether your computer supports Visual Studio 2019.
Apply the latest Windows updates. These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.
Reboot. The reboot ensures that any pending installs or updates don’t hinder your Visual Studio install.
Free up space. Remove unneeded files and applications from your system drive by, for example, running the Disk Cleanup app.
Check the system requirements. These requirements help you know whether your computer supports Visual Studio 2022.
Apply the latest Windows updates. These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.
Reboot. The reboot ensures that any pending installs or updates don’t hinder your Visual Studio install.
Free up space. Remove unneeded files and applications from your system drive by, for example, running the Disk Cleanup app.
For questions about running previous versions of Visual Studio side by side with Visual Studio 2019, see Visual Studio 2019 Platform Targeting and Compatibility.
You can install Visual Studio 2022 side by side with previous versions. For more information, see Visual Studio 2022 platform targeting and compatibility and Install Visual Studio versions side-by-side.
Next, download the Visual Studio bootstrapper file.
To do so, choose the following button, choose the edition of Visual Studio that you want, choose Save, and then choose Open folder.
To do so, select the following button, choose the edition of Visual Studio that you want, and then save to your Downloads folder.
Run the bootstrapper file to install the Visual Studio Installer. This new lightweight installer includes everything you need to both install and customize Visual Studio.
From your Downloads folder, double-click the bootstrapper that matches or is similar to one of the following files:
If you receive a User Account Control notice, choose Yes.
We’ll ask you to acknowledge the Microsoft License Terms and the Microsoft Privacy Statement. Choose Continue.
After the installer is installed, you can use it to customize your installation by selecting the feature sets—or workloads—that you want. Here’s how.
Find the workload you want in the Visual Studio Installer.
For example, choose the «ASP.NET and web development» workload. It comes with the default core editor, which includes basic code editing support for over 20 languages, the ability to open and edit code from any folder without requiring a project, and integrated source code control.
After you choose the workload(s) you want, choose Install.
Next, status screens appear that show the progress of your Visual Studio installation.
Select the workload you want in the Visual Studio Installer.
Review the workload summaries to decide which workload supports the features you need. For example, choose the ASP.NET and web development workload to edit ASP.NET Web pages with Web Live Preview or build responsive web apps with Blazor, or choose from Desktop & Mobile workloads to develop cross-platform apps with C#, or C++ projects that target C++20.
After you choose the workload(s) you want, select Install.
Next, status screens appear that show the progress of your Visual Studio installation.
At any time after installation, you can install workloads or components that you didn’t install initially. If you have Visual Studio open, go to Tools > Get Tools and Features. which opens the Visual Studio Installer. Or, open the Visual Studio Installer from the Start menu. From there, you can choose the workloads or components that you wish to install. Then, choose Modify.
If you don’t want to use the Workloads feature to customize your Visual Studio installation, or you want to add more components than a workload installs, you can do so by installing or adding individual components from the Individual components tab. Choose what you want, and then follow the prompts.
By default, the installer program tries to match the language of the operating system when it runs for the first time. To install Visual Studio in a language of your choosing, choose the Language packs tab from the Visual Studio Installer, and then follow the prompts.
Change the installer language from the command line
You can reduce the installation footprint of Visual Studio on your system drive. You can choose to move the download cache, shared components, SDKs, and tools to different drives, and keep Visual Studio on the drive that runs it the fastest.
You can reduce the installation footprint of Visual Studio on your system drive. For more information, see Select installation locations.
You can select a different drive for Visual Studio IDE or download cache only when you first install Visual Studio. If you’ve already installed it and want to change drives, you must uninstall Visual Studio and then reinstall it.
If you’ve installed Visual Studio on your computer before, you won’t be able to change the Shared components, tools, and SDKs path and it will appear greyed out. This location is shared by all installations of Visual Studio.
After Visual Studio installation is complete, select the Launch button to get started developing with Visual Studio.
On the start window, choose Create a new project.
In the search box, enter the type of app you want to create to see a list of available templates. The list of templates depends on the workloads that you chose during installation. To see different templates, choose different workloads.
You can also filter your search for a specific programming language by using the Language drop-down list. You can filter by using the Platform list and the Project type list, too.
Visual Studio opens your new project, and you’re ready to code!
After your Visual Studio installation is complete, select the Launch button to get started developing with Visual Studio.
On the start window, choose Create a new project.
In the template search box, enter the type of app you want to create to see a list of available templates. The list of templates depends on the workloads that you chose during installation. To see different templates, choose different workloads.
You can also filter your search for a specific programming language by using the Language drop-down list. You can filter by using the Platform list and the Project type list, too.
Visual Studio opens your new project, and you’re ready to code!
Support or troubleshooting
Sometimes, things can go wrong. If your Visual Studio installation fails, see Troubleshoot Visual Studio installation and upgrade issues for step-by-step guidance.
Here are a few more support options:
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Установка Visual Studio
Вас приветствует Visual Studio 2019! В этой версии можно легко выбрать и установить только необходимые компоненты. Поскольку она занимает меньше памяти, она быстро устанавливается и при установке меньше влияет на систему.
Вас приветствует Visual Studio 2022! В этой версии можно легко выбрать и установить только необходимые компоненты.
Этот раздел относится к Visual Studio в Windows. Информацию о Visual Studio для Mac см. в статье Установка Visual Studio для Mac.
Хотите ознакомиться с другими новыми возможностями этой версии? Обратитесь к заметкам о выпуске.
Хотите ознакомиться с другими новыми возможностями этой версии? Обратитесь к заметкам о выпуске.
Готовы к установке? Мы последовательно опишем каждое действие.
Шаг 1. Подготовка компьютера к установке Visual Studio
Перед началом установки Visual Studio:
Проверьте требования к системе. Так вы узнаете, поддерживает ли ваш компьютер Visual Studio 2019.
Примените актуальные обновления Windows. Эти обновления гарантируют, что на компьютере установлены последние обновления для системы безопасности и необходимые системные компоненты для Visual Studio.
Перезагрузите систему. Перезагрузка гарантирует, что ожидающие установки или обновления компоненты не будут препятствовать установке Visual Studio.
Освободите место. Удалите ненужные файлы и приложения с системного диска. Например, запустите приложение очистки диска.
Проверьте требования к системе. Так вы узнаете, может ли ваш компьютер поддерживать Visual Studio 2022.
Примените актуальные обновления Windows. Эти обновления гарантируют, что на компьютере установлены последние обновления для системы безопасности и необходимые системные компоненты для Visual Studio.
Перезагрузите систему. Перезагрузка гарантирует, что ожидающие установки или обновления компоненты не будут препятствовать установке Visual Studio.
Освободите место. Удалите ненужные файлы и приложения с системного диска. Например, запустите приложение очистки диска.
Сведения об использовании предыдущих версий Visual Studio параллельно с Visual Studio 2019 см. в разделе Целевая платформа и совместимость для Visual Studio 2019.
Visual Studio 2022 можно установить параллельно с предыдущими версиями. Дополнительные сведения см. в разделе Visual Studio 2022: выбор платформы и совместимость и Параллельная установка версий Visual Studio.
Шаг 2. Скачивание Visual Studio
Теперь скачайте файл начального загрузчика Visual Studio.
Для этого нажмите кнопку ниже, выберите нужный выпуск Visual Studio, щелкните Сохранить, а затем Открыть папку.
Для этого нажмите кнопку ниже, выберите нужный выпуск Visual Studio и сохраните его в папке Загрузки.
Шаг 3. Установка установщика Visual Studio
Запустите файл начального загрузчика, чтобы установить Visual Studio Installer. Новый установщик имеет меньший размер и включает все необходимое для установки и настройки Visual Studio.
В папке Загрузки дважды щелкните файл начального загрузчика, имя которого совпадает с именем одного из следующих файлов или похоже на них:
Если появляется оповещение системы контроля учетных записей, нажмите кнопку Да.
Мы попросим вас принять условия лицензии и заявление о конфиденциальности корпорации Майкрософт. Нажмите Продолжить.
Шаг 4. Выбор рабочих нагрузок
Когда завершится установка программы установки, вы можете с ее помощью выбрать нужные наборы функций (рабочих нагрузок). Вот как это сделать.
Найдите нужную рабочую нагрузку в Visual Studio Installer.
Например, выберите рабочую нагрузку «ASP.NET и разработка веб-приложений». В нее входит основной редактор кода по умолчанию, который предоставляет базовую поддержку редактирования кода для более чем 20 языков, возможность открывать и изменять код в любой папке без наличия проекта и интегрированное управление исходным кодом.
Выбрав нужные рабочие нагрузки, нажмите кнопку Установить.
Далее будут отображаться экраны состояния, на которых демонстрируется ход установки Visual Studio.
Выберите нужную рабочую нагрузку в Visual Studio Installer.
Выбрав нужные рабочие нагрузки, нажмите кнопку Установить.
Далее будут отображаться экраны состояния, на которых демонстрируется ход установки Visual Studio.
В любой момент после установки можно установить рабочие нагрузки или компоненты, которые не были установлены изначально. Если среда Visual Studio открыта, выберите пункт Сервис>Получить средства и компоненты. ; откроется Visual Studio Installer. Или откройте Visual Studio Installer из меню «Пуск». Здесь можно выбрать рабочие нагрузки или компоненты, которые нужно установить. Затем выберите Изменить.
Шаг 5. Выбор отдельных компонентов (необязательно)
Если вы не хотите пользоваться функцией рабочих нагрузок для настройки установки Visual Studio или хотите добавить дополнительные компоненты, которые не устанавливает рабочая нагрузка, это можно сделать путем установки или добавления отдельных компонентов на вкладке Отдельные компоненты. Выберите нужные компоненты и следуйте указаниям.
Шаг 6. Установка языковых пакетов (необязательно)
По умолчанию при первом запуске установщик пытается использовать язык операционной системы. Чтобы установить Visual Studio на нужном языке, выберите в Visual Studio Installer вкладку Языковые пакеты и следуйте указаниям.
Изменение языка установщика из командной строки
Шаг 7. Выбор расположения установки (дополнительно)
Вы можете уменьшить место, занимаемое установкой Visual Studio на системном диске. Вы можете переместить кэш загрузки, общие компоненты, пакеты SDK и средства на другие диски и оставить Visual Studio на самом быстром диске.
Вы можете уменьшить место, занимаемое установкой Visual Studio на системном диске. Дополнительные сведения см. в разделе Выбор расположений установки.
Вы можете выбрать другой диск для Visual Studio IDE или кэша загрузки только в том случае, если вы устанавливаете Visual Studio впервые. Если вы уже установили ее и хотите изменить диск, необходимо удалить Visual Studio, а затем переустановить ее.
Если вы уже установили Visual Studio на компьютере, вы не сможете изменить путь к общим компонентам, инструментам и пакетам SDK, этот пункт будет неактивен. Это общее расположение для всех установок Visual Studio.
Шаг 8. Начало разработки
Когда установка Visual Studio завершится, нажмите кнопку Запустить, чтобы приступить к разработке в Visual Studio.
На начальном экране выберите Создать проект.
В поле поиска введите тип приложения, которое вы хотите создать, чтобы просмотреть список доступных шаблонов. Список шаблонов зависит от рабочих нагрузок, выбранных во время установки. Чтобы просмотреть различные шаблоны, выберите разные рабочие нагрузки.
Можно также фильтровать поиск по определенному языку программирования с помощью раскрывающегося списка Язык. Вы также можете выбирать фильтры из списка Платформа и Тип проекта.
Новый проект откроется в Visual Studio, и вы можете приступить к написанию кода!
Когда установка Visual Studio завершится, нажмите кнопку Запустить, чтобы приступить к разработке в Visual Studio.
На начальном экране выберите Создать проект.
В поле поиска шаблонов введите тип приложения, которое вы хотите создать, чтобы просмотреть список доступных шаблонов. Список шаблонов зависит от рабочих нагрузок, выбранных во время установки. Чтобы просмотреть различные шаблоны, выберите разные рабочие нагрузки.
Можно также фильтровать поиск по определенному языку программирования с помощью раскрывающегося списка Язык. Вы также можете выбирать фильтры из списка Платформа и Тип проекта.
Новый проект откроется в Visual Studio, и вы можете приступить к написанию кода!
Поддержка или устранение неполадок
Иногда возникают проблемы. Если установить Visual Studio не удается, воспользуйтесь пошаговыми указаниями в статье Устранение неполадок при установке и обновлении Visual Studio.
Ниже приведены несколько дополнительных вариантов:
Install Visual Studio
Welcome to Visual Studio 2019! In this version, it’s easy to choose and install just the features you need. And because of its reduced minimum footprint, it installs quickly and with less system impact.
Welcome to Visual Studio 2022! In this version, it’s easy to choose and install just the features you need.
This topic applies to Visual Studio on Windows. For Visual Studio for Mac, see Install Visual Studio for Mac.
Want to know more about what else is new in this version? See our release notes.
Want to know more about what else is new in this version? See our release notes.
Ready to install? We’ll walk you through it, step-by-step.
Before you begin installing Visual Studio:
Check the system requirements. These requirements help you know whether your computer supports Visual Studio 2019.
Apply the latest Windows updates. These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.
Reboot. The reboot ensures that any pending installs or updates don’t hinder your Visual Studio install.
Free up space. Remove unneeded files and applications from your system drive by, for example, running the Disk Cleanup app.
Check the system requirements. These requirements help you know whether your computer supports Visual Studio 2022.
Apply the latest Windows updates. These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.
Reboot. The reboot ensures that any pending installs or updates don’t hinder your Visual Studio install.
Free up space. Remove unneeded files and applications from your system drive by, for example, running the Disk Cleanup app.
For questions about running previous versions of Visual Studio side by side with Visual Studio 2019, see Visual Studio 2019 Platform Targeting and Compatibility.
You can install Visual Studio 2022 side by side with previous versions. For more information, see Visual Studio 2022 platform targeting and compatibility and Install Visual Studio versions side-by-side.
Next, download the Visual Studio bootstrapper file.
To do so, choose the following button, choose the edition of Visual Studio that you want, choose Save, and then choose Open folder.
To do so, select the following button, choose the edition of Visual Studio that you want, and then save to your Downloads folder.
Run the bootstrapper file to install the Visual Studio Installer. This new lightweight installer includes everything you need to both install and customize Visual Studio.
From your Downloads folder, double-click the bootstrapper that matches or is similar to one of the following files:
If you receive a User Account Control notice, choose Yes.
We’ll ask you to acknowledge the Microsoft License Terms and the Microsoft Privacy Statement. Choose Continue.
After the installer is installed, you can use it to customize your installation by selecting the feature sets—or workloads—that you want. Here’s how.
Find the workload you want in the Visual Studio Installer.
For example, choose the «ASP.NET and web development» workload. It comes with the default core editor, which includes basic code editing support for over 20 languages, the ability to open and edit code from any folder without requiring a project, and integrated source code control.
After you choose the workload(s) you want, choose Install.
Next, status screens appear that show the progress of your Visual Studio installation.
Select the workload you want in the Visual Studio Installer.
Review the workload summaries to decide which workload supports the features you need. For example, choose the ASP.NET and web development workload to edit ASP.NET Web pages with Web Live Preview or build responsive web apps with Blazor, or choose from Desktop & Mobile workloads to develop cross-platform apps with C#, or C++ projects that target C++20.
After you choose the workload(s) you want, select Install.
Next, status screens appear that show the progress of your Visual Studio installation.
At any time after installation, you can install workloads or components that you didn’t install initially. If you have Visual Studio open, go to Tools > Get Tools and Features. which opens the Visual Studio Installer. Or, open the Visual Studio Installer from the Start menu. From there, you can choose the workloads or components that you wish to install. Then, choose Modify.
If you don’t want to use the Workloads feature to customize your Visual Studio installation, or you want to add more components than a workload installs, you can do so by installing or adding individual components from the Individual components tab. Choose what you want, and then follow the prompts.
By default, the installer program tries to match the language of the operating system when it runs for the first time. To install Visual Studio in a language of your choosing, choose the Language packs tab from the Visual Studio Installer, and then follow the prompts.
Change the installer language from the command line
You can reduce the installation footprint of Visual Studio on your system drive. You can choose to move the download cache, shared components, SDKs, and tools to different drives, and keep Visual Studio on the drive that runs it the fastest.
You can reduce the installation footprint of Visual Studio on your system drive. For more information, see Select installation locations.
You can select a different drive for Visual Studio IDE or download cache only when you first install Visual Studio. If you’ve already installed it and want to change drives, you must uninstall Visual Studio and then reinstall it.
If you’ve installed Visual Studio on your computer before, you won’t be able to change the Shared components, tools, and SDKs path and it will appear greyed out. This location is shared by all installations of Visual Studio.
After Visual Studio installation is complete, select the Launch button to get started developing with Visual Studio.
On the start window, choose Create a new project.
In the search box, enter the type of app you want to create to see a list of available templates. The list of templates depends on the workloads that you chose during installation. To see different templates, choose different workloads.
You can also filter your search for a specific programming language by using the Language drop-down list. You can filter by using the Platform list and the Project type list, too.
Visual Studio opens your new project, and you’re ready to code!
After your Visual Studio installation is complete, select the Launch button to get started developing with Visual Studio.
On the start window, choose Create a new project.
In the template search box, enter the type of app you want to create to see a list of available templates. The list of templates depends on the workloads that you chose during installation. To see different templates, choose different workloads.
You can also filter your search for a specific programming language by using the Language drop-down list. You can filter by using the Platform list and the Project type list, too.
Visual Studio opens your new project, and you’re ready to code!
Support or troubleshooting
Sometimes, things can go wrong. If your Visual Studio installation fails, see Troubleshoot Visual Studio installation and upgrade issues for step-by-step guidance.
Here are a few more support options:
Visual Studio Code – редактор кода для Linux, OS X и Windows
За свою долгую историю существования Microsoft выпустил немало инструментов разработки. Но так уж сложилось что на слуху у всех только лишь Visual Studio – большая и мощная IDE «комбайн» предназначенная для всего и вся. Развивается этот продукт уже более двух десятков лет и вобрал в себя самые разные функции. Многим этот инструментарий нравится и иногда даже задавали вопрос – будет ли перенесен Visual Studio на другие платформы. На что чаще всего получали ответ нет. Наверное, понятно почему, в целом такое портирование будет дорогим и неоправданно сложным, уж очень много всего в этой IDE завязано на Windows.
И вот, этой весной для многих неожиданностью было то что Microsoft представил новый продукт под названием Visual Studio Code, да еще и работающий сразу на трех платформах, Linux, OS X и Windows. Не замахиваясь на все функции полноценной IDE, внутри Microsoft решили переосмыслить подход, по которому строится основной инструментарий программиста и начали с самого главного – редактора кода. Visual Studio Code это именно редактор, но при этом обладающий функциями IDE, полагающийся на расширения.
Уже сейчас вы можете использовать Visual Studio Code для создания веб-проектов ASP.NET 5 или Node.js (в чем-то даже удобнее чем в «взрослой» Visual Studio), использовать различные языки, такие как JavaScript, TypeScript, C#, работать с пакетными менеджерами npm, скаффолдингом yeoman и даже осуществлять отладку. Плюсом ко всему будет отличный «интеллисенс», поддержка сниппетов кода, рефакторинг, навигация, многооконность, поддержка git и многое другое.
Установка Visual Studio Code
Mac OS X
Совет: если вы хотите чтобы Visual Studio Code стартовал из терминала добавьте в
Linux
Совет: если вы хотите чтобы Visual Studio Code стартовал из терминала добавьте на него ссылку
Windows
Совет: если вы хотите чтобы Visual Studio Code стартовал из терминала сделайте logon/logoff, соответствующие пути к файлу прописываются в переменной PATH самим установщиком
Дополнительные инструменты
Без инструментария Visual Studio Code годится разве что для простого редактирования файлов, для полноценной работы понадобится сопутствующий инструментарий, который зависит от ваших целей и задач:
Начало работы
Чтобы попробовать в деле VS Code, проще всего создать веб-проект Node. Для этого установите Node на свой компьютер (ссылка выше) и выполните следующие команды:
В текущем каталоге будет создан проект, который можно будет открыть в Visual Studio Code. Для того чтобы проверить, что все работает как надо, выполните команду npm start и запустите браузер по адресу http://localhost:3000.
После всех этих действий просто запустите VS Code в папке с проектом
Если вы хотите попробовать возможности VS Code на примере ASP.NET 5 то можете воспользоваться инструкцией по адресу https://code.visualstudio.com/Docs/ASPnet5.
Базовые возможности Visual Studio Code
Как и многие редакторы кода, VS Code использует распространенную схему расположения основных элементов – слева обозреватель файлов, справа редактор кода. В дополнение к этому есть специфичные элементы, обеспечивающие навигацию и выполнение специальных команд.
Файлы, папки, и проекты
Расположение основных элементов
VS Code обладает интуитивно понятной и простой схемой расположения основных элементов. Интерфейс разделен на четыре основных блока, это:
Редактор VS Code может открыть для редактирования на экране до трех файлов одновременно, располагая их друг за другом справа. Открыть дополнительные редакторы можно различными способами:
Ctrl (Mac: Cmd) и кликнуть на файле в обозревателе
Ctrl+\ для того чтобы разделить активный текущий редактор на два
Open to the Side в контекстном меню файла в обозревателе
Совет: Вы можете переместить сайдбар слева на право с помощью меню View, Move Sidebar а так же включить его видимость с помощью клавиатуры (Ctrl+B).
Палитра команд
Самым главным инструментом взаимодействия с редактором в VS Code является палитра команд. Вызвать ее можно через клавиатуру, нажав на комбинацию Ctrl+Shift+P. Множество команд перечисленных в палитре тоже привязаны к клавишам.
Введите в строку команды знак вопроса? и тогда вы получите перечень команд которые работают в текущем контексте:
Некоторые часто используемые команды:
Обозреватель
Обозреватель предназначен для открытия и управления файлами находящимися в папке вашего проекта. Вы можете осуществлять множество привычных операций по созданию, изменению имени, удалению файлов и папок, и их перемещению.
Файлы, которые вы редактировали или открывали двойным щелчком в обозревателе, помещаются в верхнюю часть обозревателя и получают статус Working files:
Автосохранение
По умолчанию, VS Code работает в режиме явного сохранения, которое вы можете выполнить, нажав на комбинацию Ctrl+S. Этот режим совместим с большинством инструментов следящих за статусом файлов (например bower). Можно включить и режим автоматического сохранения (Auto Save), нажав Ctrl+Shift+P и набрать auto.
Поиск
Нажимите Ctrl+Shift+F и введите интересующую вас фразу. Результаты поиска будут сгруппированы, в дополнение вы можете развернуть узел группы чтобы посмотреть множественные вхождения. В строке поиска поддерживаются регулярные выражения.
Более детальный поиск может быть осуществлен с помощью команды Ctrl+Shift+J. Введите в дополнительные поля критерии поиска.
Возможности редактора
Подсказки IntelliSence
Где бы вы не находились в вашем коде, нажав на Ctrl+Space будет выведено окно подсказки IntelliSence. При наборе кода редактор будет показывать его автоматически.
Подсказки параметров
Для перегруженных функций вы можете листать варианты реализации используя клавиши Up и Down.
Сниппеты кода
VS Code поддерживает аббревиатуры Emmet. Вы можете использовать их при редактировании файлов HTML, Razor, CSS, Less, Sass, XML или Jade. Основной перечень аббревиатур можно посмотреть по адресу http://docs.emmet.io/cheat-sheet/.
Переход к определению символа
Нажав на F12 вы перейдете к определению символа. Если нажать Ctrl и провести курсором по символу вы увидите определение в дополнительном окне.
Переход к методу или переменной
Нажав на Ctrl+Shift+O вы откроете перечень методов в файле, в дополнение вы можете нажать двоеточие: и методы будут сгруппированы по типу. Нажав на Up и Down выберите нужный метод и курсор в редакторе перейдет на строку где находится выбранный метод.
Для языков C# и TypeScript вы можете использовать комбинацию Ctrl+T и набрать нужный метод или переменную, при этом будет осуществлен поиск по всем файлам в проекте.
Просмотр определения символа
Если вам необходимо быстро посмотреть на определение символа или на референсы, для того чтобы вспомнить детали реализации или использования, можно использовать поиск или переход к определению символов, что не всегда удобно так как переключает контекст.
В этом случае можно воспользоваться командами Reference Search (Shift+F12) или Peek Definition (Alt+F12) и результаты поиска будут отображаться в инлайн окошке:
Переименование методов и переменных
Нажав F2 вы можете изменить имя метода или переменной. Стандартная операция рефакторинга, но пока она поддерживается только для языков C# и TypeScript.
Отладка
В VS Code входит отладчик. Его возможности пока ограничены, и работают не на всех платформах. Тем не менее, вы можете использовать отладчик для языков JavaScript и TypeScript на всех платформах, а для C# и F# на платформах OS X и Linux.
Сохраните конфигурационный файл и выберите пункт Launch в меню, установите точку останова и нажмите F5 для старта отладки.
Отладчик позволяет просматривать значения текущих переменных:
Более подробно о возможностях отладчика можно почитать по адресу https://code.visualstudio.com/Docs/debugging в том числе о том как сконфигурировать Mono для отладки C# и F# кода на платформах OS X и Linux.
Контроль версий
VS Code интегрирован с системой контроля версий git, и поддерживает большинство команд. В версии 0.5 был зафиксирован ряд ошибок связанных с интеграцией. Поддерживаются локальные и удаленные репозитарии.
Совет: установите credential helper для того чтобы не получать постоянные запросы на ввод данных учетной записи https://help.github.com/articles/caching-your-github-password-in-git/
Конфликты
VS Code позволяет осуществлять слияния и разрешение конфликтов при работе с системой контроля версий:
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Create an offline installation package of Visual Studio for local installation
We designed Visual Studio to work well in various network and computer configurations. For all scenarios involving the local machine, we recommend that you use the Visual Studio Installer, which is a small file that checks for updates on a regular basis and helps you stay current with all the latest fixes and features. The information on this page discusses how to create an offline installation package of files for installation on the local machine.
If you are an enterprise IT administrator who wants to perform a deployment of Visual Studio to a network of client workstations, or if you need to create an installation package of files to transfer to or install onto another machine, refer to our Visual Studio Administrators Guide and the Create a network-based installation of Visual Studio documentation.
Use the «Download all, then install» feature
Sometimes online access is problematic. For example, you might have an unreliable internet connection or your internet connection may have low bandwidth. For situations like these, we’ve made other methods available for acquiring Visual Studio. You can use the Download all, then install feature from the Visual Studio Installer to download an installation package on the local machine before you install, or you can use the command line to create a local installation package to install later.
To download a local installation package, select the Download all, then install option in the dropdown at the bottom of the Workloads tab of the Visual Studio Installer. The purpose of this feature is to frontload the downloading of the Visual Studio packages onto the same computer that you plan on eventually installing Visual Studio on. By downloading the packages locally first, you can then safely disconnect from the internet before you install Visual Studio.
The Download all, then install functionality downloads a Visual Studio installation package that is customized to the local machine. Do not try to transfer this downloaded installation package to another computer, as it’s not designed to work that way. Instead, if you want to download an installation package and transfer it to or install it on another machine, then you’ll need to create a layout as described in the Create a network-based installation of Visual Studio documentation.
You can also configure future updates of this instance of Visual Studio to respect the Download all, then install behavior. For more information, refer to the Customize update settings documentation.
Use the command line to create a local layout
Download the bootstrapper for the edition of Visual Studio you want and copy it into the directory that you want to serve as the source location of your local layout. Once the layout is created, you can use it to install Visual Studio. The bootstrapper is the executable that you use to create, update, and perform other Visual Studio installation operations. You must have an internet connection to complete this.
The bootstrappers listed below will always install the latest most secure version of Visual Studio 2019, no matter when you run them. Alternatively, if you want to install a specific version of Visual Studio 2019, go to the Visual Studio 2019 Releases page that has links to the fixed version bootstrappers for each servicing release, and download the one you want. Copy it into the directory that you want to serve as the location of your local layout.
Edition | Bootstrapper |
---|---|
Visual Studio 2019 Professional version 16.11 | vs_professional.exe |
Visual Studio 2019 Enterprise version 16.11 | vs_enterprise.exe |
Visual Studio 2019 Build Tools version 16.11 | vs_buildtools.exe |
The bootstrappers listed below will always install the latest most secure version of Visual Studio 2022 on the Current channel, no matter when you run them. Alternatively, if you want to install a specific version or a specific channel of Visual Studio 2022, go to the Visual Studio 2022 Release History page that has links to the evergreen and fixed version bootstrappers for each servicing release on each channel, and download the one you want. Copy it into the directory that you want to serve as the location of your local layout.
Edition | Bootstrapper |
---|---|
Visual Studio 2022 Community | vs_community.exe |
Visual Studio 2022 Professional | vs_professional.exe |
Visual Studio 2022 Enterprise | vs_enterprise.exe |
Visual Studio 2022 Build Tools | vs_buildtools.exe |
If you previously downloaded a specific bootstrapper file and want to verify what version it will install, here’s how. In Windows, open File Explorer, right-click the bootstrapper file, choose Properties, choose the Details tab, and then view the Product version number. To match that number to a release of Visual Studio, refer to the table at the bottom of the Visual Studio 2019 Releases page.
If you previously downloaded a bootstrapper file and want to verify what version it will install, here’s how. In Windows, open File Explorer, right-click the bootstrapper file, choose Properties and then choose the Details tab. The Product version field will describe the channel and version that the bootstrapper will install. The version number should always be read as «latest servicing version of what is specified», and the channel is Current unless explicitly specified. So, a bootstrapper with a Product version of LTSC 17.0 will install the latest 17.0.x servicing release that is available on the 17.0 LTSC channel. A bootstrapper with a Product version that simply says Visual Studio 2022 will install the latest version of Visual Studio 2022 on the Current channel.
You must have an internet connection to complete this step.
Open a command prompt with administrator privileges, navigate to the directory where you downloaded the bootstrapper into, and use the bootstrapper’s parameters as defined in the Use command-line parameters to install Visual Studio page to create your local layout. Common examples using the Enterprise bootstrapper are illustrated below and in the command-line parameter examples page. You can install a language other than English by changing en-US to a locale from the list of language locales, and you can use the list of components and workloads to further customize your local layout.
To prevent an error, make sure that your full installation path is less than 80 characters.
For C++ desktop development, run:
To create a complete local layout, English only, with all features (this will take a long time—we have lots of features!), run:
A complete local layout of Visual Studio requires a minimum of 41 GB of disk space. For more information, see System requirements.
A complete local layout of Visual Studio requires a minimum of 45 GB of disk space. For more information, see System requirements.
For example, if you created a local installation layout with the following command:
Then use this command to run the installation:
Then use this command to run the installation:
If you’re using Visual Studio Community, you must activate it by logging into the product within 30 days of installation. Activation requires an internet connection.
If you get an error that a signature is invalid, you must install updated certificates. Open the Certificates folder in your local layout. Double-click each of the certificate files, and then click through the Certificate Manager wizard. If you’re asked for a password, leave it blank.
List of language locales
Support or troubleshooting
Sometimes, things can go wrong. If your Visual Studio installation fails, see Troubleshoot Visual Studio installation and upgrade issues for step-by-step guidance.
Here are a few more support options:
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Visual Studio Code on Windows
Installation
Alternatively, you can also download a Zip archive, extract it and run Code from there.
User setup versus system setup
VS Code provides both Windows user and system level setups. Installing the user setup does not require Administrator privileges as the location will be under your user Local AppData (LOCALAPPDATA) folder. User setup also provides a smoother background update experience.
The system setup requires elevation to Administrator privileges and will place the installation under Program Files. This also means that VS Code will be available to all users in the system.
See the Download Visual Studio Code page for a complete list of available installation options.
32-bit versions
If you need to run a 32-bit version of VS Code, both a 32-bit Installer and Zip archive are available.
Updates
VS Code ships monthly releases and supports auto-update when a new release is available. If you’re prompted by VS Code, accept the newest update and it will be installed (you won’t need to do anything else to get the latest bits).
Note: You can disable auto-update if you prefer to update VS Code on your own schedule.
Windows Subsystem for Linux
Windows is a popular operating system and it can be a great cross-platform development environment. This section describes cross-platform features such as the Windows Subsystem for Linux (WSL) and the new Windows Terminal.
Recent Windows build
Make sure you are on a recent Windows 10 build. Check Settings > Windows Update to see if you are up-to-date.
Windows as a developer machine
With WSL, you can install and run Linux distributions on Windows. This enables you to develop and test your source code on Linux while still working locally on your Windows machine.
See the Developing in WSL documentation to learn more or try the Working in WSL introductory tutorial.
New Windows Terminal
Available from the Microsoft Store, the Windows Terminal (Preview) lets you easily open PowerShell, Command Prompt, and WSL terminals in a multiple tab shell.
Next steps
Once you have installed VS Code, these topics will help you learn more about VS Code:
Common questions
What command-line arguments are supported by the Windows Setup?
VS Code uses Inno Setup to create its setup package for Windows. Thus, all the Inno Setup command-line switches are available for use.
Scrolling is laggy and not smooth
On certain devices, editor scrolling is not smooth but laggy for an unpleasant experience. If you notice this issue, make sure you install the Windows 10 October 2018 update where this issue is fixed.
I’m having trouble with the installer
Try using the zip file instead of the installer. To use this, unzip VS Code in your AppData\Local\Programs folder.
Note: When VS Code is installed via a Zip file, you will need to manually update it for each release.
Icons are missing
I installed Visual Studio Code on my Windows 8 machine. Why are some icons not appearing in the workbench and editor?
Using the Command Prompt:
Using the Registry Editor (regedit):
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Downloads
Visual Studio 2022
Community
Powerful IDE, free for students, open-source contributors, and individuals
Professional
Enterprise
Scalable, end-to-end solution for teams of any size
Preview
Get early access to latest features not yet in the main release
Preview
Get early access to latest features not yet in the main release.
A standalone source code editor that runs on Windows, macOS, and Linux. The top pick for Java and web developers, with tons of extensions to support just about any programming language.
By using Visual Studio Code you agree to its license & privacy statement.
Still not sure which tool is best for you? We can help
Visual Studio Code for Windows
Lightweight yet powerful source code editor with tons of extensions for many languages and runtimes.
Hundreds of programming languages supported
Visual Studio Code for Mac
Hundreds of programming languages supported
Visual Studio for Mac
A complete array of development tools and features in native macOS experience for every stage of your software development.
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
July 2018 (version 1.26)
Update 1.26.1: The update addresses these issues.
Downloads: Windows: User System | Mac: 64 bit | Linux 64-bit: deb rpm tarball | 32-bit: deb rpm tarball
Welcome to the July 2018 release of Visual Studio Code. There are a number of significant updates in this version that we hope you will like, some of the key highlights include:
If you’d like to read these release notes online, go to Updates on code.visualstudio.com.
You can also check out this 1.26 release highlights video from Cloud Developer Advocate Brian Clark.
The release notes are arranged in the following sections related to VS Code focus areas. Here are some further updates:
Insiders: Want to see new features as soon as possible? You can download the nightly Insiders build and try the latest updates as soon as they are available. And for the latest Visual Studio Code news, updates, and content, follow us on Twitter @code!
Workbench
Breadcrumbs
When using editor tabs (default), breadcrumbs are displayed in a separate row below the editor title. If you are not using editor tabs, breadcrumbs show as an interactive file path next to the title.
Breadcrumbs always show the file path and, with the help of extensions, the symbol path up to the cursor position. The symbols shown are the same as in Outline view and Go to Symbol and so existing extensions will just work with breadcrumbs.
You can also interact with breadcrumbs without the picker. Press ⇧⌘; (Windows, Linux Ctrl+Shift+; ) to focus the last element, use ← (Windows, Linux Left ) and → (Windows, Linux Right ) to navigate, and use Space to reveal the element in the editor.
Problems panel Quick Fixes
You can now apply Quick Fixes from the Problems panel. A light bulb indicating Quick Fixes is shown when you hover or select a problem entry. Quick Fixes can be applied by clicking on the light bulb or by opening the context menu for the problem entry.
Note: The light bulb indicator is shown only if the extension contributing Quick Fixes provides Diagnostic information associated with the Quick Fix.
User setup for Windows
Announced last release, the user setup package for Windows is now available on stable. Installing the user setup does not require Administrator privileges as the location will be under your user Local AppData (LOCALAPPDATA) folder. User setup also provides a smoother background update experience.
If you are a current user of the system-wide Windows setup, you will be prompted to install user setup, which we recommend using from now on. Don’t worry, all your settings and extensions will be kept during the transition. During installation, you will also be prompted to uninstall the system-wide setup.
Grid: Automated maximize of minimized editors
One feature we lost during the introduction of the grid editor layout last milestone was the ability to have editors automatically maximize when you focus them and they are in their minimized state. This feature is now working as before:
Note: You can always maximize the active editor via View: Maximize Editor Group ( workbench.action.minimizeOtherEditors ) or reset all editor sizes via View: Reset Editor Group Sizes ( workbench.action.evenEditorWidths ).
View menu cleanup
The View menu was growing very large and we decided to move many of the entries into a separate Appearance sub-menu to clean it up.
Copy relative path
Note: You can get to this action from the context menu (for example, on a tab or a file in the File Explorer) by pressing and holding the Shift key ( Alt key on macOS) before opening the menu.
Custom view: File resource decorations
Custom views showing file resources will now have file decorations (Git, problems) shown. You can disable them using the settings explorer.decorations.colors and explorer.decorations.badges which disables them in File Explorer, Open Editors and Custom views.
Run npm scripts from package.json
You can now run an npm script in a package.json file from the hover as shown below or from the context menu.
Opening folder URIs
The following CLI command opens the VS Code GitHub repository as a folder, if you have RemoteHub extension installed.
Rapid render
On startup, the basic workbench layout is now restored much faster. The restoration order is Activity Bar, Side Bar, and Status Bar, followed by headers and icons, and then the Explorer and editor region are populated.
Rapid render is meant to improve perceived performance as the time you are looking at an empty canvas is reduced. We have more ideas how to improve rendering performance and we are interested in your feedback.
Output panel
VS Code’s main, window, and shared processes each have their own logging channel, where you can now view the telemetry events sent when the log level is set to «Trace». Data common to all telemetry events will not be visible here for the sake of brevity. The complete payload of each telemetry event is logged in a separate log file named telemetry.log which you can access via the Developer: Open Log File. command.
Offline mode
Some users do not want any outgoing network requests from VS Code unless they specifically invoke features that require online access. To support this offline mode, we have added new settings to turn off features such as automatic extension update checking, querying settings for A/B experiments, and fetching of online data for auto-completions.
Below is the complete list of settings to control VS Code features that make network requests:
Accessibility improvements
Integrated Terminal
Column selection
Improved multiline support
Double clicking to select words in the terminal now selects words that are split over lines.
Frontend and backend are now synchronized
The data stream that comes into the Integrated Terminal is now synchronized with the backing pseudoterminal/shell process. This means that the data coming into the terminal can no longer flood the UI thread and cause unresponsiveness, SIGINT (Ctrl+C) should always be responsive, and the time command should return accurate results.
Dynamic texture atlas
The Integrated Terminal now defaults to using a «dynamic texture atlas» for canvas rendering. This changes the caching strategy used by the terminal to store character glyphs. Instead of being a fixed set of glyphs on the default background, glyphs are now added to the texture atlas as they are required, regardless of the background being used. This should reduce the first terminal start up time and the rendering time of characters not using the default background, as well as improving overall rendering performance.
This came in as an upstream community contribution to xterm.js.
Languages
TypeScript 3.0
VS Code now ships with TypeScript 3.0.1. This major update brings support for project references, better support for tuples, and other language and tooling features. You can read more about TypeScript 3.0 here.
Better error reporting
The TypeScript team has done a lot of work to make JavaScript and TypeScript error messages smarter and clearer. Some error messages now include links to relevant locations in the source code.
Messages for unions and other complex types should also be more concise and helpful. For example, a simple type error in JSX could sometimes produce a complex error message like this:
Thanks to TypeScript 3.0, the error is much more readable in VS Code 1.26:
JSX tag completion
JSX tags are now closed automatically when you type > in a JavaScript or TypeScript file:
Add all missing imports Quick Fix
The Add missing import Quick Fix can now be applied to all missing imports in a JavaScript/TypeScript file:
To use this Quick Fix in JavaScript files, enable semantic checking.
JSX folding
JSX tags are now foldable when using syntax aware folding.
Convert between named imports and namespace imports
Two new refactorings let you quickly convert between named imports and namespace imports in JavaScript and TypeScript:
Clickable links in jsconfig.json and tsconfig.json project files
Quickly navigate jsconfig.json and tsconfig.json project references by Ctrl clicking on project reference paths ( Cmd+click on macOS):
The extends path is now also clickable.
Debugging
Improved stop debug behavior
In previous releases, the Debug: Stop action (found on the Debug toolbar) would always kill a debuggee and its child processes immediately, without giving the debuggee a chance to clean up gracefully. Some users didn’t like this behavior because they were forced to do manual cleanup after stopping a debug session.
In this release, we’ve improved the Debug: Stop action in the following way:
When pressing Stop for the first time, the debuggee is no longer killed immediately but it is requested to shutdown gracefully (and to clean up everything as necessary).
If there are no breakpoints (or problems) in that shutdown code, the debuggee and the debug session will terminate. The user will not see any difference in behavior to previous versions of VS Code.
However, if the debugger hits a breakpoint in the shutdown code or if the debuggee does not terminate properly by itself, then the debug session will not end.
In this case, pressing the Stop button again will force terminate the debuggee. So if you see that a debug session doesn’t end when you press the red Stop button, then press the button again to force a shutdown of the debuggee.
Note: This feature is only supported by debugger extensions that have opted into implementing it. Currently this is only the built-in Node.js debugger. We expect other debug extensions to support this feature soon.
Changed smartStep behavior for Node/Chrome debugging
Previously, «smartStep»: true would cause the Node.js debugger to not stop in source code without source maps. This can happen in two ways:
We changed this because we realized that the old smartStep behavior was too aggressive. Skipping inserted code is usually correct, but skipping in the first scenario only makes sense for some projects and users. In addition, using the skipFiles option in your launch.json configuration file does a better job of covering the case for entire files, since it can target files more precisely and is faster.
So, if you are using smartStep and notice that the debugger is no longer auto-skipping through files without source maps, you can use skipFiles to get the previous behavior back. See Skipping uninteresting code for examples of how to configure skipFiles to skip source code in node_modules, internal node files, or any other files that you don’t want to step through.
Extensions
IntelliSense for extension search
This release makes it easier to search for extensions by adding IntelliSense autocompletions to the extension search field. This will help you refine your extension searches to filter results based on things like category and install state; or sort results by name, rating, or install count. Type ‘@’ or ⌃Space (Windows, Linux Ctrl+Space ) to trigger suggestions for supported query parameters.
Extension Pack management
Extension Pack management has become a lot smoother in this release. An Extension Pack is installed, uninstalled, enabled or disabled always as a single pack. You can also now uninstall or disable an extension belonging to an Extension Pack without requiring you to uninstall or disable the entire Extension Pack.
There is also a new Extension Pack tab when you open extension details showing which extensions are bundled in the Extension Pack.
Note: This needs adoption by Extension Packs. See Extension Packs revisited for more details.
Disabling extensions from command line
Preview Features
Preview features are not ready for release but are functional enough to use. We welcome your early feedback while they are under development.
New Settings editor
Some of the new changes compared to last month are:
Custom title bar and menus for Windows/Linux
Some highlights include:
The menus are now themable. See the new theme colors under New theme colors.
Keyboard and mouse interaction with the menus is more coherent. Before, there were several focus indicators making the menus unclear. Now, the menus function in way that is much more familiar.
Many accessibility issues have been resolved to improve the experience for those needing larger zoom levels or using screen readers.
We will continue to improve the new menus and title bar as well as address issues tagged with the workbench-title or workbench-menu labels.
Extension Authoring
QuickInput API
The QuickPick and InputBox APIs are now stable. They allow for more flexible collection of user input than the existing showQuickPick and showInputBox APIs. There are samples of QuickInput API usage in a sample extension.
Extension Packs revisited
An Extension Pack should not have any functional dependencies with its bundled extensions and they should be manageable independent of the pack. Below is an example extensionPack entry which defines an Extension Pack that bundles several debugger extensions.
This will make it much simpler and easier for users to manage an Extension Pack and its bundled extensions. See Extension Pack management.
Better Workspace edit
The WorkspaceEdit and applyEdit APIs have been extended to allow extensions to create, rename, and delete files. Before, only textual edits were possible. The new APIs allow for better refactorings; for example, renaming a file when a class name is changed.
New theme colors
There are new theme colors for the breadcrumbs:
The controls of the new Settings editor are now themable:
The custom menus on Windows and Linux are now themable:
Updated default theme colors
As part of our accessibility improvements, we’ve updated a few default theme colors to ensure they meet the color contrast requirements. The full list of color contrast fixes can be found here.
DefinitionLink
Definition providers may now return a DefinitionLink object. Definition links provide additional metadata over normal location definitions, including the range of the defining symbol:
Debug extensions
New home for the Debug Adapter Protocol
We’ve moved the Debug Adapter Protocol from its old location to a new website https://microsoft.github.io/debug-adapter-protocol and a corresponding repository https://github.com/microsoft/debug-adapter-protocol.
A companion blog, New home for the Debug Adapter Protocol, provides background and additional details about the move.
Everyone who is using the DAP JSON-schema programmatically from the old location https://raw.githubusercontent.com/Microsoft/vscode-debugadapter-node/main/debugProtocol.json should update their source code to the new location:
For the next two releases (August & September), we will keep the schema at the old location up-to-date, but we are planning to remove it in October.
New terminate request for Debug Adapter Protocol
A new terminate request and a corresponding supportsTerminateRequest capability have been added to the Debug Adapter Protocol in order to support the graceful shutdown of debuggees explained above. If a debug adapter returns true for the supportsTerminateRequest capability, VS Code will first send a terminate request to the debug adapter when it stops a debug session. The implementation of the terminate request in the debug adapter should request the debuggee to terminate itself. On Unix-based operating systems, this could easily be achieved by sending the SIGINT signal to the debuggee.
Webview icons
Webviews may now provide a custom icon that is shown in the tab bar and OPEN EDITORS view:
Terminal access API
The terminal access APIs are now stable. They allow extensions to access Terminal objects, regardless of whether the extension created them or not.
URI handler API
The URI handler API is now stable. It allows extensions to handle system-wide URIs.
It comes with a onUri activation event which activates an extension whenever a URI directed towards itself is opened by the operating system.
Refer to the Git extension’s GitProtocolHandler for a reference implementation.
Node.js update
The version of Electron that VS Code runs on has been updated which brings with it an update to Node.js that VS Code ships with from 7.9 to 8.9. All extensions will now run on this newer version of Node.js.
There are some changes which could affect extensions:
Proposed Extension APIs
Every milestone comes with new proposed APIs and extension authors can try them out. As always we are keen on your feedback. This is what you have to do to try out a proposed API:
Note that you cannot publish an extension that uses a proposed API. We may likely make breaking changes in the next release and we never want to break existing extensions.
TextSearchProvider, FileSearchProvider, FileIndexProvider
We’ve added a set of APIs that let extensions implement text search and file search in VS Code.
findTextInFiles API
New proposed API has been added to allow extensions to search for text patterns within the workspace:
Miscellaneous
Electron update
In this release, we updated from Electron 1.7.12 to 2.0.5. This brings in a Chromium update from version 58 to 61 and Node.js from 7.9 to 8.9.
New Documentation
Logpoints blog post
You can read Kenneth’s recent blog post to learn about Node.js debugging Logpoints and auto-attach. Logpoints let you quickly output logging information without changing source code or interrupting your debugging session.
IntelliCode FAQ
If you are a Python developer, have a look at IntelliCode, a new tool that enhances software development using artificial intelligence (AI). The IntelliCode extension provides a set of AI-assisted capabilities for IntelliSense in Python, such as inferring the most relevant auto-completions based on the current source code context.
Notable Changes
Thank You
Last but certainly not least, a big Thank You! to the following folks that helped to make VS Code even better:
Contributions to vscode :
Contributions to language-server-protocol :
Contributions to vscode-chrome-debug :
Contributions to vscode-chrome-debug-core :
Contributions to vscode-vsce :
Contributions to vscode-recipes :
Contributions to localization :
There are over 800 members in the Transifex VS Code project team with about 100 active contributors every month. We appreciate your contributions, either by providing new translations, voting on translations, or suggesting process improvements.
Here is a snapshot of contributors for this release. For details about the project including the contributor name list, visit the project site at https://aka.ms/vscodeloc.
January 2021 (version 1.53)
Update 1.53.1: The update addresses these security issues.
Update 1.53.2: The update addresses these issues.
Welcome to the January 2021 release of Visual Studio Code. There are a number of updates in this version that we hope you will like, some of the key highlights include:
If you’d like to read these release notes online, go to Updates on code.visualstudio.com.
Join us live at the VS Code team’s livestream on Tuesday, February 9 at 8am Pacific (4pm London) to see a demo of what’s new in this release, and ask us questions live.
Insiders: Want to try new features as soon as possible? You can download the nightly Insiders build and try the latest updates as soon as they are available.
Workbench
Wrap tabs
A new setting workbench.editor.wrapTabs lets editor tabs wrap instead of showing a scrollbar.
Theme: GitHub Dark Theme
If the available space for the tabs is too small, wrapping will temporarily turn off, and you will see the old experience with a scrollbar.
Tab decorations
Two new settings allow you to configure whether editor tabs show decorations, such as git status or diagnostics. Use workbench.editor.decorations.colors to decorate tabs with colors, like red/green for files with errors and warnings, and use workbench.editor.decorations.badges to decorate tabs with badges, like M for git modified.
Theme: GitHub Light Theme
Open Editors view hidden by default
The Open Editors view is now hidden by default. This will only affect new VS Code users, and existing users will still see the Open Editors view. We wanted to present a cleaner look in the Explorer view out-of-the-box, and we believe that the functionality provided in the Open Editors view is covered in other areas of the workbench, like tabs. The visibility of the Open Editors view can be controlled by the context menu in the Explorer view title area.
New confirmation dialogs
If a user tries to quit VS Code while there is a file operation in progress, we now show a confirmation dialog. We also show a confirmation dialog for destructive undo operations from the Explorer.
We always want to avoid data loss, so we’ve introduced these dialogs to make sure it doesn’t happen by accident.
New setting workbench.editor.enablePreviewFromCodeNavigation
A new setting workbench.editor.enablePreviewFromCodeNavigation allows you to explicitly enable preview editors from code navigations, such as Go to Definition. In our previous release, we changed the default to open editors normally from code navigations. This setting allows you to choose which option you prefer.
Emmet performance and feature improvements
Emmet now works much faster in HTML and CSS files. The extension also uses the latest Emmet, meaning that features such as countdowns are now supported.
Here’s an example of Emmet expanding with a countdown in a large HTML file, with a 20x performance improvement:
Improved refactor participants UI
Extensions can participate when you create, move, rename, or delete files. This is useful when automatically running refactorings, for example, when you rename a Java file and also need to rename its public class.
The unified UI allows you to accept, skip, and preview the other changes that an extension is making.
Open with supports alternative opening mode
After running the Reopen Editor With command, you can now hold down Ctrl when selecting the editor to use to open the new editor to the side of the current editor. This matches the behavior of VS Code’s quick open.
Additionally, pressing Right Arrow in the Reopen Editor With dialog will now open the editor in the background.
Issue reporting
If you’re signed in with GitHub, you can now directly create issues from the issue reporter (Help > Report Issue).
Default search mode
The search.mode setting is now available to allow configuring what search UI commands like Search: Find in Files, and the explorer’s Find in Folder. and Find in Workspace context menu entries use, with options of:
In the past, it was advised to configure default search UI by editing keybindings. This is no longer necessary, and these keybindings can be removed in favor of this setting.
Theme: GitHub Light Theme
New file and folder icons
We’ve updated our New File and New Folder icons to make them consistent with the rest of our iconography library:
Editor
New snippet variables
There are new snippet variables for inserting UUIDs, and for inserting the relative path of the current file. The sample snippet below would print:
let someId = ‘foo/test.js/c13d226f-1932-40e2-9fd9-10198c219e33’
Transform to snake case
Debugging
Start the same debug configuration multiple times
We have removed the restriction that only a single debug session can be started from a launch configuration. You can now start multiple concurrent sessions by pressing the green run button in the debug configuration dropdown menu any number of times.
Each subsequent debug session will have a number appended at the end of the name so they can be easily distinguished.
Breakpoints: condition editing
We’ve continued the effort to consolidate and simplify breakpoint editing from the BREAKPOINTS view:
An example of condition editing in the BREAKPOINTS view:
Note that while the new UI supports editing of all breakpoint types, conditions, and hit counts are only respected if a debug extension actually supports them. Currently, we are not aware of any debuggers supporting conditions and hit counts for function breakpoints, but we expect some support soon. For exception breakpoints, condition support has been added to the built-in JavaScript debugger in this release.
Prompt to save untitled files before run/debug
A common issue reported by new users who are just getting into programming is forgetting to save files before running them. Since most debuggers cannot debug untitled files (PowerShell being an exception), we now prompt users to save open untitled files in the active editor group before running or debugging.
Syntax coloring for breakpoint zone widget
The breakpoint editor zone widget now supports syntax coloring by respecting the language mode of the underlying editor.
Debug console action moved into secondary menu
In addition, we believe that the need for the action is small given that the debug console opens automatically when a debug session starts.
Improved logging for extension debugging
When debugging an extension, calls to console APIs are now processed through the built-in JavaScript debugger, which allows for richer representation of complex objects like source mapped stacktraces.
JavaScript debugger
A complete list of changes can be found in the vscode-js-debug changelog.
Conditional exception breakpoints
Conditional exception breakpoints are now supported in the JavaScript debugger. The error variable will contain the currently thrown exception:
Theme: Codesong
Debug worker_threads
Debugging of Node.js worker_threads is now supported.
Theme: Codesong
No changes or extra configuration is needed.
Integrated Terminal
Flow control
The connection between the terminal processes and the frontend is now protected by a flow control mechanism that will pause the process when the frontend needs to catch up. Previously, this would cause stability/performance issues when using a terminal in a remote connection. This change only applies when using VS Code’s remoting functionality for now, but it will be used for local windows soon, after we tweak where terminal processes get launched.
Better PowerShell 7 discovery
PowerShell 7 is the latest and greatest version of PowerShell, which can be installed on Windows, macOS, and Linux. If you install PowerShell 7 on Windows, VS Code will use that as the default shell. If you don’t have PowerShell 7 installed, VS Code will continue to use Windows PowerShell as the default.
Additionally, if you open the Select Default Shell Quick Pick, the enumeration of all of the installed PowerShell versions will show up (MSI installation, Microsoft Store installation, etc.).
Note: macOS and Linux default shell discovery and shell enumeration are unaffected by this because they use the default set by the OS and /etc/shells respectively. Additionally, the terminal.integrated.shell.windows setting is still honored.
Languages
Markdown preview auto updates when images are changed on disk
The Markdown preview will now automatically update when any embedded images are changed on disk:
This can happen when you edit the image file using an external program or from a source control operation, such as switching branches.
Notebooks
Outline and breadcrumbs
Notebook cells now show up in the outline pane and breadcrumbs. This allows for a better overview and fast navigation within notebooks.
There are two settings that allow you to define if code cells are part of the outline or not.
Notebook diff editor: rich output rendering and performance improvement
The diff editor for notebook documents now supports rendering rich output like tables, images, or HTML output.
We also improved the scrolling performance to ensure a smooth experience while browsing changes in the diff editor.
Add new cell toolbar
We’ve updated our add new cell toolbar to appear whenever you hover over a cell to make it more discoverable.
Source Control
Git: Open All Changes command
A new Git command has been added to the Command Palette:
Git: Warning when pulling (or syncing) and the current branch has been rebased
VS Code will now warn you whenever you attempt to pull (or sync) and the current branch looks like it has been rebased (for example, when published history has been rewritten).
Git: New settings
Additionally, new Git settings have been added:
Preview features
Search in open editors
This release comes with experimental support for searching in open editors, which has been a highly requested feature for some time. This feature is enabled by default in Insiders, and can be enabled with the search.experimental.searchInOpenEditors setting in Stable.
Theme: GitHub Light Theme
TypeScript 4.2 support
This release continues to improve our support for the upcoming TypeScript 4.2 release. You can read more about the new language features and improvements in TypeScript 4.2 on the TypeScript blog. Here are some of the editor improvements it enables:
To start using the TypeScript 4.2 nightly builds, just install the TypeScript Nightly extension. Please share your feedback and let us know if you run into any bugs with TypeScript 4.2.
New Find References to File command
If you are using TypeScript 4.2, you can also try the new Find References to File command for JavaScript and TypeScript to find all places where a file is being referenced.
You can trigger this command in a few different ways:
Contributions to extensions
Remote Development
Work continues on the Remote Development extensions, which allow you to use a container, remote machine, or the Windows Subsystem for Linux (WSL) as a full-featured development environment.
Feature highlights in 1.53 include:
You can learn about new extension features and bug fixes in the Remote Development release notes.
Extension authoring
Extension guidelines
There is now a set of detailed extension guidelines for extension authors. The guidelines cover best practices for contributing to VS Code’s users interface and conventions for notifications and status updates.
As an example, below are the Do’s and Dont’s for contributing commands to the Command Palette:
Product icon themes
The product icon theme APIs are now stable. Theme authors can publish themes that replace the built-in icons used in views and editors.
Users can switch to new themes with the Preferences: Product Icon Theme command.
Status bar entry background color API
The previously proposed backgroundColor for the StatusBarItem API is now stable. Currently only statusBarItem.errorBackground is supported to avoid the Status bar looking too colorful. We may expand this support to more colors in the future.
The use case for this new API is to enable extensions to indicate error conditions in the Status bar. For example, the ESLint extension may decide to use this color to alert the user that ESLint has not yet been enabled for a workspace.
Adding CancellationError type
OnEnterRule.previousLineText
onEnterRules in language configuration files
Until now, onEnterRules could be defined only using the vscode.languages.setLanguageConfiguration API. Now, onEnterRules can also be defined in the language configuration file.
Semantic token commands
There are now new commands to invoke the semantic tokens provider. The commands are:
Secrets API
Similar to the storage API, there is now an API for storing and retrieving secrets on a per-extension basis. This allows extensions to store sensitive information in the OS credential manager or keystore.
workspaceContains extension activation behavior change
This month, we fixed a bug with the behavior of the workspaceContains extension activation event that could change how an extension is activated.
The bug caused us to start a search over the entire workspace, when the workspaceContains pattern was only targeting files in the root of the workspace. Since this could affect the startup performance of VS Code, we needed to fix this and scope these searches correctly. But as a result, some extensions that were previously activated by this behavior may no longer get activated.
The change has been in our Insiders build since the beginning of January. For more information, see this comment on the GitHub issue.
Updated loading icon
We’ve updated our loading icon to make for a smoother experience.
Git extension APIs
Welcome view content link enablement
A viewsWelcome contribution from an extension in which an enablement expression is specified will now render command links inactive when the expression evaluates as false.
resolveTreeItem
Proposed extension APIs
Every milestone comes with new proposed APIs and extension authors can try them out. As always, we want your feedback. This is what you have to do to try out a proposed API:
You cannot publish an extension that uses a proposed API. There may be breaking changes in the next release and we never want to break existing extensions.
Inline value provider API
Today the Show Inline Values feature of VS Code’s debugger is based on a generic implementation in VS Code core, and doesn’t provide customizability through settings or extensibility via extensions. As a consequence, it is not a perfect fit for all languages and sometimes shows incorrect values because it doesn’t understand the underlying source language. For this reason, we are working on an extension API that allows to replace the built-in implementation completely or to replace parts of the implementation with custom code.
In this milestone, we have created an initial proposal. If you are interested in this extension API, we’d appreciate your feedback.
Testing
This iteration focused building out the Selfhost Test Provider for VS Code and foundational UI, primarily the test explorer, gutter decorations, and peek views for results.
For example, here’s a failed test showing the difference between actual and expected values in a diff peek view: Theme: Codesong
External URI opener
The proposed external URI opener API allows extensions to handle opening HTTP and HTTPS links that the user selects in the editor. For example, a browser preview extension could use this to open links to a local server in VS Code directly, instead of opening the link with the user’s default browser:
To use the external opener API, first add an onOpenExternalUri activation event for the URL schemes your opener supports. Currently only http and https URLs are supported:
Then in your extension’s activation, call registerExternalUriOpener to register your external URI opener:
Now when you select links to localhost:8080 in the editor or terminal, you will be prompted to select how the URL should be opened:
Additionally, you can configure a default opener for a URI using the new workbench.externalUriOpeners setting:
Language Server Protocol
Work has started on the 3.17 version of the protocol. The first proposed feature is support for a more detailed completion item label.
Language Server Index Format
We also improved the LSIF indexer for TypeScript and tested it against a broader range of open-source repositories. Major improvements are:
Debug Adapter Protocol
Value dataBreakpoint from VariablePresentationHint.kind is deprecated
Engineering
Performance Improvements
There’s been considerable work surrounding both our GitHub Actions and Azure DevOps Pipelines infrastructure. Our builds now run faster and more often thanks to these improvements. Building VS Code now takes half as much time as before:
Electron 11 update
In this milestone, we finished the exploration to bundle Electron 11 into VS Code, thanks to everyone involved with testing and self-hosting on insiders. This is a major Electron release and comes with Chromium 87.0.4280.141 and Node.js 12.18.3.
Breaking change
A workaround for the other distros would be to install gcc-5 or higher toolchain to avoid the GLIBCXX error with native modules, but there is no guarantee that all components of the runtime will work fine. There is also the option of using our remote development suite to work with the older distros.
Apple Silicon Insiders
Thanks to Electron 11, we continue to make progress on fully supporting Apple Silicon. For the Insiders build, we offer three variations of downloads under macOS:
The universal version is the default download option on the website. We will work towards removing the architecture specific downloads later this year. More updates on this will follow in upcoming iterations.
Universal apps are created by bundling both x64 and arm64 version of the apps, hence there is a significant increase in download size for the first install but simplifies the transition for a user to the new Apple Silicon Macs.
Note: We originally planned to push the Apple Silicon builds to Stable this iteration. However, late in the iteration, users reported that on macOS Big Sur 11.2 loading a WASM module crashed the extension host. You can follow along with our investigation of the problem in the upstream issue #115646.
Debian repository migration
In order to support x64, ARM, and ARM 64-bit architectures in a single repository, we have moved to a new repository location:
The VS Code Debian packages will automatically migrate your system to the new repository, so there’s no adoption necessary.
Progress on Electron sandbox
This milestone we continued to make the VS Code window fit for enabling Electron’s sandbox and context isolation.
Specifically:
VS Code is now Trusted Types compliant
We have finished the work to make VS Code trusted types compliant per the W3C Trusted Types specification.
Documentation
Remote Development
when clause reference
The when clause documentation is now in its own when clause contexts reference. Here you can learn how to conditionally enable or disable custom keybindings depending on the currently active VS Code UI (contexts) and tune the visibility of menus and views when contributing extensions.
CodeTour for educators
A new CodeTour topic introduces educators to the CodeTour extension that lets them easily author walkthroughs for codebases. Educators can create self-paced tours for their students as they ramp up on new projects and assignments.
What is a VS Code «workspace»?
A new topic explains what «workspaces» are in VS Code. If you are interested in learning more about the differences between single-folder, multi-root and untitled workspaces, take a look at What is a VS Code «workspace»?.
Notable fixes
Thank you
Last but certainly not least, a big Thank You to the following people who contributed this month to VS Code:
Contributions to our issue tracking:
Contributions to vscode :
Contributions to language-server-protocol :
Contributions to vscode-languageserver-node :
Contributions to vscode-css-languageservice :
Contributions to vscode-html-languageservice :
Добро пожаловать в интегрированную среду разработки Visual Studio
Интегрированная среда разработки (IDE) — это многофункциональная программа, которая поддерживает многие аспекты разработки программного обеспечения. Интегрированная среда разработки Visual Studio — это стартовая площадка для написания, отладки и сборки кода, а также последующей публикации приложений. Помимо стандартного редактора и отладчика, которые есть в большинстве сред IDE, Visual Studio включает в себя компиляторы, средства автозавершения кода, графические конструкторы и многие другие функции для улучшения процесса разработки.
На рисунке выше представлена среда Visual Studio с открытым проектом и подсказки по основным окнам и функциональных возможностях.
Справа в верхнем углу окна Обозревателя решений вы можете просматривать файлы кода, перемещаться по ним и управлять ими. Обозреватель решений позволяет упорядочить код путем объединения файлов в решения и проекты.
В центральном окне редактора, с которым вы, вероятно, будете работать дольше всего, отображается содержимое файла. В окне редактора вы можете вносить изменения в код или разрабатывать пользовательский интерфейс, например окно с кнопками или текстовые поля.
Окно Изменения Git в нижнем углу справа позволяет отслеживать рабочие элементы и предоставлять общий доступ к коду, используя Git, GitHub или другие технологии управления версиями.
Выпуски
Среда Visual Studio доступна для Windows и Mac. Функции Visual Studio для Mac во многом аналогичны возможностям Visual Studio для Windows и оптимизированы для разработки кросс-платформенных и мобильных приложений. Эта статья посвящена версии Visual Studio для Windows.
Существует три выпуска Visual Studio: Community, Professional и Enterprise. Сведения о функциях, поддерживаемых в каждом выпуске, см. на странице Сравнение выпусков Visual Studio.
Популярные средства повышения производительности
Вот несколько популярных возможностей Visual Studio, которые повышают производительность при разработке программного обеспечения:
Волнистые линии обозначают ошибки или потенциальные проблемы кода прямо во время ввода. Эти визуальные подсказки помогают немедленно устранить проблемы, не дожидаясь появления ошибок во время сборки или выполнения. Если навести указатель мыши на волнистую линию, на экран будут выведены дополнительные сведения об ошибке. Также в поле слева может отображаться лампочка, указывающая на наличие сведений о быстрых действиях для устранения ошибки.
Рефакторинг включает в себя такие операции, как интеллектуальное переименование переменных, извлечение одной или нескольких строк кода в новый метод и изменение порядка параметров методов.
IntelliSense — это набор возможностей, отображающих сведения о коде непосредственно в редакторе и в некоторых случаях автоматически создающих небольшие отрывки кода. По сути, это встроенная в редактор базовая документация, которая избавляет от необходимости искать информацию в других источниках.
На следующем рисунке показано, как IntelliSense отображает список членов типа:
Иногда вам будет казаться, что в Visual Studio слишком много меню, действий и свойств. Чтобы быстро находить функции интегрированной среды разработки или элементы кода, в Visual Studio представлен единый компонент поиска (CTRL+Q).
Дополнительные сведения и советы по повышению производительности см. в разделе Практическое руководство. Поиск в Visual Studio.
Дополнительные сведения и советы по повышению производительности см. в разделе Практическое руководство. Поиск в Visual Studio.
Предоставляет возможности совместного редактирования и отладки в реальном времени независимо от типа приложения или языка. Вы можете мгновенно предоставлять общий доступ к своему проекту с поддержкой высокого уровня безопасности. Кроме того, вы можете предоставлять общий доступ к сеансам, экземплярам терминала, веб-приложениям на локальном компьютере, голосовым звонкам и т. п.
В окне Иерархия вызовов показаны методы, вызывающие выбранный метод. Это может быть полезно, если вы собираетесь изменить либо удалить метод или хотите отследить ошибку.
CodeLens помогает находить ссылки на код, изменения кода, связанные с кодом ошибки, рабочие элементы, проверки кода и модульные тесты — не выходя из редактора.
Функция Перейти к определению позволяет перейти к расположению, где определена выбранная функция или тип.
В окне Показать определение можно отобразить метод или определение типа, не открывая отдельный файл.
Установка Visual Studio
В рамках этого раздела вы создаете простой проект для тестирования некоторых возможностей Visual Studio. IntelliSense используется как вспомогательный инструмент для программирования и отладки приложения, который позволяет просмотреть значение переменной во время выполнения приложения или изменить цветовую тему.
При первом запуске Visual Studio можно выполнить вход с использованием учетной записи Майкрософт или рабочей учетной записи.
Создание программы
Давайте создадим простую программу.
Запустите Visual Studio.
Откроется начальное окно, где можно клонировать репозиторий, открыть недавно использованный проект или создать новый.
Выберите Создать проект.
Откроется окно Создание проекта с отображением нескольких шаблонов проектов. Шаблон содержит основные файлы и параметры, которые требуются для определенного типа проекта.
Выберите шаблон Консольное приложение и щелкните Далее.
В окне Настройка нового проекта введите HelloWorld в поле Имя проекта, при необходимости измените расположение каталога для вашего проекта (по умолчанию используется путь C:\Users\ \source\repos ) и щелкните Далее.
В окне Дополнительные сведения убедитесь, что в раскрывающемся меню Целевая платформа указано .NET Core 3.1, а затем щелкните Создать.
Visual Studio создаст проект. Это простейший вариант приложения «Hello World», в котором вызывается метод Console.WriteLine() для вывода литеральной строки «Hello World!» в окне консоли (выходных данных программы).
Должно отобразиться примерно следующее:
Код C# для вашего приложения отображается в окне редактора, который занимает большую часть пространства. Обратите внимание, что текст автоматически выделяется цветом для обозначения разных частей кода, таких как ключевые слова и типы. Кроме того, небольшие вертикальные штриховые линии кода указывают, какие фигурные скобки соответствуют друг другу, а номера строк помогут вам найти нужный код позже. Чтобы свернуть или развернуть блоки кода, используйте небольшие рамки со знаком минус. Эта функция структурирования кода позволяет скрыть ненужный код на экране. Файлы вашего проекта перечислены в окне Обозревателя решений, которое находится справа.
Есть и другие доступные меню и окна инструментов, но об этом позже.
Теперь запустите приложение. Это можно сделать, выбрав Запуск без отладки в меню Отладка в строке меню. Можно также нажать клавиши CTRL+F5.
=»» «запуск=»» без=»» отладки».»=»» data-linktype=»relative-path»>
Когда Visual Studio создаст приложение, откроется окно консоли с сообщением Hello World!. Теперь у вас есть выполняемое приложение.
Чтобы закрыть окно консоли, нажмите любую клавишу.
Давайте добавим новый год в это приложение. Перед строкой Console.WriteLine(«Hello World!»); добавьте следующий код C#:
Этот код отображается сообщение What is your name? (Введите имя) в окне консоли и ожидает, чтобы пользователь ввел текст и нажал клавишу ВВОД.
Снова запустите приложение, выбрав пункты Отладка >Запуск без отладки или нажав клавиши CTRL+F5.
Visual Studio выполнит повторную сборку приложения. В открывшемся окне консоли отобразится запрос на ввод имени.
Введите свое имя в окне консоли и нажмите клавишу ВВОД.
Нажмите любую клавишу, чтобы закрыть окно консоли и остановить выполняющуюся программу.
Запустите среду Visual Studio. Откроется начальное окно, где можно клонировать репозиторий, открыть недавно использованный проект или создать новый.
Выберите Создать проект.
Откроется окно Создание проекта с отображением нескольких шаблонов проектов. Шаблон содержит основные файлы и параметры, которые требуются для определенного типа проекта.
Чтобы найти шаблон, попробуйте ввести или ввести ключевые слова в поле поиска. Список доступных шаблонов будет фильтроваться по введенным ключевым словам. Вы можете дополнительно отфильтровать результаты шаблона, выбрав C# в раскрывающемся списке Все языки, Windows в списке Все платформы и Консоль в списке Все типы проектов.
Выберите шаблон Консольное приложение и нажмите кнопку Далее.
В поле Имя проекта окна Настроить новый проект введите HelloWorld. При необходимости измените расположение каталога проекта в расположении по умолчанию C:\Users\ \source\repos, а затем нажмите кнопку Далее.
Убедитесь, что в окне Дополнительные сведения в раскрывающемся меню Целевая платформа указано .NET 6.0, а затем щелкните Создать.
Visual Studio создаст проект. Это простейший вариант приложения Hello World, в котором вызывается метод Console.WriteLine() для вывода строки Hello World! в окне консоли.
Файлы проекта отображаются справа в окне интегрированной среды разработки Visual Studio в окне с названием Обозреватель решений. В окне Обозреватель решений выберите файл Program.cs. Код C# для вашего приложения открывается в центральном окне редактора, который занимает большую часть пространства.
Код автоматически выделяется цветом для обозначения таких элементов, как ключевые слова и типы. Найти код можно по номерам строк.
Небольшие вертикальные пунктирные линии в коде указывают, какие фигурные скобки соответствуют друг другу. Чтобы свернуть или развернуть блоки кода, используйте небольшие рамки со знаками минус и плюс соответственно. Эта функция структурирования кода позволяет скрыть ненужный код на экране.
Также доступно множество других меню и окон инструментов.
Запустите приложение, выбрав в главном меню Visual Studio пункты Отладка>Запуск без отладки. Можно также нажать клавиши CTRL+F5.
=»» «запуск=»» без=»» отладки».»=»» data-linktype=»relative-path»>
Для закрытия окна консоли нажмите любую клавишу.
Давайте добавим новый год в это приложение. Перед строкой Console.WriteLine(«Hello World!»); добавьте следующий код C#:
Этот код позволяет отобразить сообщение What is your name? (Введите имя) в окне консоли и ожидает, чтобы пользователь ввел текст.
Измените строку с текстом Console.WriteLine(«Hello World!»); на следующую:
Снова запустите приложение, выбрав пункты Отладка >Запуск без отладки или нажав клавиши CTRL+F5.
Visual Studio выполнит повторную сборку приложения. В открывшемся окне консоли отобразится запрос на ввод имени.
Введите свое имя в окне консоли и нажмите клавишу ВВОД.
Нажмите любую клавишу, чтобы закрыть окно консоли и остановить выполняющуюся программу.
Использование рефакторинга и IntelliSense
Рассмотрим несколько примеров того, как рефакторинг и IntelliSense помогают повысить эффективность кода.
Сначала переименуйте переменную name :
Дважды щелкните переменную name и введите для нее новое имя: username.
Вокруг переменной появится прямоугольник, а в поле появится значок лампочки.
Выберите значок лампочки для отображения доступных быстрых действий. Выберите Переименовать name в username.
Переменная переименовывается во всем проекте, то есть в нашем случае только в двух местах.
Появится поле с членами класса DateTime. В отдельном поле отобразится описание выбранного элемента.
Под этой строкой добавьте следующий фрагмент кода:
Код Console.Write отличается от Console.WriteLine тем, что не добавляет знак завершения строки после ее вывода. Это означает, что следующий фрагмент текста, отправляемый на вывод, будет выводиться в той же строке. Можно навести указатель мыши на каждый из этих методов в коде, чтобы просмотреть его описание.
Щелкните этот значок отвертки, чтобы просмотреть доступные предложения Visual Studio. В этом случае отображается рефакторинг Встроенная временная переменная для удаления строки кода без изменения его общего поведения.
Щелкните пункт Встроенная временная переменная, чтобы выполнить рефакторинг кода.
Снова запустите программу, нажав клавиши Ctrl+F5. Выходные данные выглядят следующим образом:
Отладка кода
При написании кода его следует регулярно запускать и проверять на предмет ошибок. Система отладки Visual Studio позволяет просматривать код с шагом в одну инструкцию, проверяя значения переменных. Вы можете задать точки останова, которые позволяют приостановить выполнение кода в определенной строке и увидеть, как изменяется значение переменной при выполнении кода.
В области навигации появится красный кружок, и эта строка будет выделена.
Начните отладку, выбрав пункты Отладка>Начать отладку или нажав клавишу F5.
Когда появится окно консоли с запросом имени, введите свое имя.
Фокус возвратится в редактор кода Visual Studio, и строка кода с точкой останова будет выделена желтым цветом. Желтый цвет означает, что эта строка кода будет выполняться следующей. Точка останова отвечает за приостановку работы приложения на этой строке.
Наведите указатель мыши на переменную username для просмотра ее значения. Кроме того, вы можете щелкнуть username правой кнопкой мыши и выбрать пункт Добавить контрольное значение, чтобы добавить переменную в окно контрольных значений, где можно будет просмотреть ее значение.
Нажмите клавишу F5 еще раз, чтобы завершить работу приложения.
Дополнительные сведения об отладке в Visual Studio см. в статье Знакомство с отладчиком Visual Studio.
Настройка Visual Studio
Вы можете настроить пользовательский интерфейс Visual Studio, в том числе изменить цветовую тему, установленную по умолчанию. Изменение цветовой темы
В строке меню выберите Сервис>Параметры, чтобы открыть диалоговое окно Параметры.
Откройте страницу параметров Окружение >Общие, измените значение Цветовая тема на Темная и щелкните ОК.
Цветовая тема для всей интегрированной среды разработки изменится на тему Темная.
В строке меню выберите Сервис>Параметры, чтобы открыть диалоговое окно Параметры.
На странице параметров Среда >Общие измените значение параметра Цветовая тема на Синий или Светлый. Затем нажмите кнопку ОК.
Цветовая тема для всей интегрированной среды разработки соответствующим образом изменится. На следующем снимке экрана показана синяя цветовая тема:
Дополнительные сведения о других способах персонализации интегрированной среды разработки см. в разделе Персонализация Visual Studio.
Следующие шаги
Узнайте больше о Visual Studio, прочитав одну из следующих вводных статей:
Ознакомьтесь с основными сведениями в этом модуле Learn: Введение в Visual Studio.
Познакомьтесь с редактором кода в статье Сведения об использовании редактора кода.
Узнайте, как Visual Studio упорядочивает код, в статье Сведения о проектах и решениях.
Если вы готовы к углубиться в вопросы написания кода, ознакомьтесь со следующими статьями о конкретных языках:
На начальном этапе написания кода также рекомендуется использовать учебное пособие:
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Установка Visual Studio
Вас приветствует Visual Studio 2019! В этой версии можно легко выбрать и установить только необходимые компоненты. Поскольку она занимает меньше памяти, она быстро устанавливается и при установке меньше влияет на систему.
Вас приветствует Visual Studio 2022! В этой версии можно легко выбрать и установить только необходимые компоненты.
Этот раздел относится к Visual Studio в Windows. Информацию о Visual Studio для Mac см. в статье Установка Visual Studio для Mac.
Хотите ознакомиться с другими новыми возможностями этой версии? Обратитесь к заметкам о выпуске.
Хотите ознакомиться с другими новыми возможностями этой версии? Обратитесь к заметкам о выпуске.
Готовы к установке? Мы последовательно опишем каждое действие.
Шаг 1. Подготовка компьютера к установке Visual Studio
Перед началом установки Visual Studio:
Проверьте требования к системе. Так вы узнаете, поддерживает ли ваш компьютер Visual Studio 2019.
Примените актуальные обновления Windows. Эти обновления гарантируют, что на компьютере установлены последние обновления для системы безопасности и необходимые системные компоненты для Visual Studio.
Перезагрузите систему. Перезагрузка гарантирует, что ожидающие установки или обновления компоненты не будут препятствовать установке Visual Studio.
Освободите место. Удалите ненужные файлы и приложения с системного диска. Например, запустите приложение очистки диска.
Проверьте требования к системе. Так вы узнаете, может ли ваш компьютер поддерживать Visual Studio 2022.
Примените актуальные обновления Windows. Эти обновления гарантируют, что на компьютере установлены последние обновления для системы безопасности и необходимые системные компоненты для Visual Studio.
Перезагрузите систему. Перезагрузка гарантирует, что ожидающие установки или обновления компоненты не будут препятствовать установке Visual Studio.
Освободите место. Удалите ненужные файлы и приложения с системного диска. Например, запустите приложение очистки диска.
Сведения об использовании предыдущих версий Visual Studio параллельно с Visual Studio 2019 см. в разделе Целевая платформа и совместимость для Visual Studio 2019.
Visual Studio 2022 можно установить параллельно с предыдущими версиями. Дополнительные сведения см. в разделе Visual Studio 2022: выбор платформы и совместимость и Параллельная установка версий Visual Studio.
Шаг 2. Скачивание Visual Studio
Теперь скачайте файл начального загрузчика Visual Studio.
Для этого нажмите кнопку ниже, выберите нужный выпуск Visual Studio, щелкните Сохранить, а затем Открыть папку.
Для этого нажмите кнопку ниже, выберите нужный выпуск Visual Studio и сохраните его в папке Загрузки.
Шаг 3. Установка установщика Visual Studio
Запустите файл начального загрузчика, чтобы установить Visual Studio Installer. Новый установщик имеет меньший размер и включает все необходимое для установки и настройки Visual Studio.
В папке Загрузки дважды щелкните файл начального загрузчика, имя которого совпадает с именем одного из следующих файлов или похоже на них:
Если появляется оповещение системы контроля учетных записей, нажмите кнопку Да.
Мы попросим вас принять условия лицензии и заявление о конфиденциальности корпорации Майкрософт. Нажмите Продолжить.
Шаг 4. Выбор рабочих нагрузок
Когда завершится установка программы установки, вы можете с ее помощью выбрать нужные наборы функций (рабочих нагрузок). Вот как это сделать.
Найдите нужную рабочую нагрузку в Visual Studio Installer.
Например, выберите рабочую нагрузку «ASP.NET и разработка веб-приложений». В нее входит основной редактор кода по умолчанию, который предоставляет базовую поддержку редактирования кода для более чем 20 языков, возможность открывать и изменять код в любой папке без наличия проекта и интегрированное управление исходным кодом.
Выбрав нужные рабочие нагрузки, нажмите кнопку Установить.
Далее будут отображаться экраны состояния, на которых демонстрируется ход установки Visual Studio.
Выберите нужную рабочую нагрузку в Visual Studio Installer.
Выбрав нужные рабочие нагрузки, нажмите кнопку Установить.
Далее будут отображаться экраны состояния, на которых демонстрируется ход установки Visual Studio.
В любой момент после установки можно установить рабочие нагрузки или компоненты, которые не были установлены изначально. Если среда Visual Studio открыта, выберите пункт Сервис>Получить средства и компоненты. ; откроется Visual Studio Installer. Или откройте Visual Studio Installer из меню «Пуск». Здесь можно выбрать рабочие нагрузки или компоненты, которые нужно установить. Затем выберите Изменить.
Шаг 5. Выбор отдельных компонентов (необязательно)
Если вы не хотите пользоваться функцией рабочих нагрузок для настройки установки Visual Studio или хотите добавить дополнительные компоненты, которые не устанавливает рабочая нагрузка, это можно сделать путем установки или добавления отдельных компонентов на вкладке Отдельные компоненты. Выберите нужные компоненты и следуйте указаниям.
Шаг 6. Установка языковых пакетов (необязательно)
По умолчанию при первом запуске установщик пытается использовать язык операционной системы. Чтобы установить Visual Studio на нужном языке, выберите в Visual Studio Installer вкладку Языковые пакеты и следуйте указаниям.
Изменение языка установщика из командной строки
Шаг 7. Выбор расположения установки (дополнительно)
Вы можете уменьшить место, занимаемое установкой Visual Studio на системном диске. Вы можете переместить кэш загрузки, общие компоненты, пакеты SDK и средства на другие диски и оставить Visual Studio на самом быстром диске.
Вы можете уменьшить место, занимаемое установкой Visual Studio на системном диске. Дополнительные сведения см. в разделе Выбор расположений установки.
Вы можете выбрать другой диск для Visual Studio IDE или кэша загрузки только в том случае, если вы устанавливаете Visual Studio впервые. Если вы уже установили ее и хотите изменить диск, необходимо удалить Visual Studio, а затем переустановить ее.
Если вы уже установили Visual Studio на компьютере, вы не сможете изменить путь к общим компонентам, инструментам и пакетам SDK, этот пункт будет неактивен. Это общее расположение для всех установок Visual Studio.
Шаг 8. Начало разработки
Когда установка Visual Studio завершится, нажмите кнопку Запустить, чтобы приступить к разработке в Visual Studio.
На начальном экране выберите Создать проект.
В поле поиска введите тип приложения, которое вы хотите создать, чтобы просмотреть список доступных шаблонов. Список шаблонов зависит от рабочих нагрузок, выбранных во время установки. Чтобы просмотреть различные шаблоны, выберите разные рабочие нагрузки.
Можно также фильтровать поиск по определенному языку программирования с помощью раскрывающегося списка Язык. Вы также можете выбирать фильтры из списка Платформа и Тип проекта.
Новый проект откроется в Visual Studio, и вы можете приступить к написанию кода!
Когда установка Visual Studio завершится, нажмите кнопку Запустить, чтобы приступить к разработке в Visual Studio.
На начальном экране выберите Создать проект.
В поле поиска шаблонов введите тип приложения, которое вы хотите создать, чтобы просмотреть список доступных шаблонов. Список шаблонов зависит от рабочих нагрузок, выбранных во время установки. Чтобы просмотреть различные шаблоны, выберите разные рабочие нагрузки.
Можно также фильтровать поиск по определенному языку программирования с помощью раскрывающегося списка Язык. Вы также можете выбирать фильтры из списка Платформа и Тип проекта.
Новый проект откроется в Visual Studio, и вы можете приступить к написанию кода!
Поддержка или устранение неполадок
Иногда возникают проблемы. Если установить Visual Studio не удается, воспользуйтесь пошаговыми указаниями в статье Устранение неполадок при установке и обновлении Visual Studio.
Ниже приведены несколько дополнительных вариантов:
C/C++ for Visual Studio Code
Repository | Issues | Documentation | Code Samples
The C/C++ extension adds language support for C/C++ to Visual Studio Code, including editing (IntelliSense) and debugging features.
Pre-requisites
C++ is a compiled language meaning your program’s source code must be translated (compiled) before it can be run on your computer. VS Code is first and foremost an editor, and relies on command-line tools to do much of the development workflow. The C/C++ extension does not include a C++ compiler or debugger. You will need to install these tools or use those already installed on your computer.
Here is a list of compilers and architectures per platform officially supported by the extension. These are reflected by the available IntelliSense modes from the extension’s IntelliSense configuration. Note that support for other compilers may be limited.
Platform | Compilers | Architectures |
---|---|---|
Windows | MSVC, Clang, GCC | x64, x86, arm64, arm |
Linux | Clang, GCC | x64, x86, arm64, arm |
macOS | Clang, GCC | x64, x86, arm64 |
For more information about installing the required tools or setting up the extension, please follow the tutorials below.
Overview and tutorials
C/C++ extension tutorials per compiler and platform
Quick links
Questions and feedback
FAQs
Check out the FAQs before filing a question.
Provide feedback
File questions, issues, or feature requests for the extension.
Known issues
If someone has already filed an issue that encompasses your feedback, please leave a 👍 or 👎 reaction on the issue to upvote or downvote it to help us prioritize the issue.
Quick survey
Let us know what you think of the extension by taking the quick survey.
Contribution
Contributions are always welcome. Please see our contributing guide for more details.
Добро пожаловать в интегрированную среду разработки Visual Studio
Интегрированная среда разработки (IDE) — это многофункциональная программа, которая поддерживает многие аспекты разработки программного обеспечения. Интегрированная среда разработки Visual Studio — это стартовая площадка для написания, отладки и сборки кода, а также последующей публикации приложений. Помимо стандартного редактора и отладчика, которые есть в большинстве сред IDE, Visual Studio включает в себя компиляторы, средства автозавершения кода, графические конструкторы и многие другие функции для улучшения процесса разработки.
На рисунке выше представлена среда Visual Studio с открытым проектом и подсказки по основным окнам и функциональных возможностях.
Справа в верхнем углу окна Обозревателя решений вы можете просматривать файлы кода, перемещаться по ним и управлять ими. Обозреватель решений позволяет упорядочить код путем объединения файлов в решения и проекты.
В центральном окне редактора, с которым вы, вероятно, будете работать дольше всего, отображается содержимое файла. В окне редактора вы можете вносить изменения в код или разрабатывать пользовательский интерфейс, например окно с кнопками или текстовые поля.
Окно Изменения Git в нижнем углу справа позволяет отслеживать рабочие элементы и предоставлять общий доступ к коду, используя Git, GitHub или другие технологии управления версиями.
Выпуски
Среда Visual Studio доступна для Windows и Mac. Функции Visual Studio для Mac во многом аналогичны возможностям Visual Studio для Windows и оптимизированы для разработки кросс-платформенных и мобильных приложений. Эта статья посвящена версии Visual Studio для Windows.
Существует три выпуска Visual Studio: Community, Professional и Enterprise. Сведения о функциях, поддерживаемых в каждом выпуске, см. на странице Сравнение выпусков Visual Studio.
Популярные средства повышения производительности
Вот несколько популярных возможностей Visual Studio, которые повышают производительность при разработке программного обеспечения:
Волнистые линии обозначают ошибки или потенциальные проблемы кода прямо во время ввода. Эти визуальные подсказки помогают немедленно устранить проблемы, не дожидаясь появления ошибок во время сборки или выполнения. Если навести указатель мыши на волнистую линию, на экран будут выведены дополнительные сведения об ошибке. Также в поле слева может отображаться лампочка, указывающая на наличие сведений о быстрых действиях для устранения ошибки.
Рефакторинг включает в себя такие операции, как интеллектуальное переименование переменных, извлечение одной или нескольких строк кода в новый метод и изменение порядка параметров методов.
IntelliSense — это набор возможностей, отображающих сведения о коде непосредственно в редакторе и в некоторых случаях автоматически создающих небольшие отрывки кода. По сути, это встроенная в редактор базовая документация, которая избавляет от необходимости искать информацию в других источниках.
На следующем рисунке показано, как IntelliSense отображает список членов типа:
Иногда вам будет казаться, что в Visual Studio слишком много меню, действий и свойств. Чтобы быстро находить функции интегрированной среды разработки или элементы кода, в Visual Studio представлен единый компонент поиска (CTRL+Q).
Дополнительные сведения и советы по повышению производительности см. в разделе Практическое руководство. Поиск в Visual Studio.
Дополнительные сведения и советы по повышению производительности см. в разделе Практическое руководство. Поиск в Visual Studio.
Предоставляет возможности совместного редактирования и отладки в реальном времени независимо от типа приложения или языка. Вы можете мгновенно предоставлять общий доступ к своему проекту с поддержкой высокого уровня безопасности. Кроме того, вы можете предоставлять общий доступ к сеансам, экземплярам терминала, веб-приложениям на локальном компьютере, голосовым звонкам и т. п.
В окне Иерархия вызовов показаны методы, вызывающие выбранный метод. Это может быть полезно, если вы собираетесь изменить либо удалить метод или хотите отследить ошибку.
CodeLens помогает находить ссылки на код, изменения кода, связанные с кодом ошибки, рабочие элементы, проверки кода и модульные тесты — не выходя из редактора.
Функция Перейти к определению позволяет перейти к расположению, где определена выбранная функция или тип.
В окне Показать определение можно отобразить метод или определение типа, не открывая отдельный файл.
Установка Visual Studio
В рамках этого раздела вы создаете простой проект для тестирования некоторых возможностей Visual Studio. IntelliSense используется как вспомогательный инструмент для программирования и отладки приложения, который позволяет просмотреть значение переменной во время выполнения приложения или изменить цветовую тему.
При первом запуске Visual Studio можно выполнить вход с использованием учетной записи Майкрософт или рабочей учетной записи.
Создание программы
Давайте создадим простую программу.
Запустите Visual Studio.
Откроется начальное окно, где можно клонировать репозиторий, открыть недавно использованный проект или создать новый.
Выберите Создать проект.
Откроется окно Создание проекта с отображением нескольких шаблонов проектов. Шаблон содержит основные файлы и параметры, которые требуются для определенного типа проекта.
Выберите шаблон Консольное приложение и щелкните Далее.
В окне Настройка нового проекта введите HelloWorld в поле Имя проекта, при необходимости измените расположение каталога для вашего проекта (по умолчанию используется путь C:\Users\ \source\repos ) и щелкните Далее.
В окне Дополнительные сведения убедитесь, что в раскрывающемся меню Целевая платформа указано .NET Core 3.1, а затем щелкните Создать.
Visual Studio создаст проект. Это простейший вариант приложения «Hello World», в котором вызывается метод Console.WriteLine() для вывода литеральной строки «Hello World!» в окне консоли (выходных данных программы).
Должно отобразиться примерно следующее:
Код C# для вашего приложения отображается в окне редактора, который занимает большую часть пространства. Обратите внимание, что текст автоматически выделяется цветом для обозначения разных частей кода, таких как ключевые слова и типы. Кроме того, небольшие вертикальные штриховые линии кода указывают, какие фигурные скобки соответствуют друг другу, а номера строк помогут вам найти нужный код позже. Чтобы свернуть или развернуть блоки кода, используйте небольшие рамки со знаком минус. Эта функция структурирования кода позволяет скрыть ненужный код на экране. Файлы вашего проекта перечислены в окне Обозревателя решений, которое находится справа.
Есть и другие доступные меню и окна инструментов, но об этом позже.
Теперь запустите приложение. Это можно сделать, выбрав Запуск без отладки в меню Отладка в строке меню. Можно также нажать клавиши CTRL+F5.
=»» «запуск=»» без=»» отладки».»=»» data-linktype=»relative-path»>
Когда Visual Studio создаст приложение, откроется окно консоли с сообщением Hello World!. Теперь у вас есть выполняемое приложение.
Чтобы закрыть окно консоли, нажмите любую клавишу.
Давайте добавим новый год в это приложение. Перед строкой Console.WriteLine(«Hello World!»); добавьте следующий код C#:
Этот код отображается сообщение What is your name? (Введите имя) в окне консоли и ожидает, чтобы пользователь ввел текст и нажал клавишу ВВОД.
Снова запустите приложение, выбрав пункты Отладка >Запуск без отладки или нажав клавиши CTRL+F5.
Visual Studio выполнит повторную сборку приложения. В открывшемся окне консоли отобразится запрос на ввод имени.
Введите свое имя в окне консоли и нажмите клавишу ВВОД.
Нажмите любую клавишу, чтобы закрыть окно консоли и остановить выполняющуюся программу.
Запустите среду Visual Studio. Откроется начальное окно, где можно клонировать репозиторий, открыть недавно использованный проект или создать новый.
Выберите Создать проект.
Откроется окно Создание проекта с отображением нескольких шаблонов проектов. Шаблон содержит основные файлы и параметры, которые требуются для определенного типа проекта.
Чтобы найти шаблон, попробуйте ввести или ввести ключевые слова в поле поиска. Список доступных шаблонов будет фильтроваться по введенным ключевым словам. Вы можете дополнительно отфильтровать результаты шаблона, выбрав C# в раскрывающемся списке Все языки, Windows в списке Все платформы и Консоль в списке Все типы проектов.
Выберите шаблон Консольное приложение и нажмите кнопку Далее.
В поле Имя проекта окна Настроить новый проект введите HelloWorld. При необходимости измените расположение каталога проекта в расположении по умолчанию C:\Users\ \source\repos, а затем нажмите кнопку Далее.
Убедитесь, что в окне Дополнительные сведения в раскрывающемся меню Целевая платформа указано .NET 6.0, а затем щелкните Создать.
Visual Studio создаст проект. Это простейший вариант приложения Hello World, в котором вызывается метод Console.WriteLine() для вывода строки Hello World! в окне консоли.
Файлы проекта отображаются справа в окне интегрированной среды разработки Visual Studio в окне с названием Обозреватель решений. В окне Обозреватель решений выберите файл Program.cs. Код C# для вашего приложения открывается в центральном окне редактора, который занимает большую часть пространства.
Код автоматически выделяется цветом для обозначения таких элементов, как ключевые слова и типы. Найти код можно по номерам строк.
Небольшие вертикальные пунктирные линии в коде указывают, какие фигурные скобки соответствуют друг другу. Чтобы свернуть или развернуть блоки кода, используйте небольшие рамки со знаками минус и плюс соответственно. Эта функция структурирования кода позволяет скрыть ненужный код на экране.
Также доступно множество других меню и окон инструментов.
Запустите приложение, выбрав в главном меню Visual Studio пункты Отладка>Запуск без отладки. Можно также нажать клавиши CTRL+F5.
=»» «запуск=»» без=»» отладки».»=»» data-linktype=»relative-path»>
Для закрытия окна консоли нажмите любую клавишу.
Давайте добавим новый год в это приложение. Перед строкой Console.WriteLine(«Hello World!»); добавьте следующий код C#:
Этот код позволяет отобразить сообщение What is your name? (Введите имя) в окне консоли и ожидает, чтобы пользователь ввел текст.
Измените строку с текстом Console.WriteLine(«Hello World!»); на следующую:
Снова запустите приложение, выбрав пункты Отладка >Запуск без отладки или нажав клавиши CTRL+F5.
Visual Studio выполнит повторную сборку приложения. В открывшемся окне консоли отобразится запрос на ввод имени.
Введите свое имя в окне консоли и нажмите клавишу ВВОД.
Нажмите любую клавишу, чтобы закрыть окно консоли и остановить выполняющуюся программу.
Использование рефакторинга и IntelliSense
Рассмотрим несколько примеров того, как рефакторинг и IntelliSense помогают повысить эффективность кода.
Сначала переименуйте переменную name :
Дважды щелкните переменную name и введите для нее новое имя: username.
Вокруг переменной появится прямоугольник, а в поле появится значок лампочки.
Выберите значок лампочки для отображения доступных быстрых действий. Выберите Переименовать name в username.
Переменная переименовывается во всем проекте, то есть в нашем случае только в двух местах.
Появится поле с членами класса DateTime. В отдельном поле отобразится описание выбранного элемента.
Под этой строкой добавьте следующий фрагмент кода:
Код Console.Write отличается от Console.WriteLine тем, что не добавляет знак завершения строки после ее вывода. Это означает, что следующий фрагмент текста, отправляемый на вывод, будет выводиться в той же строке. Можно навести указатель мыши на каждый из этих методов в коде, чтобы просмотреть его описание.
Щелкните этот значок отвертки, чтобы просмотреть доступные предложения Visual Studio. В этом случае отображается рефакторинг Встроенная временная переменная для удаления строки кода без изменения его общего поведения.
Щелкните пункт Встроенная временная переменная, чтобы выполнить рефакторинг кода.
Снова запустите программу, нажав клавиши Ctrl+F5. Выходные данные выглядят следующим образом:
Отладка кода
При написании кода его следует регулярно запускать и проверять на предмет ошибок. Система отладки Visual Studio позволяет просматривать код с шагом в одну инструкцию, проверяя значения переменных. Вы можете задать точки останова, которые позволяют приостановить выполнение кода в определенной строке и увидеть, как изменяется значение переменной при выполнении кода.
В области навигации появится красный кружок, и эта строка будет выделена.
Начните отладку, выбрав пункты Отладка>Начать отладку или нажав клавишу F5.
Когда появится окно консоли с запросом имени, введите свое имя.
Фокус возвратится в редактор кода Visual Studio, и строка кода с точкой останова будет выделена желтым цветом. Желтый цвет означает, что эта строка кода будет выполняться следующей. Точка останова отвечает за приостановку работы приложения на этой строке.
Наведите указатель мыши на переменную username для просмотра ее значения. Кроме того, вы можете щелкнуть username правой кнопкой мыши и выбрать пункт Добавить контрольное значение, чтобы добавить переменную в окно контрольных значений, где можно будет просмотреть ее значение.
Нажмите клавишу F5 еще раз, чтобы завершить работу приложения.
Дополнительные сведения об отладке в Visual Studio см. в статье Знакомство с отладчиком Visual Studio.
Настройка Visual Studio
Вы можете настроить пользовательский интерфейс Visual Studio, в том числе изменить цветовую тему, установленную по умолчанию. Изменение цветовой темы
В строке меню выберите Сервис>Параметры, чтобы открыть диалоговое окно Параметры.
Откройте страницу параметров Окружение >Общие, измените значение Цветовая тема на Темная и щелкните ОК.
Цветовая тема для всей интегрированной среды разработки изменится на тему Темная.
В строке меню выберите Сервис>Параметры, чтобы открыть диалоговое окно Параметры.
На странице параметров Среда >Общие измените значение параметра Цветовая тема на Синий или Светлый. Затем нажмите кнопку ОК.
Цветовая тема для всей интегрированной среды разработки соответствующим образом изменится. На следующем снимке экрана показана синяя цветовая тема:
Дополнительные сведения о других способах персонализации интегрированной среды разработки см. в разделе Персонализация Visual Studio.
Следующие шаги
Узнайте больше о Visual Studio, прочитав одну из следующих вводных статей:
Ознакомьтесь с основными сведениями в этом модуле Learn: Введение в Visual Studio.
Познакомьтесь с редактором кода в статье Сведения об использовании редактора кода.
Узнайте, как Visual Studio упорядочивает код, в статье Сведения о проектах и решениях.
Если вы готовы к углубиться в вопросы написания кода, ознакомьтесь со следующими статьями о конкретных языках:
На начальном этапе написания кода также рекомендуется использовать учебное пособие:
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
It’s how you make software
Visual Studio can do that.
Meet the Visual Studio family
Visual Studio
Visual Studio for Mac
Visual Studio Code
A standalone source code editor that runs on Windows, macOS, and Linux. The top pick for JavaScript and web developers, with extensions to support just about any programming language.
By using Visual Studio Code you agree to its license & privacy statement
Still not sure which tool is best for you? We can help
Visual Studio Code for Windows
Lightweight yet powerful source code editor with tons of extensions for many languages and runtimes.
Hundreds of programming languages supported
Visual Studio Code for Mac
Hundreds of programming languages supported
Visual Studio for Mac
A complete array of development tools and features in native macOS experience for every stage of your software development.
Visual Studio Code for Linux
Hundreds of programming languages supported
Visual Studio for Windows
A complete array of development tools and features in one place to elevate and enhance every stage of your software development.
How to install offlineCompare editions
Announcing Microsoft Dev Box
Microsoft Dev Box provides developers with self-service access to high-performance, cloud based workstations preconfigured for your projects.
Microsoft Dev Box provides developers with self-service access to high-performance, cloud based workstations preconfigured for your projects.
Visual Studio 25th Anniversary
Join us in celebrating Visual Studio’s 25th anniversary. Watch the video, grab some swag!
Join us in celebrating Visual Studio’s 25th anniversary. Watch the video, grab some swag!
Visual Studio 2022
Visual Studio 2022 for Mac
Visual Studio Subscriptions
Get more from Visual Studio with a subscription! Get access to platforms like Azure, training, and more for your team.
Установка Visual Studio
Вас приветствует Visual Studio 2019! В этой версии можно легко выбрать и установить только необходимые компоненты. Поскольку она занимает меньше памяти, она быстро устанавливается и при установке меньше влияет на систему.
Вас приветствует Visual Studio 2022! В этой версии можно легко выбрать и установить только необходимые компоненты.
Этот раздел относится к Visual Studio в Windows. Информацию о Visual Studio для Mac см. в статье Установка Visual Studio для Mac.
Хотите ознакомиться с другими новыми возможностями этой версии? Обратитесь к заметкам о выпуске.
Хотите ознакомиться с другими новыми возможностями этой версии? Обратитесь к заметкам о выпуске.
Готовы к установке? Мы последовательно опишем каждое действие.
Шаг 1. Подготовка компьютера к установке Visual Studio
Перед началом установки Visual Studio:
Проверьте требования к системе. Так вы узнаете, поддерживает ли ваш компьютер Visual Studio 2019.
Примените актуальные обновления Windows. Эти обновления гарантируют, что на компьютере установлены последние обновления для системы безопасности и необходимые системные компоненты для Visual Studio.
Перезагрузите систему. Перезагрузка гарантирует, что ожидающие установки или обновления компоненты не будут препятствовать установке Visual Studio.
Освободите место. Удалите ненужные файлы и приложения с системного диска. Например, запустите приложение очистки диска.
Проверьте требования к системе. Так вы узнаете, может ли ваш компьютер поддерживать Visual Studio 2022.
Примените актуальные обновления Windows. Эти обновления гарантируют, что на компьютере установлены последние обновления для системы безопасности и необходимые системные компоненты для Visual Studio.
Перезагрузите систему. Перезагрузка гарантирует, что ожидающие установки или обновления компоненты не будут препятствовать установке Visual Studio.
Освободите место. Удалите ненужные файлы и приложения с системного диска. Например, запустите приложение очистки диска.
Сведения об использовании предыдущих версий Visual Studio параллельно с Visual Studio 2019 см. в разделе Целевая платформа и совместимость для Visual Studio 2019.
Visual Studio 2022 можно установить параллельно с предыдущими версиями. Дополнительные сведения см. в разделе Visual Studio 2022: выбор платформы и совместимость и Параллельная установка версий Visual Studio.
Шаг 2. Скачивание Visual Studio
Теперь скачайте файл начального загрузчика Visual Studio.
Для этого нажмите кнопку ниже, выберите нужный выпуск Visual Studio, щелкните Сохранить, а затем Открыть папку.
Для этого нажмите кнопку ниже, выберите нужный выпуск Visual Studio и сохраните его в папке Загрузки.
Шаг 3. Установка установщика Visual Studio
Запустите файл начального загрузчика, чтобы установить Visual Studio Installer. Новый установщик имеет меньший размер и включает все необходимое для установки и настройки Visual Studio.
В папке Загрузки дважды щелкните файл начального загрузчика, имя которого совпадает с именем одного из следующих файлов или похоже на них:
Если появляется оповещение системы контроля учетных записей, нажмите кнопку Да.
Мы попросим вас принять условия лицензии и заявление о конфиденциальности корпорации Майкрософт. Нажмите Продолжить.
Шаг 4. Выбор рабочих нагрузок
Когда завершится установка программы установки, вы можете с ее помощью выбрать нужные наборы функций (рабочих нагрузок). Вот как это сделать.
Найдите нужную рабочую нагрузку в Visual Studio Installer.
Например, выберите рабочую нагрузку «ASP.NET и разработка веб-приложений». В нее входит основной редактор кода по умолчанию, который предоставляет базовую поддержку редактирования кода для более чем 20 языков, возможность открывать и изменять код в любой папке без наличия проекта и интегрированное управление исходным кодом.
Выбрав нужные рабочие нагрузки, нажмите кнопку Установить.
Далее будут отображаться экраны состояния, на которых демонстрируется ход установки Visual Studio.
Выберите нужную рабочую нагрузку в Visual Studio Installer.
Выбрав нужные рабочие нагрузки, нажмите кнопку Установить.
Далее будут отображаться экраны состояния, на которых демонстрируется ход установки Visual Studio.
В любой момент после установки можно установить рабочие нагрузки или компоненты, которые не были установлены изначально. Если среда Visual Studio открыта, выберите пункт Сервис>Получить средства и компоненты. ; откроется Visual Studio Installer. Или откройте Visual Studio Installer из меню «Пуск». Здесь можно выбрать рабочие нагрузки или компоненты, которые нужно установить. Затем выберите Изменить.
Шаг 5. Выбор отдельных компонентов (необязательно)
Если вы не хотите пользоваться функцией рабочих нагрузок для настройки установки Visual Studio или хотите добавить дополнительные компоненты, которые не устанавливает рабочая нагрузка, это можно сделать путем установки или добавления отдельных компонентов на вкладке Отдельные компоненты. Выберите нужные компоненты и следуйте указаниям.
Шаг 6. Установка языковых пакетов (необязательно)
По умолчанию при первом запуске установщик пытается использовать язык операционной системы. Чтобы установить Visual Studio на нужном языке, выберите в Visual Studio Installer вкладку Языковые пакеты и следуйте указаниям.
Изменение языка установщика из командной строки
Шаг 7. Выбор расположения установки (дополнительно)
Вы можете уменьшить место, занимаемое установкой Visual Studio на системном диске. Вы можете переместить кэш загрузки, общие компоненты, пакеты SDK и средства на другие диски и оставить Visual Studio на самом быстром диске.
Вы можете уменьшить место, занимаемое установкой Visual Studio на системном диске. Дополнительные сведения см. в разделе Выбор расположений установки.
Вы можете выбрать другой диск для Visual Studio IDE или кэша загрузки только в том случае, если вы устанавливаете Visual Studio впервые. Если вы уже установили ее и хотите изменить диск, необходимо удалить Visual Studio, а затем переустановить ее.
Если вы уже установили Visual Studio на компьютере, вы не сможете изменить путь к общим компонентам, инструментам и пакетам SDK, этот пункт будет неактивен. Это общее расположение для всех установок Visual Studio.
Шаг 8. Начало разработки
Когда установка Visual Studio завершится, нажмите кнопку Запустить, чтобы приступить к разработке в Visual Studio.
На начальном экране выберите Создать проект.
В поле поиска введите тип приложения, которое вы хотите создать, чтобы просмотреть список доступных шаблонов. Список шаблонов зависит от рабочих нагрузок, выбранных во время установки. Чтобы просмотреть различные шаблоны, выберите разные рабочие нагрузки.
Можно также фильтровать поиск по определенному языку программирования с помощью раскрывающегося списка Язык. Вы также можете выбирать фильтры из списка Платформа и Тип проекта.
Новый проект откроется в Visual Studio, и вы можете приступить к написанию кода!
Когда установка Visual Studio завершится, нажмите кнопку Запустить, чтобы приступить к разработке в Visual Studio.
На начальном экране выберите Создать проект.
В поле поиска шаблонов введите тип приложения, которое вы хотите создать, чтобы просмотреть список доступных шаблонов. Список шаблонов зависит от рабочих нагрузок, выбранных во время установки. Чтобы просмотреть различные шаблоны, выберите разные рабочие нагрузки.
Можно также фильтровать поиск по определенному языку программирования с помощью раскрывающегося списка Язык. Вы также можете выбирать фильтры из списка Платформа и Тип проекта.
Новый проект откроется в Visual Studio, и вы можете приступить к написанию кода!
Поддержка или устранение неполадок
Иногда возникают проблемы. Если установить Visual Studio не удается, воспользуйтесь пошаговыми указаниями в статье Устранение неполадок при установке и обновлении Visual Studio.
Ниже приведены несколько дополнительных вариантов:
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Настройка Visual Studio Code для разработки go
В этом кратком руководстве описана установка и настройка расширения Go для Visual Studio Code.
В результатах опроса разработчиков Go 202041% респондентов выбрали Visual Studio Code в качестве наиболее предпочтительного редактора для Go. Это делает Visual Studio Code наиболее популярным редактором для разработчиков Go.
Visual Studio Code и расширение Go предоставляют IntelliSense, навигацию по коду и расширенную отладку. В этом кратком руководстве описана настройка Visual Studio Code. Затем вы напишете, запустите и отладите пример программы Go.
1. Установка Go
Чтобы установить Go, выполните следующие действия.
2. Установка Visual Studio Code
Чтобы установить Visual Studio Code, выполните следующие действия.
Учебник. Знакомство с интегрированной средой разработки Visual Studio
Из этого краткого (на 5–10 минут) описания возможностей среды разработки Visual Studio (IDE) вы узнаете о некоторых окнах, меню и других элементах пользовательского интерфейса.
Установите Visual Studio бесплатно со страницы скачиваемых материалов Visual Studio, если еще не сделали этого.
Окно запуска
После запуска Visual Studio вы прежде всего увидите начальное окно. Окно запуска помогает быстрее добраться до кода. Здесь есть действия, позволяющие клонировать или извлечь код, открыть существующий проект или решение, создать новый проект или просто открыть папку с файлами кода.
Если вы используете Visual Studio впервые, список последних проектов будет пустым.
Если вы работаете с базами кода не на основе MSBuild, выберите Открыть локальную папку, чтобы открыть код в Visual Studio. Дополнительные сведения см. в статье Разработка кода в Visual Studio без использования проектов и решений. Или вы можете создать новый проект или клонировать проект из поставщика источника, например GitHub или Azure DevOps.
Вариант Продолжить без кода просто открывает среду разработки Visual Studio без конкретного проекта или кода. Вы можете выбрать этот параметр, чтобы присоединиться к сеансу Live Share или к процессу для отладки. Нажмите ESC, чтобы закрыть окно запуска и открыть интегрированную среду разработки.
Окно запуска
После запуска Visual Studio вы прежде всего увидите начальное окно. Окно запуска помогает быстрее добраться до кода. Здесь есть варианты клонирования кода или его получения для изменения, открытия существующего проекта или решения, создания нового проекта или просто открытия папки с файлами кода.
Если вы используете Visual Studio впервые, список последних проектов будет пустым.
Если вы работаете с базами кода, в которых не используется MSBuild, выберите Открыть локальную папку, чтобы открыть код в Visual Studio. Дополнительные сведения см. в статье Разработка кода в Visual Studio без использования проектов и решений. Или вы можете создать новый проект или клонировать проект из поставщика источника, например GitHub или Azure DevOps.
Если вы выберете Продолжить без кода, вы просто откроете среду разработки Visual Studio без определенного проекта или загруженного кода. Вы можете выбрать этот параметр, чтобы присоединиться к сеансу Live Share или к процессу для отладки. Нажмите ESC, чтобы закрыть окно запуска и открыть интегрированную среду разработки.
Создание проекта
Чтобы продолжить изучение функций Visual Studio, давайте создадим новый проект.
На начальном экране выберите Создать проект.
Откроется окно Создание проекта с отображением нескольких шаблонов проектов. Шаблон содержит основные файлы и параметры, которые требуются для определенного типа проекта.
В нем можно выполнить поиск, фильтрацию и выбор шаблона проекта. Здесь также отображается список недавно использованных шаблонов проекта.
Введите в поле поиска вверху строку консоль, чтобы оставить в списке только те типы проектов, в имени которых есть слово «консоль». Дополнительно уточните результаты поиска, выбрав C# (или другой нужный язык) в раскрывающемся списке Все языки.
Если вы выбрали C#, Visual Basic или F#, выберите шаблон Консольное приложение и щелкните Далее. (Если выбран другой язык, просто выберите любой шаблон. Пользовательский интерфейс, который мы рассмотрим, аналогичен для всех языков программирования.)
В окне Настройка нового проекта сохраните имя и расположение проекта по умолчанию и щелкните Создать.
В окне Дополнительные сведения убедитесь, что в раскрывающемся меню Целевая платформа указано .NET Core 3.1, а затем щелкните Создать.
Будет создан проект. В окне редактора откроется файл с именем Program.cs. В редакторе отображается содержимое файлов. Кроме того, здесь вы можете выполнять основную часть работы с кодом в Visual Studio.
На начальном экране выберите Создать проект.
Откроется окно Создание проекта с отображением нескольких шаблонов проектов. Шаблон содержит основные файлы и параметры, которые требуются для определенного типа проекта.
В нем можно выполнить поиск, фильтрацию и выбор шаблона проекта. В окне Создание проекта также отображается список недавно использованных шаблонов проектов.
Введите в поле поиска вверху строку консоль, чтобы оставить в списке только те типы проектов, в имени которых есть слово «консоль». Дополнительно уточните результаты поиска, выбрав C# (или другой нужный язык) в раскрывающемся списке Все языки.
Если вы выбрали C#, Visual Basic или F#, выберите шаблон Консольное приложение и щелкните Далее. Для другого языка просто выберите любой шаблон.
В окне Настройка нового проекта сохраните имя и расположение проекта по умолчанию и щелкните Создать.
В окне Дополнительные сведения проверьте, что в раскрывающемся меню Платформа выбрано .NET 6.0, и щелкните Создать.
Наш проект создан. Выберите файл кода Program.cs в окне Обозреватель решений, которое обычно находится в правой части Visual Studio.
В окне Редактор откроется файл с именем Program.cs. В редакторе отображается содержимое файлов. Кроме того, здесь вы можете выполнять основную часть работы с кодом в Visual Studio.
Обозреватель решений
В обозревателе решений, который обычно находится в правой части Visual Studio, отображается графическое представление иерархии файлов и папок в проекте, решении или папке с кодом. В обозревателе решений можно просматривать эту иерархию и переходить к нужным файлам.
В обозревателе решений отображается графическое представление иерархии файлов и папок в проекте, решении или папке с кодом. Вы можете просмотреть иерархию и выбрать файл, чтобы открыть его в окне Редактор.
В меню в верхней части Visual Studio сгруппированы команды по категориям. Например, в меню Проект содержатся команды, связанные с проектом, над которым вы работаете. В меню Инструменты можно настроить Visual Studio, выбрав Параметры. Также можно включить в установку нужные компоненты, выбрав Получить средства и компоненты.
Список ошибок
В окне Список ошибок отображаются ошибки, предупреждения и сообщения о текущем состоянии кода. Если в файле или любой другой части проекта будут обнаружены ошибки (например, отсутствуют скобки или точка с запятой), они будут перечислены здесь.
Чтобы открыть окно Список ошибок, выберите Список ошибок в меню Вид.
Окно вывода
В окне вывода отображаются выходные сообщения от процесса сборки проекта и поставщика системы управления версиями.
Давайте создадим проект, чтобы просмотреть некоторые выходные данные сборки. В меню Построение выберите пункт Построить решение. Окно Вывод автоматически становится активным и отображает сообщение об успешном выполнении сборки.
поле поиска;
Поле поиска — это быстрый и простой способ поиска в Visual Studio. Сюда можно ввести текст о том, что вы хотите сделать, чтобы получить список соответствующих вариантов. Предположим, вам нужно детализировать выходные данные о сборке, чтобы отобразить дополнительные сведения о ее функциях. Вот как это можно сделать:
Чтобы активировать поле поиска в верхней части интегрированной среды разработки, нажмите клавиши Ctrl+Q.
Введите детализация в поле поиска. В отображаемом списке результатов выберите Change MSBuild verbosity (Изменить уровень детализации MSBuild).
На странице Сборка и запуск откроется диалоговое окно Параметры.
В разделе Степень подробности сообщений при сборке проекта MSBuild выберите значение Обычная и нажмите кнопку ОК.
Создайте проект еще раз, щелкнув правой кнопкой мыши проект ConsoleApp1 в обозревателе решений и выбрав Перестроить в контекстном меню.
На этот раз в окне Вывод отображаются более подробные сведения из журнала, связанные с процессом сборки. В нашем случае — о том, какие файлы были скопированы в определенное расположение.
Чтобы активировать поле поиска в верхней части интегрированной среды разработки, нажмите клавиши Ctrl+Q.
Введите детализация в поле поиска. В отображаемом списке результатов выберите Change MSBuild verbosity (Изменить уровень детализации MSBuild).
На странице Сборка и запуск откроется диалоговое окно Параметры.
В разделе Уровень детализации выходных данных сборки проекта MSBuild выберите Обычный и щелкните ОК.
Создайте проект еще раз, щелкнув правой кнопкой мыши проект ConsoleApp1 в обозревателе решений и выбрав Перестроить в контекстном меню.
На этот раз в окне Вывод отображаются более подробные сведения из журнала, связанные с процессом сборки. В нашем случае — о том, какие файлы были скопированы в определенное расположение.
Меню «Отправить отзыв»
Если у вас возникли проблемы при применении Visual Studio или есть предложения по улучшению этого продукта, вы можете использовать меню Отправить отзыв в верхней части окна Visual Studio.
Если у вас возникли проблемы с Visual Studio или есть предложения по улучшению этого продукта, вы можете сообщить нам об этом. Для этого нажмите кнопку Отправить отзыв в правом верхнем углу IDE и воспользуйтесь одним из вариантов в меню Отправить отзыв.
Дальнейшие действия
Мы рассмотрели лишь некоторые из возможностей Visual Studio, чтобы вы могли получить представление о пользовательском интерфейсе. Для дальнейшего ознакомления:
Добро пожаловать в интегрированную среду разработки Visual Studio
Интегрированная среда разработки (IDE) — это многофункциональная программа, которая поддерживает многие аспекты разработки программного обеспечения. Интегрированная среда разработки Visual Studio — это стартовая площадка для написания, отладки и сборки кода, а также последующей публикации приложений. Помимо стандартного редактора и отладчика, которые есть в большинстве сред IDE, Visual Studio включает в себя компиляторы, средства автозавершения кода, графические конструкторы и многие другие функции для улучшения процесса разработки.
На рисунке выше представлена среда Visual Studio с открытым проектом и подсказки по основным окнам и функциональных возможностях.
Справа в верхнем углу окна Обозревателя решений вы можете просматривать файлы кода, перемещаться по ним и управлять ими. Обозреватель решений позволяет упорядочить код путем объединения файлов в решения и проекты.
В центральном окне редактора, с которым вы, вероятно, будете работать дольше всего, отображается содержимое файла. В окне редактора вы можете вносить изменения в код или разрабатывать пользовательский интерфейс, например окно с кнопками или текстовые поля.
Окно Изменения Git в нижнем углу справа позволяет отслеживать рабочие элементы и предоставлять общий доступ к коду, используя Git, GitHub или другие технологии управления версиями.
Выпуски
Среда Visual Studio доступна для Windows и Mac. Функции Visual Studio для Mac во многом аналогичны возможностям Visual Studio для Windows и оптимизированы для разработки кросс-платформенных и мобильных приложений. Эта статья посвящена версии Visual Studio для Windows.
Существует три выпуска Visual Studio: Community, Professional и Enterprise. Сведения о функциях, поддерживаемых в каждом выпуске, см. на странице Сравнение выпусков Visual Studio.
Популярные средства повышения производительности
Вот несколько популярных возможностей Visual Studio, которые повышают производительность при разработке программного обеспечения:
Волнистые линии обозначают ошибки или потенциальные проблемы кода прямо во время ввода. Эти визуальные подсказки помогают немедленно устранить проблемы, не дожидаясь появления ошибок во время сборки или выполнения. Если навести указатель мыши на волнистую линию, на экран будут выведены дополнительные сведения об ошибке. Также в поле слева может отображаться лампочка, указывающая на наличие сведений о быстрых действиях для устранения ошибки.
Рефакторинг включает в себя такие операции, как интеллектуальное переименование переменных, извлечение одной или нескольких строк кода в новый метод и изменение порядка параметров методов.
IntelliSense — это набор возможностей, отображающих сведения о коде непосредственно в редакторе и в некоторых случаях автоматически создающих небольшие отрывки кода. По сути, это встроенная в редактор базовая документация, которая избавляет от необходимости искать информацию в других источниках.
На следующем рисунке показано, как IntelliSense отображает список членов типа:
Иногда вам будет казаться, что в Visual Studio слишком много меню, действий и свойств. Чтобы быстро находить функции интегрированной среды разработки или элементы кода, в Visual Studio представлен единый компонент поиска (CTRL+Q).
Дополнительные сведения и советы по повышению производительности см. в разделе Практическое руководство. Поиск в Visual Studio.
Дополнительные сведения и советы по повышению производительности см. в разделе Практическое руководство. Поиск в Visual Studio.
Предоставляет возможности совместного редактирования и отладки в реальном времени независимо от типа приложения или языка. Вы можете мгновенно предоставлять общий доступ к своему проекту с поддержкой высокого уровня безопасности. Кроме того, вы можете предоставлять общий доступ к сеансам, экземплярам терминала, веб-приложениям на локальном компьютере, голосовым звонкам и т. п.
В окне Иерархия вызовов показаны методы, вызывающие выбранный метод. Это может быть полезно, если вы собираетесь изменить либо удалить метод или хотите отследить ошибку.
CodeLens помогает находить ссылки на код, изменения кода, связанные с кодом ошибки, рабочие элементы, проверки кода и модульные тесты — не выходя из редактора.
Функция Перейти к определению позволяет перейти к расположению, где определена выбранная функция или тип.
В окне Показать определение можно отобразить метод или определение типа, не открывая отдельный файл.
Установка Visual Studio
В рамках этого раздела вы создаете простой проект для тестирования некоторых возможностей Visual Studio. IntelliSense используется как вспомогательный инструмент для программирования и отладки приложения, который позволяет просмотреть значение переменной во время выполнения приложения или изменить цветовую тему.
При первом запуске Visual Studio можно выполнить вход с использованием учетной записи Майкрософт или рабочей учетной записи.
Создание программы
Давайте создадим простую программу.
Запустите Visual Studio.
Откроется начальное окно, где можно клонировать репозиторий, открыть недавно использованный проект или создать новый.
Выберите Создать проект.
Откроется окно Создание проекта с отображением нескольких шаблонов проектов. Шаблон содержит основные файлы и параметры, которые требуются для определенного типа проекта.
Выберите шаблон Консольное приложение и щелкните Далее.
В окне Настройка нового проекта введите HelloWorld в поле Имя проекта, при необходимости измените расположение каталога для вашего проекта (по умолчанию используется путь C:\Users\ \source\repos ) и щелкните Далее.
В окне Дополнительные сведения убедитесь, что в раскрывающемся меню Целевая платформа указано .NET Core 3.1, а затем щелкните Создать.
Visual Studio создаст проект. Это простейший вариант приложения «Hello World», в котором вызывается метод Console.WriteLine() для вывода литеральной строки «Hello World!» в окне консоли (выходных данных программы).
Должно отобразиться примерно следующее:
Код C# для вашего приложения отображается в окне редактора, который занимает большую часть пространства. Обратите внимание, что текст автоматически выделяется цветом для обозначения разных частей кода, таких как ключевые слова и типы. Кроме того, небольшие вертикальные штриховые линии кода указывают, какие фигурные скобки соответствуют друг другу, а номера строк помогут вам найти нужный код позже. Чтобы свернуть или развернуть блоки кода, используйте небольшие рамки со знаком минус. Эта функция структурирования кода позволяет скрыть ненужный код на экране. Файлы вашего проекта перечислены в окне Обозревателя решений, которое находится справа.
Есть и другие доступные меню и окна инструментов, но об этом позже.
Теперь запустите приложение. Это можно сделать, выбрав Запуск без отладки в меню Отладка в строке меню. Можно также нажать клавиши CTRL+F5.
=»» «запуск=»» без=»» отладки».»=»» data-linktype=»relative-path»>
Когда Visual Studio создаст приложение, откроется окно консоли с сообщением Hello World!. Теперь у вас есть выполняемое приложение.
Чтобы закрыть окно консоли, нажмите любую клавишу.
Давайте добавим новый год в это приложение. Перед строкой Console.WriteLine(«Hello World!»); добавьте следующий код C#:
Этот код отображается сообщение What is your name? (Введите имя) в окне консоли и ожидает, чтобы пользователь ввел текст и нажал клавишу ВВОД.
Снова запустите приложение, выбрав пункты Отладка >Запуск без отладки или нажав клавиши CTRL+F5.
Visual Studio выполнит повторную сборку приложения. В открывшемся окне консоли отобразится запрос на ввод имени.
Введите свое имя в окне консоли и нажмите клавишу ВВОД.
Нажмите любую клавишу, чтобы закрыть окно консоли и остановить выполняющуюся программу.
Запустите среду Visual Studio. Откроется начальное окно, где можно клонировать репозиторий, открыть недавно использованный проект или создать новый.
Выберите Создать проект.
Откроется окно Создание проекта с отображением нескольких шаблонов проектов. Шаблон содержит основные файлы и параметры, которые требуются для определенного типа проекта.
Чтобы найти шаблон, попробуйте ввести или ввести ключевые слова в поле поиска. Список доступных шаблонов будет фильтроваться по введенным ключевым словам. Вы можете дополнительно отфильтровать результаты шаблона, выбрав C# в раскрывающемся списке Все языки, Windows в списке Все платформы и Консоль в списке Все типы проектов.
Выберите шаблон Консольное приложение и нажмите кнопку Далее.
В поле Имя проекта окна Настроить новый проект введите HelloWorld. При необходимости измените расположение каталога проекта в расположении по умолчанию C:\Users\ \source\repos, а затем нажмите кнопку Далее.
Убедитесь, что в окне Дополнительные сведения в раскрывающемся меню Целевая платформа указано .NET 6.0, а затем щелкните Создать.
Visual Studio создаст проект. Это простейший вариант приложения Hello World, в котором вызывается метод Console.WriteLine() для вывода строки Hello World! в окне консоли.
Файлы проекта отображаются справа в окне интегрированной среды разработки Visual Studio в окне с названием Обозреватель решений. В окне Обозреватель решений выберите файл Program.cs. Код C# для вашего приложения открывается в центральном окне редактора, который занимает большую часть пространства.
Код автоматически выделяется цветом для обозначения таких элементов, как ключевые слова и типы. Найти код можно по номерам строк.
Небольшие вертикальные пунктирные линии в коде указывают, какие фигурные скобки соответствуют друг другу. Чтобы свернуть или развернуть блоки кода, используйте небольшие рамки со знаками минус и плюс соответственно. Эта функция структурирования кода позволяет скрыть ненужный код на экране.
Также доступно множество других меню и окон инструментов.
Запустите приложение, выбрав в главном меню Visual Studio пункты Отладка>Запуск без отладки. Можно также нажать клавиши CTRL+F5.
=»» «запуск=»» без=»» отладки».»=»» data-linktype=»relative-path»>
Для закрытия окна консоли нажмите любую клавишу.
Давайте добавим новый год в это приложение. Перед строкой Console.WriteLine(«Hello World!»); добавьте следующий код C#:
Этот код позволяет отобразить сообщение What is your name? (Введите имя) в окне консоли и ожидает, чтобы пользователь ввел текст.
Измените строку с текстом Console.WriteLine(«Hello World!»); на следующую:
Снова запустите приложение, выбрав пункты Отладка >Запуск без отладки или нажав клавиши CTRL+F5.
Visual Studio выполнит повторную сборку приложения. В открывшемся окне консоли отобразится запрос на ввод имени.
Введите свое имя в окне консоли и нажмите клавишу ВВОД.
Нажмите любую клавишу, чтобы закрыть окно консоли и остановить выполняющуюся программу.
Использование рефакторинга и IntelliSense
Рассмотрим несколько примеров того, как рефакторинг и IntelliSense помогают повысить эффективность кода.
Сначала переименуйте переменную name :
Дважды щелкните переменную name и введите для нее новое имя: username.
Вокруг переменной появится прямоугольник, а в поле появится значок лампочки.
Выберите значок лампочки для отображения доступных быстрых действий. Выберите Переименовать name в username.
Переменная переименовывается во всем проекте, то есть в нашем случае только в двух местах.
Появится поле с членами класса DateTime. В отдельном поле отобразится описание выбранного элемента.
Под этой строкой добавьте следующий фрагмент кода:
Код Console.Write отличается от Console.WriteLine тем, что не добавляет знак завершения строки после ее вывода. Это означает, что следующий фрагмент текста, отправляемый на вывод, будет выводиться в той же строке. Можно навести указатель мыши на каждый из этих методов в коде, чтобы просмотреть его описание.
Щелкните этот значок отвертки, чтобы просмотреть доступные предложения Visual Studio. В этом случае отображается рефакторинг Встроенная временная переменная для удаления строки кода без изменения его общего поведения.
Щелкните пункт Встроенная временная переменная, чтобы выполнить рефакторинг кода.
Снова запустите программу, нажав клавиши Ctrl+F5. Выходные данные выглядят следующим образом:
Отладка кода
При написании кода его следует регулярно запускать и проверять на предмет ошибок. Система отладки Visual Studio позволяет просматривать код с шагом в одну инструкцию, проверяя значения переменных. Вы можете задать точки останова, которые позволяют приостановить выполнение кода в определенной строке и увидеть, как изменяется значение переменной при выполнении кода.
В области навигации появится красный кружок, и эта строка будет выделена.
Начните отладку, выбрав пункты Отладка>Начать отладку или нажав клавишу F5.
Когда появится окно консоли с запросом имени, введите свое имя.
Фокус возвратится в редактор кода Visual Studio, и строка кода с точкой останова будет выделена желтым цветом. Желтый цвет означает, что эта строка кода будет выполняться следующей. Точка останова отвечает за приостановку работы приложения на этой строке.
Наведите указатель мыши на переменную username для просмотра ее значения. Кроме того, вы можете щелкнуть username правой кнопкой мыши и выбрать пункт Добавить контрольное значение, чтобы добавить переменную в окно контрольных значений, где можно будет просмотреть ее значение.
Нажмите клавишу F5 еще раз, чтобы завершить работу приложения.
Дополнительные сведения об отладке в Visual Studio см. в статье Знакомство с отладчиком Visual Studio.
Настройка Visual Studio
Вы можете настроить пользовательский интерфейс Visual Studio, в том числе изменить цветовую тему, установленную по умолчанию. Изменение цветовой темы
В строке меню выберите Сервис>Параметры, чтобы открыть диалоговое окно Параметры.
Откройте страницу параметров Окружение >Общие, измените значение Цветовая тема на Темная и щелкните ОК.
Цветовая тема для всей интегрированной среды разработки изменится на тему Темная.
В строке меню выберите Сервис>Параметры, чтобы открыть диалоговое окно Параметры.
На странице параметров Среда >Общие измените значение параметра Цветовая тема на Синий или Светлый. Затем нажмите кнопку ОК.
Цветовая тема для всей интегрированной среды разработки соответствующим образом изменится. На следующем снимке экрана показана синяя цветовая тема:
Дополнительные сведения о других способах персонализации интегрированной среды разработки см. в разделе Персонализация Visual Studio.
Следующие шаги
Узнайте больше о Visual Studio, прочитав одну из следующих вводных статей:
Ознакомьтесь с основными сведениями в этом модуле Learn: Введение в Visual Studio.
Познакомьтесь с редактором кода в статье Сведения об использовании редактора кода.
Узнайте, как Visual Studio упорядочивает код, в статье Сведения о проектах и решениях.
Если вы готовы к углубиться в вопросы написания кода, ознакомьтесь со следующими статьями о конкретных языках:
На начальном этапе написания кода также рекомендуется использовать учебное пособие:
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Code editing. Redefined.
Free. Built on open source. Runs everywhere.
By using VS Code, you agree to its license and privacy statement.
Meet IntelliSense.
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past.
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in.
Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.
Extensible and customizable.
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.
Deploy with confidence and ease
With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.
VS Code for
Want new features sooner?
Use vscode.dev for quick edits online!
GitHub, Azure Repos, and local files.
License and Privacy Terms
By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.
Using GCC with MinGW
In this tutorial, you configure Visual Studio Code to use the GCC C++ compiler (g++) and GDB debugger from mingw-w64 to create programs that run on Windows.
After configuring VS Code, you will compile and debug a simple Hello World program in VS Code. This tutorial does not teach you about GCC, GDB, Mingw-w64, or the C++ language. For those subjects, there are many good resources available on the Web.
If you have any problems, feel free to file an issue for this tutorial in the VS Code documentation repository.
Prerequisites
To successfully complete this tutorial, you must do the following steps:
Install the C/C++ extension for VS Code. You can install the C/C++ extension by searching for ‘c++’ in the Extensions view ( ⇧⌘X (Windows, Linux Ctrl+Shift+X ) ).
Get the latest version of Mingw-w64 via MSYS2, which provides up-to-date native builds of GCC, Mingw-w64, and other helpful C++ tools and libraries. You can download the latest installer from the MSYS2 page or use this link to the installer.
Add the path to your Mingw-w64 bin folder to the Windows PATH environment variable by using the following steps:
Check your MinGW installation
To check that your Mingw-w64 tools are correctly installed and available, open a new Command Prompt and type:
If you don’t see the expected output or g++ or gdb is not a recognized command, make sure your PATH entry matches the Mingw-w64 binary location where the compilers are located. If the compilers do not exist at that PATH entry, make sure you followed the instructions on the MSYS2 website to install Mingw-w64.
Create Hello World
Add a source code file
Add hello world source code
Now paste in this source code:
Now press ⌘S (Windows, Linux Ctrl+S ) to save the file. Notice how the file you just added appears in the File Explorer view ( ⇧⌘E (Windows, Linux Ctrl+Shift+E ) ) in the side bar of VS Code:
You can also enable Auto Save to automatically save your file changes, by checking Auto Save in the main File menu.
The Activity Bar on the far left lets you open different views such as Search, Source Control, and Run. You’ll look at the Run view later in this tutorial. You can find out more about the other views in the VS Code User Interface documentation.
Note: When you save or open a C++ file, you may see a notification from the C/C++ extension about the availability of an Insiders version, which lets you test new features and fixes. You can ignore this notification by selecting the X (Clear Notification).
Explore IntelliSense
In your new helloworld.cpp file, hover over vector or string to see type information. After the declaration of the msg variable, start typing msg. as you would when calling a member function. You should immediately see a completion list that shows all the member functions, and a window that shows the type information for the msg object:
You can press the Tab key to insert the selected member; then, when you add the opening parenthesis, you will see information about any arguments that the function requires.
Run helloworld.cpp
Remember, the C++ extension uses the C++ compiler you have installed on your machine to build your program. Make sure you have a C++ compiler installed before attempting to run and debug helloworld.cpp in VS Code.
Open helloworld.cpp so that it is the active file.
Press the play button in the top right corner of the editor.
Choose C/C++: g++.exe build and debug active file from the list of detected compilers on your system.
After the build succeeds, your program’s output will appear in the integrated Terminal.
Your new tasks.json file should look similar to the JSON below:
Note: You can learn more about tasks.json variables in the variables reference.
The command setting specifies the program to run; in this case that is g++. The args array specifies the command-line arguments that will be passed to g++. These arguments must be specified in the order expected by the compiler.
The label value is what you will see in the tasks list; you can name this whatever you like.
The detail value is what you will as the description of the task in the tasks list. It’s highly recommended to rename this value to differentiate it from similar tasks.
Modifying tasks.json
Debug helloworld.cpp
The play button has two modes: Run C/C++ File and Debug C/C++ File. It will default to the last-used mode. If you see the debug icon in the play button, you can just click the play button to debug, instead of using the drop-down.
Explore the debugger
Before you start stepping through the code, let’s take a moment to notice several changes in the user interface:
The Integrated Terminal appears at the bottom of the source code editor. In the Debug Output tab, you see output that indicates the debugger is up and running.
The editor highlights the line where you set a breakpoint before starting the debugger:
The Run and Debug view on the left shows debugging information. You’ll see an example later in the tutorial.
At the top of the code editor, a debugging control panel appears. You can move this around the screen by grabbing the dots on the left side.
Step through the code
Now you’re ready to start stepping through the code.
Click or press the Step over icon in the debugging control panel.
This will advance program execution to the first line of the for loop, and skip over all the internal function calls within the vector and string classes that are invoked when the msg variable is created and initialized. Notice the change in the Variables window on the left.
In this case, the errors are expected because, although the variable names for the loop are now visible to the debugger, the statement has not executed yet, so there is nothing to read at this point. The contents of msg are visible, however, because that statement has completed.
Press Step over again to advance to the next statement in this program (skipping over all the internal code that is executed to initialize the loop). Now, the Variables window shows information about the loop variables.
Press Step over again to execute the cout statement. (Note that as of the March 2019 release, the C++ extension does not print any output to the Debug Console until the loop exits.)
If you like, you can keep pressing Step over until all the words in the vector have been printed to the console. But if you are curious, try pressing the Step Into button to step through source code in the C++ standard library!
When the loop has completed, you can see the output in the Integrated Terminal, along with some other diagnostic information that is output by GDB.
Set a watch
Sometimes you might want to keep track of the value of a variable as your program executes. You can do this by setting a watch on the variable.
To quickly view the value of any variable while execution is paused on a breakpoint, you can hover over it with the mouse pointer.
Customize debugging with launch.json
There are cases where you’d want to customize your debug configuration, such as specifying arguments to pass to the program at runtime. You can define custom debug configurations in a launch.json file.
You’ll then see a dropdown for various predefined debugging configurations. Choose C/C++: g++.exe build and debug active file.
VS Code creates a launch.json file, which looks something like this:
Change the stopAtEntry value to true to cause the debugger to stop on the main method when you start debugging.
From now on, the play button and F5 will read from your launch.json file when launching your program for debugging.
C/C++ configurations
If you want more control over the C/C++ extension, you can create a c_cpp_properties.json file, which will allow you to change settings such as the path to the compiler, include paths, C++ standard (default is C++17), and more.
You can view the C/C++ configuration UI by running the command C/C++: Edit Configurations (UI) from the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ).
Here, we’ve changed the Configuration name to GCC, set the Compiler path dropdown to the g++ compiler, and the IntelliSense mode to match the compiler (gcc-x64)
You only need to add to the Include path array setting if your program includes header files that are not in your workspace or in the standard library path.
Compiler path
The extension uses the compilerPath setting to infer the path to the C++ standard library header files. When the extension knows where to find those files, it can provide features like smart completions and Go to Definition navigation.
The C/C++ extension attempts to populate compilerPath with the default compiler location based on what it finds on your system. The extension looks in several common compiler locations.
The compilerPath search order is:
Troubleshooting
MSYS2 is installed, but g++ and gdb are still not found
You must follow the steps on the MSYS2 website and use the MSYS CLI to install Mingw-w64, which contains those tools.
MinGW 32-bit
If you need a 32-bit version of the MinGW toolset, consult the Downloading section on the MSYS2 wiki. It includes links to both 32-bit and 64-bit installation options.
July 2019 (version 1.37)
Update 1.37.1: The update addresses these issues.
Welcome to the July 2019 release of Visual Studio Code. There are a number of updates in this version that we hope you will like, some of the key highlights include:
If you’d like to read these release notes online, go to Updates on code.visualstudio.com.
You can also check out this 1.37 release highlights video from Developer Advocate Brian Clark.
Insiders: Want to see new features as soon as possible? You can download the nightly Insiders build and try the latest updates as soon as they are available. And for the latest Visual Studio Code news, updates, and content, follow us on Twitter @code!
Workbench
New product icons
We’ve updated all of our product icons to be uniform in style, color, and size. We went through various iterations and the community was helpful in providing feedback through every step of the process.
Note: This does not cover our use of Octicons, those icons appear in the Status bar and Quick pick.
Settings editor support for string arrays
The Settings editor now allows editing array-of-string settings. The Add Item button will bring up an input box to add a new string.
Extension authors can enable this support by contributing a configuration with type and items keys:
Removed warnings from settings files
You will no longer see warnings for unknown or unsupported settings in your settings.json files. Instead inactive settings will be faded, similar to unused source code, with a hover explaining why. In addition, you won’t see warnings for settings from extensions that are currently disabled.
Reveal search result in the Explorer
The file context menu in the Search view now has a Reveal in Explorer command to navigate to that file in the File Explorer.
Search regex features
Back in the 1.29 release, we added the setting search.usePCRE2 to make search use the PCRE2 regex engine. This enabled searching with some advanced regex features such as backreferences and lookahead assertions. Thanks to some upstream work in ripgrep, you can now use these features without enabling a special setting. ripgrep will fall back to the PCRE2 engine automatically if the regex uses a feature that isn’t supported by the Rust regex engine, and search.usePCRE2 is now deprecated. As a reminder, VS Code only supports regexes that are valid in JavaScript, because open editors are still searched using the editor’s JavaScript-based search.
NPM Scripts Explorer visible by default
Previously, you had to enable the setting npm.enableScriptExplorer to make the NPM Scripts Explorer visible and this was difficult to discover. The NPM Scripts Explorer is now shown collapsed in the File Explorer, when there is a package.json file at the root of the workspace.
When you have no package.json at the root in your workspace, you can still use the setting to enable the NPM Scripts Explorer. If you want to hide the explorer, you can right-click on its title and select Hide from the context menu.
focusedView context key
Accessibility improvements
We fixed accessibility issues across the workbench. A full list of the issues fixed can be found on GitHub with the ‘accessibility’ label.
New tree widget adopted in tree view
Extensions that contribute tree views will now get the new tree widget experience. The tree widget provides better performance as well as improved keyboard navigation, filtering, custom indenting, horizontal scrolling, and more. If your favorite extensions have custom tree views, you should see the same UX improvements that were added earlier to the built-in VS Code explorers.
Editor
Show whitespace in selection
The editor.renderWhitespace setting now supports a selection option. With this option set, whitespace characters will be shown only on selected text:
This is handy for quickly checking whitespace without filling the entire editor.
Improved minimap search results visibility
In the previous release, we introduced search decorations in the minimap (code outline). These decorations were difficult to see, so this iteration, we’ve worked on increasing their visibility. Now, the entire line will now be highlighted with low opacity in the minimap, and the actual match shown with high opacity.
You can also change the color of the decorations using the new minimap.findMatchHighlight theme color.
Preserve case in Find and Replace
You can now preserve case when doing replacement in the editor’s Find widget. The feature is turned on when the Preserve Case option (AB button) is turned on in the editor’s Replace input box.
Currently VS Code only supports preserve Full Upper Case, Full Lower Case, and Title Case.
Button toggle active state in Find widget
We’ve updated the Find widget’s button toggle active state with a filled background so that you can now easily tell when you are focused on an active toggle. This appears in the Search view, Find and Replace, and Terminal Find.
Updated info colors
Following the unification of the warning colors, we’ve also updated editorInfoForeground and editorInfoBorder to match the rest of the information diagnostics colors. You’ll see this updated color in the Peek error view and editor squiggles:
Integrated Terminal
Search UX improvements
Previously searching within the terminal would start at the top of the terminal’s viewport and search downwards. When it reached the bottom, it would wrap to the top. The new behavior aligns with several other terminal emulators and starts from the bottom of the buffer and searches upwards, leading to a much less disorienting experience.
Terminal accessibility improvements
These are the new commands if you want to customize the keybindings:
Other accessibility improvements were also made:
Variables resolved in settings
Variables can now be used within the following settings:
For example, you no longer need an extension to open a terminal in the current file’s folder, just add this setting:
Improved error reporting and diagnostics
Previously when the terminal launched with a bad configuration, it would only indicate that the process exited with an error code. Better error messages are now provided that guide the user to solutions for several common scenarios.
Languages
Improved navigation for SCSS @import
Improved CSS property value completion
CSS completion now offers detailed documentation for an additional 754 CSS property values, including less commonly used values.
Use syntax only feature of JavaScript and TypeScript more quickly
Last release, we added an experimental setting that splits the TypeScript server that powers VS Code’s JavaScript and TypeScript language features into separate syntax and semantic servers.
With VS Code 1.37, the split server is now enabled by default. This means that for large JavaScript and TypeScript projects, syntax-based operations, such as code folding or document outlines, should be available more quickly.
Tasks
TypeScript detected tasks warning
$ variable for task and debug configurations
resolveTask support
Contributions to extensions
Remote Development (Preview)
Work has continued on the Remote Development extensions, which allow you to use a container, remote machine, or the Windows Subsystem for Linux (WSL) as a full-featured development environment. You can learn about new extension features and bug fixes in the Remote Development release notes.
You can also read two recent blog posts describing:
Java supports smart selection
The Microsoft Java extension now supports smart semantic selection. You can expand or shrink the selection range based on the semantic information of the caret position in your source code.
Extension authoring
vscode.workspace.fs
There is new API for extensions to read, write, and manage files and folders. This is an alternative to Node.js’s fs file system module and more importantly, it allows access to files from contributed file systems, such as the SSH or WSL remote file systems.
The snippet below shows how to write to a file, more usage samples can be found in the fsconsumer-sample.
Call to Action: If your extension is currently using the fs module from Node.js, consider migrating to the new vscode.workspace.fs API.
DiagnosticsTag.Deprecated
The diagnostic in the image above is created by the validate function shown below. The line diag.tags = [vscode.DiagnosticTag.Deprecated]; adds the deprecation tag.
vscode.workspace.workspaceFile
There is a new workspace property workspace.workspaceFile returning the location of the workspace file. For example: file:///Users/name/Development/myProject.code-workspace or untitled:1555503116870 for a workspace that is untitled and not yet saved.
Depending on the workspace that is opened, the value will be:
If the workspace is untitled, the returned URI will use the untitled: scheme.
One use of the workspace file location is to call the vscode.openFolder command to open the workspace again after it has been closed:
Note: It is not recommended using the workspace.workspaceFile location to write configuration data directly into the file. Instead use the workspace.getConfiguration().update() method, which will work both when a single folder is opened as well as an untitled or saved workspace.
vscode.env.shell
The proposed vscode.env.shell API is now stable. This should be used to get the default shell for the terminal instead of the terminal.integrated.shell.
Support for OR in when clauses
It is now possible to use logical OR ( || ) in various contribution points where a when clause is expected.
For example, when adding menu contributions:
New theme color for active input options
Install extensions before running extension integration test
Updated Travis CI script for running extension integration tests on Linux
The recommended configuration (see below) for extension integration tests might not work in the latest Travis CI Linux environment:
You can now use the Xvfb script below instead:
Proposed extension APIs
Every milestone comes with new proposed APIs and extension authors can try them out. As always we are keen on your feedback. This is what you have to do to try out a proposed API:
Note that you cannot publish an extension that uses a proposed API. We may likely make breaking changes in the next release and we never want to break existing extensions.
Extension terminals
The proposed TerminalRenderer API introduced last year has gone through a major change and is now deprecated in favor of «Extension Terminals». The new API aligns much more with how the terminal actually works, the extension now implements a Pseudoterminal object, which is similar to a *nix-style pty.
Here’s the current proposal:
Here are some of the big changes:
Here is a simple example of how you could do a simple terminal that echoes back your input:
We hope to stabilize this and remove the deprecated terminal renderers relatively quickly, likely between v1.38 and v1.39.
vscode.CustomExecution2
vscode.commands.onDidExecuteCommand
There is a new event that fires whenever a command has been executed and the event’s payload identifies the command and arguments.
Webview.toWebviewResource and Webview.cspSource
There are now two proposed properties on webviews:
For desktop VS Code, this will convert file: URIs into vscode-resource: URIs.
Engineering
Removing suppressImplicitAnyIndexErrors in the VS Code codebase
When we enabled strict null checking for VS Code’s source, we also turned on «suppressImplicitAnyIndexErrors»: true in the TypeScript compiler. This setting allows using bracket accessors on values, even if the value’s type does not specifically have an index access signature.
This is problematic because it can easily end up hiding errors that TypeScript could have caught:
This iteration, we removed the suppressImplicitAnyIndexErrors workaround and fixed the 250 or so errors it was suppressing. The two most common fixes were to add explicit index signatures and to switch to using a proper Map type for storing a map instead of using an object literal.
Progress on grid-based workbench layout
This milestone, we picked up on the efforts started a few milestones regarding a grid-based layout for the workbench. Once our initial solution is complete, the new version of the workbench should function similarly, but it will be more flexible for adding new layout options and features.
Continued exploration of iframe-based webviews
We continued our exploration of using normal iframes to host VS Code’s webviews. As part of this, we now support loading every iframe-based webview in a unique origin. This ensures that webviews from multiple extensions cannot affect one another.
New documentation
Remote Development tutorials
There are new introductory tutorials to walk you through running Visual Studio Code with the Remote Development extensions.
Notable fixes
Thank you
Last but certainly not least, a big Thank You! to the following folks that helped to make VS Code even better:
Contributions to vscode :
Contributions to our issue tracking:
Please see our Community Issue Tracking page, if you want to help us manage incoming issues.
Contributions to language-server-protocol :
Contributions to debug-adapter-protocol :
Contributions to vscode-generator-code :
Contributions to vscode-vsce :
Contributions to inno-updater :
Contributions to localization :
There are over 800 Cloud + AI Localization community members using the Microsoft Localization Community Platform (MLCP), with over about 100 active contributors to Visual Studio Code. We appreciate your contributions, either by providing new translations, voting on translations, or suggesting process improvements.
Источники:
- http://docs.microsoft.com/ru-ru/visualstudio/install/install-visual-studio?view=vs-2022
- http://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio?view=vs-2022
- http://code.visualstudio.com/?wd=&eqid=b18fa204000241ea0000000457edc38d
- http://docs.microsoft.com/ru-RU/visualstudio/install/install-visual-studio?view=vs-2022
- http://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio?view=vs-2019
- http://habr.com/en/company/microsoft/blog/262523/
- http://code.visualstudio.com/?ocid=aid3016779
- http://code.visualstudio.com/?WT.mc_id=blog-devto-gllemos
- http://code.visualstudio.com/?wt.mc_id=mspevent-github-gllemos
- http://docs.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio?view=vs-2022
- http://code.visualstudio.com/?q=amazon&ref=shappify
- http://code.visualstudio.com/docs/setup/windows?source=post_page——74f182f52251———————-
- http://code.visualstudio.com/?ref=crazy-cute-co
- http://visualstudio.microsoft.com/downloads/?CR_CC=200657566
- http://code.visualstudio.com/?WT.mc_id=13466-DEV-noupe-article42
- http://code.visualstudio.com/?WT.mc_id=breadsoph-devto-chcondon
- http://code.visualstudio.com/updates/v1_26
- http://code.visualstudio.com/updates/v1_53
- http://docs.microsoft.com/ru-ru/visualstudio/get-started/visual-studio-ide?view=vs-2019&viewFallbackFrom=vsts
- http://code.visualstudio.com/?WT.mc_id=16572-DEV-codeproject-article57
- http://docs.microsoft.com/ru-ru/VisualStudio/install/install-visual-studio?view=vs-2022
- http://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
- http://docs.microsoft.com/ru-ru/visualstudio/get-started/visual-studio-ide?view=vs-2019
- http://code.visualstudio.com/?http://WT.mc_id=breadsoph-github-chcondon
- http://code.visualstudio.com/?WT.mc_id=devto-blog-cxa
- http://visualstudio.microsoft.com/
- http://docs.microsoft.com/ru-RU/visualstudio/install/install-visual-studio?view=vs-2019
- http://code.visualstudio.com/?WT.mc_id=other-azuredevtips-micrum
- http://code.visualstudio.com/?WT.mc_id=academic-0000-jopapa
- http://code.visualstudio.com/?WT.mc_id=julyot-azd-dglover
- http://docs.microsoft.com/ru-ru/azure/developer/go/configure-visual-studio-code
- http://docs.microsoft.com/ru-ru/visualstudio/ide/quickstart-ide-orientation?view=vs-2022
- http://docs.microsoft.com/ru-ru/visualstudio/get-started/visual-studio-ide?view=vs-2022
- http://code.visualstudio.com/?WT.mc_id=13571-DEV-codeproject-article48
- http://code.visualstudio.com/?ref=hazel-hoyle
- http://code.visualstudio.com/?wt.mc_id=devroadshowiot-github-wachegha
- http://code.visualstudio.com/?WT.mc_id=azurespringcloud-github-judubois
- http://code.visualstudio.com/?wt.mc_id=angularpreload-github-jopapa
- http://code.visualstudio.com/?WT.mc_id=13451-DEV-noupe-article27
- http://code.visualstudio.com/?wt.mc_id=mlops-github-taallard
- http://code.visualstudio.com/docs/cpp/config-mingw
- http://code.visualstudio.com/updates/v1_37