Skip to content

Add articles for remaining C# 13 and C# 14 errors #46376

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 6 commits into from
May 30, 2025
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
40 changes: 40 additions & 0 deletions .openpublishing.redirection.csharp.json
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0260.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1112.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1683.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references"
Expand Down Expand Up @@ -1818,14 +1822,50 @@
"source_path_from_root": "/docs/csharp/misc/cs1020.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1100.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1101.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1102.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1103.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1104.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1105.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1106.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1007.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1109.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1110.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations"
},
{
"source_path_from_root": "/docs/csharp/misc/cs1113.md",
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations"
},
{
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1502.md",
"redirect_url": "/dotnet/csharp/misc/cs1503"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ f1_keywords:
- "CS7079"
- "CS8090"
- "CS8203"
- "CS9286"
helpviewer_keywords:
- "CS0012"
- "CS0234"
Expand All @@ -39,7 +40,8 @@ helpviewer_keywords:
- "CS7079"
- "CS8090"
- "CS8203"
ms.date: 02/28/2024
- "CS9286"
ms.date: 05/27/2025
---
# Resolve errors and warnings related to assembly references

Expand All @@ -64,6 +66,7 @@ That's by design. The text closely matches the text of the compiler error / warn
- [**CS7079**](#invalid-assembly-reference): *The type is defined in a module that has not been added. You must add the module.*
- [**CS8090**](#invalid-assembly-reference): *There is an error in a referenced assembly.*
- [**CS8203**](#invalid-assembly-reference): *Invalid assembly name.*
- [**CS9286**](#missing-references): *Type does not contain a definition and no accessible extension member for receiver type could be found (are you missing a using directive or an assembly reference?)*

In addition, the following warnings are covered in this article:

Expand All @@ -76,13 +79,15 @@ The following errors and warnings indicate that you're missing an assembly refer
- **CS0012**: *The type 'type' is defined in an assembly that is not referenced. You must add a reference to assembly 'assembly'.*
- **CS0234**: *The type or namespace name does not exist in the namespace (are you missing an assembly reference?)*
- **CS0246**: *The type or namespace name could not be found (are you missing a using directive or an assembly reference?)*
- **CS9286**: *Type does not contain a definition and no accessible extension member for receiver type could be found (are you missing a using directive or an assembly reference?)*

These compiler errors indicate one of these problems in your code:

- The project doesn't reference the required assembly. To fix this error, [add a reference to the required assembly](../../../standard/assembly/index.md#add-a-reference-to-an-assembly).
- You misspelled the name of a type. Check the name of the type.
- You used a variable name where the name of a <xref:System.Type?displayProperty=nameWithType> was expected, such as in the [`typeof` operator](../operators/type-testing-and-cast.md#the-typeof-operator) or the [`is` operator](../operators/type-testing-and-cast.md#the-is-operator).
- You used the [global scope operator, (`::`)](../operators/namespace-alias-qualifier.md) when the type isn't in the global namespace.
- You're accessing an extension member and either the namespace isn't specified in a `using` directive, or you're not referencing the assembly that contains the extension.

## Type forwarding

Expand Down
36 changes: 0 additions & 36 deletions docs/csharp/language-reference/compiler-messages/cs1112.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ f1_keywords:
- "CS9170"
- "CS9175"
- "CS9226"
- "CS9296"
- "CS9307"
helpviewer_keywords:
- "CS0765"
- "CS0831"
Expand Down Expand Up @@ -94,7 +96,9 @@ helpviewer_keywords:
- "CS9170"
- "CS9175"
- "CS9226"
ms.date: 09/06/2023
- "CS9296"
- "CS9307"
ms.date: 05/27/2025
---
# Resolve errors and warnings generated from expressions prohibited in expression trees

Expand Down Expand Up @@ -149,6 +153,8 @@ That's by design. The text closely matches the text of the compiler error / warn
- **CS9170** - *An expression tree may not contain an inline array access or conversion.*
- **CS9175** - *An expression tree may not contain a collection expression.*
- **CS9226** - *An expression tree may not contain an expanded form of non-array params collection parameter.*
- **CS9296** - *An expression tree may not contain an extension property access*.
- **CS9307** - *An expression tree may not contain a named argument specification out of position*.

## Expression tree restrictions

Expand Down Expand Up @@ -184,6 +190,7 @@ The following expressions are prohibited:

Other restrictions are:

- Extension properties can't be accessed as extensions.
- Attributes can't be applied to the lambda expression, its parameters or return.
- The lambda expression must be convertible to a type derived from <xref:System.Linq.Expressions.Expression?displayProperty=fullName> whose type parameter is a delegate type.
- [named and optional parameters](../../programming-guide/classes-and-structs/named-and-optional-arguments.md) are restricted. The expression can't call a method specifying named arguments, and it can't use the default value of an optional parameter.
Expand Down
Loading