Skip to content
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/additional-tools/dotnet-svcutil-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Microsoft WCF dotnet-svcutil tool
description: An overview of the Microsoft WCF dotnet-svcutil tool that adds functionality for .NET Core and ASP.NET Core projects, similar to the WCF svcutil tool for .NET Framework projects.
author: mlacouture
ms.author: jralexander
ms.date: 06/04/2018
ms.date: 08/20/2018
---
# Microsoft WCF dotnet-svcutil tool

Expand Down Expand Up @@ -55,7 +55,7 @@ dotnet new console

```xml
<ItemGroup>
<DotNetCliToolReference Include="dotnet-svcutil" Version="1.0.0" />
<DotNetCliToolReference Include="dotnet-svcutil" Version="1.0.*" />
</ItemGroup>
```

Expand Down
2 changes: 1 addition & 1 deletion docs/core/build/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The build currently depends on the following prerequisites:
* [Python](https://www.python.org/)
* a C++ compiler.

After you've installed these prerequisites are installed, you can build the CLR by invoking the build script (`build.cmd` on Windows, or `build.sh` on Linux and macOS) at the base of the [dotnet/coreclr](https://github.com/dotnet/coreclr/) repository.
After you've installed these prerequisites, you can build the CLR by invoking the build script (`build.cmd` on Windows, or `build.sh` on Linux and macOS) at the base of the [dotnet/coreclr](https://github.com/dotnet/coreclr/) repository.

Installing the components differ depending on the operating system (OS). See the build instructions for your specific OS:

Expand Down
2 changes: 1 addition & 1 deletion docs/core/whats-new/dotnet-core-2-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ The sockets implementation introduced in .NET Core 2.1 has a number of advantage

- Consistent behavior across all .NET Core platforms.

<xref:System.Net.Http.SocketsHttpHandler> is the default implementation in .NET Core 2.1. However, you can configure your application to use the older <xref:System.Net.Http.HttpClientHandler> class by calling the <xref:System.AppContext.SetSwitch%2A?displayProperty="nameWithType"> method:
<xref:System.Net.Http.SocketsHttpHandler> is the default implementation in .NET Core 2.1. However, you can configure your application to use the older <xref:System.Net.Http.HttpClientHandler> class by calling the <xref:System.AppContext.SetSwitch%2A?displayProperty=nameWithType> method:

```csharp
AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", false);
Expand Down
5 changes: 5 additions & 0 deletions docs/csharp/language-reference/compiler-messages/cs1029.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ class Sample
}
}
```
Compilation produces the following output:

```console
example.cs(9,8): error CS1029: #error: 'DEBUG is defined'
```
2 changes: 1 addition & 1 deletion docs/csharp/language-reference/compiler-messages/cs1614.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ helpviewer_keywords:
ms.assetid: 787eef18-74a6-49d9-9f34-f0881aca8dff
---
# Compiler Error CS1614
'name' is ambiguous; between 'attribute1' and 'attribute2'. use either '@attribute' or 'attributeAttribute'
'name' is ambiguous between 'name' and 'nameAttribute'; use either '@name' or 'nameAttribute'.

The compiler has encountered an ambiguous attribute specification.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ ms.assetid: 731d78df-08e0-4d51-b8c8-f193c27de13f
#define VC7
//...
#if debug
Console.Writeline("Debug build");
Console.WriteLine("Debug build");
#elif VC7
Console.Writeline("Visual Studio 7");
Console.WriteLine("Visual Studio 7");
#endif
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ helpviewer_keywords:
ms.assetid: 6a347322-cfa2-4a86-98f8-ddfa2cb7d4db
---
# #else (C# Reference)
`#else` lets you create a compound conditional directive, so that, if none of the expressions in the preceding [#if](../../../csharp/language-reference/preprocessor-directives/preprocessor-if.md) or (optional) [#elif](../../../csharp/language-reference/preprocessor-directives/preprocessor-elif.md) directives to `true`, the compiler will evaluate all code between `#else` and the subsequent `#endif`.
`#else` lets you create a compound conditional directive, so that, if none of the expressions in the preceding [#if](../../../csharp/language-reference/preprocessor-directives/preprocessor-if.md) or (optional) [#elif](../../../csharp/language-reference/preprocessor-directives/preprocessor-elif.md) directives evaluate to `true`, the compiler will evaluate all code between `#else` and the subsequent `#endif`.

## Remarks
[#endif](../../../csharp/language-reference/preprocessor-directives/preprocessor-endif.md) must be the next preprocessor directive after `#else`. See [#if](../../../csharp/language-reference/preprocessor-directives/preprocessor-if.md) for an example of how to use `#else`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ helpviewer_keywords:
ms.assetid: f2a7f3af-4cf9-4111-b369-70204d24b26b
---
# #error (C# Reference)
`#error` lets you generate an error from a specific location in your code. For example:
`#error` lets you generate a [CS1029](../compiler-messages/cs1029.md) user-defined error from a specific location in your code. For example:

```csharp
#error Deprecated code in this method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,38 @@ helpviewer_keywords:
ms.assetid: 6439e525-5dd5-4acb-b8ea-efabb32ff95b
---
# #line (C# Reference)
`#line` lets you modify the compiler's line number and (optionally) the file name output for errors and warnings. This example shows how to report two warnings associated with line numbers. The `#line 200` directive forces the line number to be 200 (although the default is #7) and until the next #line directive, the filename will be reported as "Special". The #line default directive returns the line numbering to its default numbering, which counts the lines that were renumbered by the previous directive.
`#line` lets you modify the compiler's line numbering and (optionally) the file name output for errors and warnings.

The following example shows how to report two warnings associated with line numbers. The `#line 200` directive forces the next line's number to be 200 (although the default is #6) and until the next #line directive, the filename will be reported as "Special". The #line default directive returns the line numbering to its default numbering, which counts the lines that were renumbered by the previous directive.

```csharp
class MainClass
{
static void Main()
{
#line 200 "Special"
int i; // CS0168 on line 200
int j; // CS0168 on line 201
int i;
int j;
#line default
char c; // CS0168 on line 9
float f; // CS0168 on line 10
char c;
float f;
#line hidden // numbering not affected
string s;
double d; // CS0168 on line 13
double d;
}
}
```

Compilation produces the following output:

```console
Special(200,13): warning CS0168: The variable 'i' is declared but never used
Special(201,13): warning CS0168: The variable 'j' is declared but never used
MainClass.cs(9,14): warning CS0168: The variable 'c' is declared but never used
MainClass.cs(10,15): warning CS0168: The variable 'f' is declared but never used
MainClass.cs(12,16): warning CS0168: The variable 's' is declared but never used
MainClass.cs(13,16): warning CS0168: The variable 'd' is declared but never used
```

## Remarks
The `#line` directive might be used in an automated, intermediate step in the build process. For example, if lines were removed from the original source code file, but you still wanted the compiler to generate output based on the original line numbering in the file, you could remove lines and then simulate the original line numbering with `#line`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ helpviewer_keywords:
ms.assetid: e6fb496d-bb8b-4018-baf6-5b60a0c8902b
---
# #warning (C# Reference)
`#warning` lets you generate a level one warning from a specific location in your code. For example:
`#warning` lets you generate a [CS1030](../../misc/cs1030.md) level one compiler warning from a specific location in your code. For example:

```csharp
#warning Deprecated code in this method.
Expand Down
4 changes: 2 additions & 2 deletions docs/csharp/local-functions-vs-lambdas.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ result in clearer code.
Local functions have different rules for definite assignment
than lambda expressions. A local function declaration can be referenced
from any code location where it is in scope. A lambda expression must be
assigned to a delegate variable before it can be accessed (or called through the delgate
assigned to a delegate variable before it can be accessed (or called through the delegate
referencing the lambda expression.) Notice that the version using the
lambda expression must declare and initialize the lambda expression,
`nthFactorial` before defining it. Not doing so results in a compile
Expand Down Expand Up @@ -68,7 +68,7 @@ int M()
}
```

The compiler can determine that `LocalFunction` definitely assigns `y` when called. Because `LocalFunction` is called before the `return` statement, `y` is definitiely
The compiler can determine that `LocalFunction` definitely assigns `y` when called. Because `LocalFunction` is called before the `return` statement, `y` is definitely
assigned at the `return` statement.

The analysis that enables the example analysis enables the fourth difference.
Expand Down
10 changes: 8 additions & 2 deletions docs/csharp/misc/cs1030.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Compiler Warning (level 1) CS1030"
ms.date: 07/20/2015
ms.date: 08/20/2018
f1_keywords:
- "CS1030"
helpviewer_keywords:
Expand All @@ -20,7 +20,13 @@ class Sample
{
static void Main()
{
#warning Let's give a warning here // CS1030
#warning Let's give a warning here
}
}
```

Compilation produces the following output:

```console
example.cs(6,16): warning CS1030: #warning: 'Let's give a warning here'
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This example adds the value pair, "Name" and "Isabella", to the current user's r

## Example

```
```csharp
Microsoft.Win32.RegistryKey key;
key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Names");
key.SetValue("Name", "Isabella");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This example reads the contents of a text file, one line at a time, into a strin

## Example

```
```csharp
int counter = 0;
string line;

Expand All @@ -21,7 +21,7 @@ System.IO.StreamReader file =
new System.IO.StreamReader(@"c:\test.txt");
while((line = file.ReadLine()) != null)
{
System.Console.WriteLine (line);
System.Console.WriteLine(line);
counter++;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The following C# code example illustrates how to use platform invoke services to
4. Compile and run the code.

## .NET Framework Security
For more information, see [.NET Framework Security](https://technet.microsoft.com/en-us/security/).
For more information, see [Security in .NET](../../../standard/security/index.md).

## See Also
[C# Programming Guide](../../../csharp/programming-guide/index.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The topic describes methods to enable interoperability between C# managed code a
For more information, see [Consuming Unmanaged DLL Functions](../../../framework/interop/consuming-unmanaged-dll-functions.md) and [How to: Use Platform Invoke to Play a Wave File](../../../csharp/programming-guide/interop/how-to-use-platform-invoke-to-play-a-wave-file.md).

> [!NOTE]
> The [Common Language Runtime](../../../standard/clr.md) (CLR) manages access to system resources. Calling unmanaged code that is outside the CLR bypasses this security mechanism, and therefore presents a security risk. For example, unmanaged code might call resources in unmanaged code directly, bypassing CLR security mechanisms. For more information, see [.NET Framework Security](https://technet.microsoft.com/en-us/security/).
> The [Common Language Runtime](../../../standard/clr.md) (CLR) manages access to system resources. Calling unmanaged code that is outside the CLR bypasses this security mechanism, and therefore presents a security risk. For example, unmanaged code might call resources in unmanaged code directly, bypassing CLR security mechanisms. For more information, see [Security in .NET](../../../standard/security/index.md).

## C++ Interop
You can use C++ interop, also known as It Just Works (IJW), to wrap a native C++ class so that it can be consumed by code that is authored in C# or another .NET Framework language. To do this, you write C++ code to wrap a native DLL or COM component. Unlike other .NET Framework languages, [!INCLUDE[vcprvc](~/includes/vcprvc-md.md)] has interoperability support that enables managed and unmanaged code to be located in the same application and even in the same file. You then build the C++ code by using the **/clr** compiler switch to produce a managed assembly. Finally, you add a reference to the assembly in your C# project and use the wrapped objects just as you would use other managed classes.
Expand Down
6 changes: 5 additions & 1 deletion docs/csharp/whats-new/csharp-version-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ Dynamic binding gives you the potential for errors but also great power within t
C# version 5.0 was a focused version of the language. Nearly all of the effort for that version went into another groundbreaking language concept: the `async` and `await` model for asynchronous programming . Here is the major features list:

- [Asynchronous members](../async.md)
- [Caller info attributes](https://www.codeproject.com/Tips/606379/Caller-Info-Attributes-in-Csharp)
- [Caller info attributes](../programming-guide/concepts/caller-information.md)

### See Also

* [Code Project: Caller Info Attributes in C# 5.0](https://www.codeproject.com/Tips/606379/Caller-Info-Attributes-in-Csharp)

The caller info attribute lets you easily retrieve information about the context in which you're running without resorting to a ton of boilerplate reflection code. It has many uses in diagnostics and logging tasks.

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/additional-apis/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ms.author: "mairaw"

# Additional class libraries and APIs

The .NET Framework is constantly evolving and in order to improve cross-platform development or to introduce new functionality early to our customers, we release new features out of band (OOB). This topic lists the OOB projects that we provide documentation for.
The .NET Framework is constantly evolving. To improve cross-platform development and introduce new functionality early, new features are released out of band (OOB). This topic lists the OOB projects that we provide documentation for.

In addition, some libraries target specific platforms or implementations of the .NET Framework. For example, the <xref:System.Text.CodePagesEncodingProvider> class makes code page encodings available to UWP apps developed using the .NET Framework. This topic lists these libraries as well.

Expand Down
Loading