Skip to content

Commit 5dc74b4

Browse files
author
JiayueHu
authored
Merge pull request #3833 from MicrosoftDocs/master
Daily publishing Feb.6
2 parents 0342f99 + 647ac2b commit 5dc74b4

19 files changed

+74
-55
lines changed
Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Debug a C++ access violation | Microsoft Docs"
33
ms.custom: "seodec18"
4-
ms.date: "05/23/2017"
4+
ms.date: "02/05/2019"
55
ms.topic: "conceptual"
66
f1_keywords:
77
- "vs.debug.access"
@@ -21,48 +21,57 @@ ms.workload:
2121
- "cplusplus"
2222
---
2323
# How Can I Debug a C++ Access Violation?
24-
## Problem Description
25-
My program produces an access violation. How can I debug this?
24+
25+
## Problem Description
26+
27+
My program produces an access violation. How can I debug this?
2628

27-
## Solution
28-
If you get an access violation on a line of code that dereferences multiple pointers, it can be difficult to find out which pointer caused the access violation. Starting in Visual Studio 2015 Update 1, the exception dialog box now explicitly names the pointer that caused the access violation.
29+
## Solution
30+
31+
If you get an access violation on a line of code that dereferences multiple pointers, it can be difficult to find out which pointer caused the access violation. Starting in Visual Studio 2015 Update 1, the exception dialog box now explicitly names the pointer that caused the access violation.
2932

30-
For example, given the following code, you should get an access violation:
31-
32-
```C++
33+
For example, given the following code, you should get an access violation:
34+
35+
```C++
3336
#include <iostream>
3437
using namespace std;
3538

36-
class ClassB {
37-
public:
38-
ClassC* C;
39-
ClassB() {
40-
C = new ClassC();
41-
}
42-
void printHello() {
43-
cout << "hello world";
44-
}
45-
};
46-
47-
class ClassA {
48-
public:
49-
ClassB* B;
50-
ClassA() {
51-
B = nullptr;
52-
}
53-
};
54-
55-
int main() {
56-
ClassA* A = new ClassA();
57-
A->B->printHello();
58-
}
39+
class ClassC {
40+
public:
41+
void printHello() {
42+
cout << "hello world";
43+
}
44+
};
45+
46+
class ClassB {
47+
public:
48+
ClassC* C;
49+
ClassB() {
50+
C = new ClassC();
51+
}
52+
};
53+
54+
class ClassA {
55+
public:
56+
ClassB* B;
57+
ClassA() {
58+
// Uncomment to fix
59+
// B = new ClassB();
60+
}
61+
};
62+
63+
int main() {
64+
ClassA* A = new ClassA();
65+
A->B->C->printHello();
66+
67+
}
5968
```
69+
70+
If you run this code in Visual Studio 2015 Update 1, you should see the following exception dialog:
6071
61-
If you run this code in Visual Studio 2015 Update 1, you should see the following exception dialog:
62-
63-
![AccessViolationCPlus](../debugger/media/accessviolationcplus.png "AccessViolationCPlus")
72+
![AccessViolationCPlus](../debugger/media/accessviolationcplus.png "AccessViolationCPlus")
6473
65-
If you cannot determine why the pointer caused an access violation, trace through the code to make sure that the pointer causing the problem has been assigned correctly. If it is passed as a parameter, make sure that it is passed correctly, and you aren't accidentally creating a [shallow copy](http://stackoverflow.com/questions/184710/what-is-the-difference-between-a-deep-copy-and-a-shallow-copy). Then verify that the values are not being unintentionally changed somewhere in the program by creating a Data Breakpoint for the pointer in question to make sure it isn't being modified elsewhere in the program. For more information about data breakpoints, see the data breakpoint section in [Using Breakpoints](../debugger/using-breakpoints.md).
74+
If you cannot determine why the pointer caused an access violation, trace through the code to make sure that the pointer causing the problem has been assigned correctly. If it is passed as a parameter, make sure that it is passed correctly, and you aren't accidentally creating a [shallow copy](http://stackoverflow.com/questions/184710/what-is-the-difference-between-a-deep-copy-and-a-shallow-copy). Then verify that the values are not being unintentionally changed somewhere in the program by creating a Data Breakpoint for the pointer in question to make sure it isn't being modified elsewhere in the program. For more information about data breakpoints, see the data breakpoint section in [Using Breakpoints](../debugger/using-breakpoints.md).
6675
6776
## See Also
6877
[Debugging Native Code FAQs](../debugger/debugging-native-code-faqs.md)

docs/ide/quickstart-visual-basic-console.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ms.workload:
1818

1919
In this 5-10 minute introduction to the Visual Studio integrated development environment (IDE), you'll create a simple Visual Basic application that runs on the console.
2020

21-
If you haven't already installed Visual Studio, go to the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=button+cta&utm_content=download+vs2017) page to install it for free.
21+
If you haven't already installed Visual Studio, go to the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2017) page to install it for free.
2222

2323
## Create a project
2424

docs/ide/visual-studio-2017-for-dotnet-developers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.workload:
1414
---
1515
# Visual Studio 2017 C# productivity guide
1616

17-
Learn how [Visual Studio 2017](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=button+cta&utm_content=download+vs2017) makes developers more productive than ever. Take advantage of our performance and productivity improvements like navigation to decompiled assemblies, variable name suggestions as you type, a hierarchy-view in the **Test Explorer**, Go To All (**Ctrl**+**T**) to navigate to file/type/member/symbol declarations, an intelligent **Exception Helper**, code style configuration and enforcement, and many refactorings and code fixes.
17+
Learn how [Visual Studio 2017](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2017) makes developers more productive than ever. Take advantage of our performance and productivity improvements like navigation to decompiled assemblies, variable name suggestions as you type, a hierarchy-view in the **Test Explorer**, Go To All (**Ctrl**+**T**) to navigate to file/type/member/symbol declarations, an intelligent **Exception Helper**, code style configuration and enforcement, and many refactorings and code fixes.
1818

1919
## I'm used to my keyboard shortcuts from a different extension/editor/IDE
2020

docs/install/create-an-offline-installation-of-visual-studio.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Create an offline installation"
33
description: "Learn how to install Visual Studio offline when you have an unreliable internet connection or low bandwidth."
4-
ms.date: 01/15/2019
4+
ms.date: 02/06/2019
55
ms.custom: "seodec18"
66
ms.prod: visual-studio-dev15
77
ms.topic: conceptual
@@ -18,7 +18,7 @@ ms.workload:
1818
---
1919
# Create an offline installation of Visual Studio 2017
2020

21-
We designed Visual Studio 2017 to work well in a variety of network and computer configurations. While we recommend that you try the [Visual Studio web installer](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=button+cta&utm_content=download+vs2017)&mdash;which is a small file and allows you to stay current with all the latest fixes and features&mdash;we understand that you might not be able to.
21+
We designed Visual Studio 2017 to work well in a variety of network and computer configurations. While we recommend that you try the [Visual Studio web installer](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2017)&mdash;which is a small file and allows you to stay current with all the latest fixes and features&mdash;we understand that you might not be able to.
2222

2323
For example, you might have an unreliable internet connection or one that has low bandwidth. If so, you have a few options: You can use the new "Download all, then install" feature to download the files before you install, or you can use the command line to create a local cache of the files.
2424

@@ -27,11 +27,15 @@ For example, you might have an unreliable internet connection or one that has lo
2727
2828
## Use the "Download all, then install" feature
2929

30-
[**New in 15.8**](/visualstudio/releasenotes/vs2017-relnotes?context=visualstudio/default&contextView=vs-2017#install
31-
): After you download the web installer, select the new **Download all, then install** option from the Visual Studio Installer. Then, continue with your installation.
30+
[**New in 15.8**](/visualstudio/releasenotes/vs2017-relnotes-v15.8#install): After you download the web installer, select the new **Download all, then install** option from the Visual Studio Installer. Then, continue with your installation.
3231

3332
![The "Download all, then install" option](media/download-all-then-install.png)
3433

34+
We designed the "Download all, then install" feature so that you can download Visual Studio as a single installation for the same computer on which you downloaded it. That way, you can safely disconnect from the web before you install Visual Studio.
35+
36+
> [!IMPORTANT]
37+
> Do not use the "Download all, then install" feature to create an offline cache that you intend to transfer to another computer. It's not designed to work that way. <br><br>If you want to create an offline cache to install Visual Studio on another computer, see the [Use the command line to create a local cache](#use-the-command-line-to-create-a-local-cache) section of this page for information about how to create a local cache, or the [Create a network installation of Visual Studio 2017](../install/create-a-network-installation-of-visual-studio.md) page for information about how to create a network cache.
38+
3539
## Use the command line to create a local cache
3640

3741
After you download a small bootstrapper, use the command line to create a local cache. Then, use the local cache to install Visual Studio. (This process replaces the ISO files that were available for previous versions.)

docs/install/troubleshooting-installation-issues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The Visual Studio Installer bootstrapper is a minimal light-weight executable th
4343
4444
1. Close the Visual Studio Installer.
4545
2. Delete the Visual Studio Installer directory. Typically, the directory is `C:\Program Files (x86)\Microsoft Visual Studio\Installer`.
46-
3. Run the Visual Studio Installer bootstrapper. You might find the bootstrapper in your Downloads folder with a file name that follows a `vs_[Visual Studio edition]__*.exe` pattern. If you don't find that application, you can download the bootstrapper by going to the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/) page and clicking **Download** for your edition of Visual Studio. Then, run the executable to reset your installation metadata.
46+
3. Run the Visual Studio Installer bootstrapper. You might find the bootstrapper in your Downloads folder with a file name that follows a `vs_[Visual Studio edition]__*.exe` pattern. If you don't find that application, you can download the bootstrapper by going to the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2017) page and clicking **Download** for your edition of Visual Studio. Then, run the executable to reset your installation metadata.
4747
4. Try to install or update Visual Studio again. If the Installer continues to fail, go to the next step.
4848

4949
### Step 4 - Report a problem

docs/install/visual-studio-build-numbers-and-release-dates.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ keywords:
66
author: TerryGLee
77
ms.author: tglee
88
manager: jillfra
9-
ms.date: 02/01/2019
9+
ms.date: 02/05/2019
1010
ms.topic: reference
1111
helpviewer_keywords:
1212
ms.prod: visual-studio-dev15
@@ -170,6 +170,7 @@ The following table lists the build numbers and release dates for Visual Studio
170170

171171
| **Version**| **Channel** | **Release date** | **Build version** |
172172
| ---------------------- | ----------- | ---------------- | ----------------- |
173+
| 16.0.0 | Preview 2.2 | February 5, 2019 | 16.0.28602.52 |
173174
| 16.0.0 | Preview 2.1 | January 31, 2019 | 16.0.28529.54 |
174175
| 16.0.0 | Preview 2 | January 23, 2019 | 16.0.28522.59 |
175176
| 16.0.0 | Preview 1.1 | December 10, 2018 | 16.0.28408.50 |

docs/install/workload-component-id-vs-build-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ Microsoft.VisualStudio.Component.VC.Tools.14.15 | VC++ 2017 version 15.8 v14.15
431431

432432
## See also
433433

434-
* [Build Tools for Visual Studio 2017](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=button+cta&utm_content=download+vs2017#build-tools-for-visual-studio-2017)
434+
* [Build Tools for Visual Studio 2017](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2017#build-tools-for-visual-studio-2017)
435435
* [Visual Studio workload and component IDs](workload-and-component-ids.md)
436436
* [Visual Studio administrator guide](visual-studio-administrator-guide.md)
437437
* [Use command-line parameters to install Visual Studio](use-command-line-parameters-to-install-visual-studio.md)

docs/javascript/debug-nodejs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ms.workload:
1818
You can debug JavaScript and TypeScript code using Visual Studio. You can set and hit breakpoints, attach the debugger, inspect variables, view the call stack, and use other debugging features.
1919

2020
> [!TIP]
21-
> If you haven't already installed Visual Studio, go to the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=button+cta&utm_content=download+vs2017) page to install it for free. Depending on the type of app development you're doing, you may need to install the **Node.js development workload** with Visual Studio.
21+
> If you haven't already installed Visual Studio, go to the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2017) page to install it for free. Depending on the type of app development you're doing, you may need to install the **Node.js development workload** with Visual Studio.
2222
2323
## Debug server-side script
2424

docs/javascript/tutorial-nodejs-with-react-and-jsx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ webpack bundles JavaScript files so they can run in a browser. It can also trans
5353

5454
* You must have Visual Studio 2017 installed and the Node.js development workload.
5555

56-
If you haven't already installed Visual Studio, go to the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=button+cta&utm_content=download+vs2017) page to install it for free.
56+
If you haven't already installed Visual Studio, go to the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2017) page to install it for free.
5757

5858
If you need to install the workload but already have Visual Studio, select the **Open Visual Studio Installer** link in the left pane of the **New Project** dialog box. The Visual Studio Installer launches. Choose the **Node.js development** workload, then choose **Modify**.
5959

docs/javascript/tutorial-nodejs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.workload:
1414
---
1515
# Tutorial: Create a Node.js and Express app in Visual Studio
1616

17-
In this tutorial for Visual Studio development using Node.js and Express, you create a simple Node.js web application, add some code, explore some features of the IDE, and run the app. If you haven't already installed Visual Studio, install it for free [here](http://visualstudio.microsoft.com).
17+
In this tutorial for Visual Studio development using Node.js and Express, you create a simple Node.js web application, add some code, explore some features of the IDE, and run the app. If you haven't already installed Visual Studio, install it for free [here](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2017).
1818

1919
In this tutorial, you learn how to:
2020
> [!div class="checklist"]

docs/javascript/write-and-edit-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.workload:
1717
In this short introduction to the code editor in Visual Studio, we'll look at some of the ways that Visual Studio makes writing, navigating, and understanding code easier.
1818

1919
> [!TIP]
20-
> If you haven't already installed Visual Studio, go to the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=button+cta&utm_content=download+vs2017) page to install it for free. Depending on the type of app development you're doing, you may need to install the **Node.js development workload** with Visual Studio.
20+
> If you haven't already installed Visual Studio, go to the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2017) page to install it for free. Depending on the type of app development you're doing, you may need to install the **Node.js development workload** with Visual Studio.
2121
2222
This article assumes you're already familiar with JavaScript development. If you aren't, we suggest you look at a tutorial such as [Create a Node.js and Express app](../javascript/tutorial-nodejs.md) first.
2323

docs/modeling/map-methods-on-the-call-stack-while-debugging-in-visual-studio.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Create a code map to visually trace the call stack while you're debugging. You c
3737

3838
You'll need:
3939

40-
- [Visual Studio Enterprise](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=button+cta&utm_content=download+vs2017)
40+
- [Visual Studio Enterprise](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2017)
4141

4242
- Code that you can debug, such as Visual C#, Visual Basic, C++, JavaScript, or X++
4343

docs/msbuild/vbc-task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Wraps *vbc.exe*, which produces executables (*.exe*), dynamic-link libraries (*.
4646
| `Imports` | Optional <xref:Microsoft.Build.Framework.ITaskItem>`[]` parameter.<br /><br /> Imports namespaces from the specified item collections. This parameter corresponds to the [-imports](/dotnet/visual-basic/reference/command-line-compiler/imports) switch of the *vbc.exe* compiler. |
4747
| `KeyContainer` | Optional `String` parameter.<br /><br /> Specifies the name of the cryptographic key container. This parameter corresponds to the [-keycontainer](/dotnet/visual-basic/reference/command-line-compiler/keycontainer) switch of the *vbc.exe* compiler. |
4848
| `KeyFile` | Optional `String` parameter.<br /><br /> Specifies the file name containing the cryptographic key. For more information, see [-keyfile](/dotnet/visual-basic/reference/command-line-compiler/keyfile). |
49-
| `LangVersion` | Optional <xref:System.String?displayProperty=fullName> parameter.<br /><br /> Specifies the language version, either "9" or "10". |
49+
| `LangVersion` | Optional <xref:System.String?displayProperty=fullName> parameter.<br /><br /> Specifies the [language version](/dotnet/visual-basic/language-reference/configure-language-version), such as "15.5". |
5050
| `LinkResources` | Optional <xref:Microsoft.Build.Framework.ITaskItem>`[]` parameter.<br /><br /> Creates a link to a .NET Framework resource in the output file; the resource file is not placed in the output file. This parameter corresponds to the [-linkresource](/dotnet/visual-basic/reference/command-line-compiler/linkresource) switch of the *vbc.exe* compiler. |
5151
| `MainEntryPoint` | Optional `String` parameter.<br /><br /> Specifies the class or module that contains the `Sub Main` procedure. This parameter corresponds to the [-main](/dotnet/visual-basic/reference/command-line-compiler/main) switch of the *vbc.exe* compiler. |
5252
| `ModuleAssemblyName` | Optional `String` parameter.<br /><br /> Specifies the assembly that this module is a part of. |

0 commit comments

Comments
 (0)