Skip to content

fixing warning message #1353

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 2 commits into from
Dec 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions docs/core/tools/project-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: project.json reference
keywords: .NET, .NET Core, project.json
author: aL3891
ms.author: mairaw
ms.date: 09/30/2016
ms.date: 12/21/2016
ms.topic: article
ms.prod: .net-core
ms.technology: dotnet-cli
Expand Down Expand Up @@ -521,7 +521,7 @@ For example:
}
```

This ignores the warnings `The variable 'var' is assigned but its value is never used` and `The variable 'var' is assigned but its value is never used`
This ignores the warnings `The variable 'var' is declared but never used` and `The variable 'var' is assigned but its value is never used`.

### additionalArguments
Type: String[]
Expand Down
50 changes: 21 additions & 29 deletions docs/csharp/misc/cs0168.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
---
title: "Compiler Warning (level 3) CS0168 | Microsoft Docs"

ms.date: "2015-07-20"
ms.date: "2016-12-21"
ms.prod: .net


ms.technology:
- "devlang-csharp"

ms.technology: "devlang-csharp"
ms.topic: "article"
f1_keywords:
- "CS0168"
Expand All @@ -19,7 +14,6 @@ ms.assetid: 6f5b7fe3-1e91-462f-8a73-b931327ab3f5
caps.latest.revision: 7
author: "BillWagner"
ms.author: "wiwagn"

translation.priority.ht:
- "de-de"
- "es-es"
Expand All @@ -37,28 +31,26 @@ translation.priority.mt:
- "tr-tr"
---
# Compiler Warning (level 3) CS0168
The variable 'var' is assigned but its value is never used
The compiler warns when a variable is declared but not used.
The variable 'var' is declared but never used

The compiler issues a level-three warning when you declare a variable, but do not use it.

The following sample generates two CS0168 warnings:
The following sample generates a CS0168 warning:

```
```cs
// CS0168.cs
// compile with: /W:3
public class clx
{
public int i;
}

public class clz
{
public static void Main()
{
int j = 0; // CS0168, uncomment the following line
// j++;
clx a; // CS0168, try the following line instead
// clx a = new clx();
}
}
```
public class clx
{
public int i;
}

public class clz
{
public static void Main() {
clx a; // CS0168, the variable 'a' is declared but never used
// try the following line instead
// clx a = new clx(); // this does not generate a warning because the clx constructor must execute.
}
}
```
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
---
title: "Sorry, we don't have specifics on this C# error | Microsoft Docs"

ms.date: "2015-07-20"
ms.prod: .net


ms.technology:
- "devlang-csharp"

ms.topic: "article"
f1_keywords:
- "CS1583"
Expand Down Expand Up @@ -189,7 +185,6 @@ f1_keywords:
- "CS0011"
- "CS1057"
- "CS0144"
- "CS0168"
- "CS1985"
- "CS0060"
- "CS1643"
Expand Down Expand Up @@ -888,7 +883,6 @@ ms.assetid: 48320e4a-6e17-45a6-9966-88c6ec89bd2f
caps.latest.revision: 15
author: "BillWagner"
ms.author: "wiwagn"

translation.priority.ht:
- "cs-cz"
- "de-de"
Expand Down