Skip to content

Repo sync for protected branch #10098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
79d4b41
Update create-a-network-installation-of-visual-studio.md
christineruana Feb 22, 2024
46a328f
Update create-a-network-installation-of-visual-studio.md
christineruana Feb 22, 2024
73038ab
Update create-a-network-installation-of-visual-studio.md
christineruana Feb 22, 2024
298e0ce
Merge branch 'MicrosoftDocs:main' into main
christineruana Feb 29, 2024
83c4b6a
Update import-export-installation-configurations.md
christineruana Mar 1, 2024
a79d0e8
Apply suggestions from code review
christineruana Mar 4, 2024
3c34736
Apply suggestions from code review
christineruana Mar 4, 2024
63c9e62
Update docs/install/import-export-installation-configurations.md
christineruana Mar 4, 2024
e347d4b
Update import-export-installation-configurations.md
christineruana Mar 4, 2024
b892753
Update create-a-network-installation-of-visual-studio.md
christineruana Mar 4, 2024
a457191
Apply suggestions from code review
christineruana Mar 5, 2024
0f2e972
Update docs/install/import-export-installation-configurations.md
christineruana Mar 5, 2024
649f584
Adding section on general assistance
Mikejo5000 Mar 5, 2024
c4890e8
edits
Mikejo5000 Mar 5, 2024
11083ef
Update docs/install/create-a-network-installation-of-visual-studio.md
anandmeg Mar 5, 2024
a54d501
Update docs/install/create-a-network-installation-of-visual-studio.md
anandmeg Mar 5, 2024
789cc91
edits
Mikejo5000 Mar 5, 2024
5dd7fa7
edits
Mikejo5000 Mar 5, 2024
e898cff
art updates
Mikejo5000 Mar 5, 2024
5018080
link fix
Mikejo5000 Mar 5, 2024
96353d7
tweak
Mikejo5000 Mar 5, 2024
d965f46
Merge pull request #12242 from christineruana/main
Stacyrch140 Mar 5, 2024
8c01c1c
Merge pull request #12260 from Mikejo5000/mikejo-br23
Stacyrch140 Mar 5, 2024
f25546f
Merge pull request #12262 from MicrosoftDocs/repo_sync_working_branch
Taojunshen Mar 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 59 additions & 7 deletions docs/debugger/debug-with-copilot.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Debug with GitHub Copilot
description: Use Copilot to help debug your apps and provide performance insights.
ms.date: 02/14/2024
ms.date: 03/04/2024
ms.topic: how-to
dev_langs:
- CSharp
Expand All @@ -17,14 +17,17 @@ manager: jmartens
ms.subservice: ai-tools
monikerRange: '>= vs-2022'
---

# Debug your app with GitHub Copilot in Visual Studio

[**GitHub Copilot**](https://marketplace.visualstudio.com/items?itemName=GitHub.copilotvs) and [**GitHub Copilot Chat**](https://aka.ms/VSXGHCopilot) extensions in Visual Studio enable many interactive debugging scenarios, including AI-assisted chat for debugging questions related to your code. Copilot understands call stacks, frames, variable names, and values. As a result, you can ask detailed questions to the debugger-aware Copilot. In addition, Copilot provides an **Ask Copilot** link for AI-assisted help focused on the following scenarios:
In this article, you'll learn how to debug more efficiently using GitHub Copilot. Copilot can provide code fixes along with in-depth analysis and explanations of how code works. It helps with proposed fixes to bugs, and explains things such as exceptions. Copilot understands call stacks, frames, variable names, and values. As a result, you can interact with the debugger-aware AI to ask detailed questions related to your code and to debugging issues in general.

In addition, Copilot provides more precise help for a few targeted scenarios including the following:

- Exceptions
- Auto Insights for CPU Usage

In this article, you'll learn how to debug more efficiently using the Copilot Chat extension and the **Ask Copilot** link.
To get AI assistance While you're debugging in these scenarios, look for the **Ask Copilot** ![Screenshot of Ask Copilot button.](../debugger/media/vs-2022/debug-with-copilot-ask-copilot-button.png) button.

For more information on the GitHub Copilot extension in Visual Studio, see [About the GitHub Copilot extension for Visual Studio](../ide/visual-studio-github-copilot-extension.md).

Expand All @@ -40,9 +43,12 @@ To get started, you need:
> [!NOTE]
> If you experience authentication issues after installing the extension, see [Troubleshooting authentication issues with GitHub Copilot Chat](https://docs.github.com/en/copilot/troubleshooting-github-copilot/troubleshooting-authentication-issues-with-github-copilot-chat).

## Get AI assistance for an exception
## Get AI assistance to debug your app

The following simple example shows how to get AI assistance when you encounter an exception and how to quickly update your code based on AI-suggested fixes.
The following simple example shows how to get AI assistance using the inline Chat view.

> [!NOTE]
> You can also get help using the separate Chat window by selecting **View > GitHub Copilot Chat**. For more information, see [What is the GitHub Copilot Chat extension for Visual Studio?](../ide/visual-studio-github-copilot-chat.md).

### Start a debugging session

Expand Down Expand Up @@ -76,8 +82,54 @@ The following simple example shows how to get AI assistance when you encounter a
}
```

1. Right-click the following statement and choose **Breakpoint** > **Insert Breakpoint**.

```csharp
int value = Int32.Parse(args[0]);
```

1. Press **F5** or select **Start Debugging** from the **Debug** menu.

The app pauses at the breakpoint. The Autos window shows that the args variable has a value of `string[0]`.

![Screenshot of Autos window.](../debugger/media/vs-2022/debug-with-copilot-autos-window.png)

1. Right-click in the code and choose **Ask Copilot** to open the inline Chat view.

1. Type the following question in the inline Chat view:

```
Why does the args variable have a value of string[0]?
```

![Screenshot of inline Copilot Chat.](../debugger/media/vs-2022/debug-with-copilot-inline-chat.png)

When you press **Enter**, Copilot provides an answer based on its understanding of your code. (You might get a different response than what is shown here.)

![Screenshot of Copilot answered question.](../debugger/media/vs-2022/debug-with-copilot-inline-chat-answer.png)

If Copilot has a suggested fix for your code, it shows you. If not, you can ask Copilot for a code suggestion.

1. In this example, scroll to the end of the Copilot answer and select the follow-up question at the end of the inline Chat window, "How can I handle the case when no arguments are passed to the program?"

![Screenshot of Copilot follow-up question.](../debugger/media/vs-2022/debug-with-copilot-inline-chat-generated-question.png)

Copilot shows a suggested fix to your code.

![Screenshot of Copilot suggested fix.](../debugger/media/vs-2022/debug-with-copilot-inline-chat-suggested-fix.png)

If you want to apply the code fix, choose **Accept**.

1. Choose **Cancel** so we can continue learning other features of Copilot in the next section.

## Get AI assistance for an exception

The following simple example shows how to get AI assistance when you encounter an exception and how to quickly update your code based on AI-suggested fixes.

### Start a debugging session

- While paused in the debugger using the same sample app, press **F11** or **Debug** > **Step Into** to execute the current statement.

An `IndexOutOfRangeException` occurs and the app pauses, showing the exception.

To get AI assistance for the exception, continue to the next section.
Expand All @@ -90,7 +142,7 @@ The following simple example shows how to get AI assistance when you encounter a

If it's not already open, the Copilot Chat window appears and provides an assessment of the error and why it occurred. In this example, Copilot identifies a suggested code fix, a button to copy code, and a **Preview** button for the code fix.

If you have questions about the exception, ask them in the Ask Copilot text box. Copilot understands debugging concepts such as call stacks, frames, variable names, and values.
If you have questions about the exception, ask them in the Ask Copilot text box.

1. Select the **Preview** button.

Expand All @@ -108,7 +160,7 @@ The following simple example shows how to get AI assistance when you encounter a

## Get AI assistance for auto insights

In addition to interactive debugging assistance, Copilot provides detailed information in the CPU Usage auto insights. It provides information and insights for specific methods and properties, such as `String.Concat` and many other methods. With Copilot, ask questions about functions on the identified hot paths in your code, which can help you produce more efficient or cost-effective code.
In addition to interactive debugging assistance, Copilot provides detailed information in the CPU Usage [Auto Insights](../profiling/cpu-insights.md). It provides information and insights related to a set of specific performance insights. With Copilot, ask questions about functions on the identified hot paths in your code, which can help you produce more efficient or cost-effective code.

When the CPU Usage tool provides auto insights in the Top Insights section, select **Ask Copilot** to learn from Copilot and start asking questions.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/debugger/media/vs-2022/debug-with-copilot-top-insights.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 15 additions & 8 deletions docs/install/create-a-network-installation-of-visual-studio.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Create a network-based installation
description: Create a private network install point to deploy Visual Studio to support enterprise users with limited permissions or client machines with limited internet access.
ms.date: 11/27/2023
ms.date: 3/4/2024
ms.topic: conceptual
helpviewer_keywords:
- '{{PLACEHOLDER}}'
Expand All @@ -14,11 +14,18 @@ ms.subservice: installation
---
# Create and maintain a network installation of Visual Studio

Sometimes an enterprise administrator wants to create a private installation point that contains Visual Studio files that can be [deployed to client machines within an organization](deploy-a-layout-onto-a-client-machine.md). Creating a private installation point is useful for situations where a user may have limited permissions, where the client machines may have limited access to the internet, or when an organization wants to standardize on a particular version of the developer toolset. We designed Visual Studio so that an administrator can both create and maintain a "layout", which is a private cache of Visual Studio files, that can be stored on an internal network share and can be made available on an organization's intranet. The layout serves as the source location for all Visual Studio files needed for both initial client installation and subsequent updates.
Sometimes an enterprise administrator wants to create a private installation cache (also known as a "layout") that contains Visual Studio files that can be [deployed to client machines within an organization](deploy-a-layout-onto-a-client-machine.md).

Creating a layout is useful in following situations:
- A user has limited permissions
- The client machines have limited access to the internet
- An organization wants to standardize on a particular version of the developer toolset

We designed Visual Studio so that an administrator can both create and maintain a layout and store it on an internal network share and optionally make it available on an organization's intranet. The layout serves as the source location for all Visual Studio files needed for both initial client installation and subsequent updates.

The information on this page is grouped up into three main sections:

* [**Create the layout**](#create-the-layout): describes how to create the layout with the correct product content, how to configure the client's default settings, how to store it on a network file share, and how to make it available if you want to host it on a webserver on your intranet.
* [**Create the layout**](#create-the-layout): describes how to create the layout with the correct product content, configure the default settings, store it on a network file share, and make it available on your intranet.
* [**Maintain the layout**](#maintaining-your-layout): information on how to best update the layout's product version, or modify the layout's product content, channel settings, installer version, and folder size.
* [**Help and Support**](#get-support-for-your-network-layout): where to ask for help

Expand All @@ -32,7 +39,7 @@ The layout path must be fewer than 80 characters; some organizations successfull

### Download the Visual Studio bootstrapper to create the layout

Download the correct bootstrapper for the edition of Visual Studio you want and copy it into the directory that you want to serve as the layout's repository. Once the layout is created, you can then use it to install Visual Studio onto any client machine. The bootstrapper is the executable that you use to create, update, and perform other layout operations. You must have an internet connection to complete this step.
Download the correct bootstrapper for the edition of Visual Studio you want and copy it into the directory that you want to serve as the layout's repository. Once the layout is created, you can then use it to install Visual Studio onto any client machine. The bootstrapper is the executable that you use to create, update, and perform other layout operations. You must have an internet connection and administrator permissions to complete this step.

::: moniker range="vs-2019"

Expand Down Expand Up @@ -81,7 +88,7 @@ You must have an internet connection to complete this step.

Open an elevated command prompt, navigate to the directory where you downloaded the bootstrapper, and use the bootstrapper's parameters as defined in the [use command-line parameters to install Visual Studio](use-command-line-parameters-to-install-visual-studio.md) page to create and maintain your network layout. The following examples illustrate common ways of creating initial layouts. More examples can be found on the [command-line parameter examples for a Visual Studio installation](command-line-parameter-examples.md) page.

A complete initial layout for a single language locale requires about 40 GB of disk space for Visual Studio Community and about 50 GB for Visual Studio Enterprise. Additional [language locales](use-command-line-parameters-to-install-visual-studio.md#list-of-language-locales) require about half a GB each.
A complete initial layout for a single language locale requires about 40 GB of disk space for Visual Studio Community and about 50 GB for Visual Studio Enterprise. Extra [language locales](use-command-line-parameters-to-install-visual-studio.md#list-of-language-locales) require about half a GB each.

The recommended approach is to create an initial layout of Visual Studio with all workloads and appropriate languages and store the packages into the layout directory on the network server. That way, any client installation has access to the entire Visual Studio product offering and the ability to install any subset. To create a full complete layout of Visual Studio, run the following command from the directory that you plan to host the network layout on:

Expand All @@ -104,7 +111,7 @@ There are several options you can use to customize the contents of your network
* `--add` to specify [workload or component IDs](workload-and-component-ids.md). <br>If `--add` is used, only those workloads and components specified with `--add` are downloaded. If `--add` isn't used, all workload and components are downloaded.
* `--includeRecommended` to include all the recommended components for the specified workload IDs.
* `--includeOptional` to include all the optional components for the specified workload IDs.
* `--config` to use a config file to specify the components that should be included in the layout.
* `--config` to use a `*.vsconfig` file to specify the components that should be included in the layout. Make sure you specify the **full path** of the config file.
* `--lang` to specify [language locales](use-command-line-parameters-to-install-visual-studio.md#list-of-language-locales).

Here are a few examples of how to create a custom network layout.
Expand Down Expand Up @@ -183,7 +190,7 @@ Starting in June 2023, you're able to make your layouts available on an internal

If you're using a version of Visual Studio that was shipped before June 2023, we recommend that you always use the latest Visual Studio Installer in your layout and distribute it to your clients. For example, if you distribute the Visual Studio 2022 installer in your Visual Studio 2019 layout, then your Visual Studio 2019 clients based off of that layout have the ability to change the source location for updates or to easily remove out-of-support components. Further details are [described below](#configure-the-layout-to-always-include-and-provide-the-latest-installer).

The capability to programmatically ensure that you're using the latest installer is only available to Visual Studio 2019 bootstrappers that were built after Visual Studio 2022 originally shipped. So, the vs_enterprise.exe in the example below must be a version that shipped _after_ November 10, 2021.
The capability to programmatically ensure that you're using the latest installer is only available to Visual Studio 2019 bootstrappers that were built after Visual Studio 2022 originally shipped. So, the vs_enterprise.exe in the following example must be a version that shipped _after_ November 10, 2021.

To create a layout of the entire product that uses the latest and greatest installer available, run

Expand Down Expand Up @@ -383,7 +390,7 @@ If you used the `--wait` parameter, then depending on the result of the operatio

### Get support for your network layout

If you experience a problem with your network layout, we want to know about it. The best way to tell us is by using the [Report a Problem](../ide/how-to-report-a-problem-with-visual-studio.md) tool that appears both in the Visual Studio Installer and in the Visual Studio IDE. If you're an IT Administrator and don't have Visual Studio installed, you can submit [**IT Admin feedback here**](https://aka.ms/vs/admin/feedback). When you use this tool, it would be very helpful if you could send the logs by the [VS Collect tool](https://aka.ms/vscollect) which can help us diagnose and fix the problem.
If you experience a problem with your network layout, we want to know about it. The best way to tell us is by using the [Report a Problem](../ide/how-to-report-a-problem-with-visual-studio.md) tool that appears both in the Visual Studio Installer and in the Visual Studio IDE. If you're an IT Administrator and don't have Visual Studio installed, you can submit [**IT Admin feedback here**](https://aka.ms/vs/admin/feedback). When you use this tool, it would be very helpful if you could send the logs by the [Visual Studio Collect tool](https://aka.ms/vscollect) which can help us diagnose and fix the problem.

We also offer an [**installation chat**](https://visualstudio.microsoft.com/vs/support/#talktous) (English only) support option for installation-related issues.

Expand Down
Loading