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
1 change: 1 addition & 0 deletions docs/core/compatibility/10.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af
| [MacCatalyst version normalization](core-libraries/10.0/maccatalyst-version-normalization.md) | Behavioral change | Preview 1 |
| [.NET runtime no longer provides default termination signal handlers](core-libraries/10.0/sigterm-signal-handler.md) | Behavioral change | Preview 5 |
| [System.Linq.AsyncEnumerable included in core libraries](core-libraries/10.0/asyncenumerable.md) | Source incompatible | Preview 1 |
| [Type.MakeGenericSignatureType argument validation](reflection/10/makegeneric-signaturetype-validation.md) | Behavioral change | Preview 3 |
| [YMM embedded rounding removed from AVX10.2](core-libraries/10.0/ymm-embedded-rounding.md) | Behavioral change | Preview 5 |

## Cryptography
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: "Breaking change: Type.MakeGenericSignatureType argument validation"
description: Learn about the .NET 10 breaking change in core .NET libraries where Type.MakeGenericSignatureType validates that the genericTypeDefinition argument is a generic type definition.
ms.date: 10/13/2025
ai-usage: ai-assisted
ms.custom: https://github.com/dotnet/docs/issues/48902
---
# Type.MakeGenericSignatureType argument validation

Starting in .NET 10, the <xref:System.Type.MakeGenericSignatureType(System.Type,System.Type[])?displayProperty=nameWithType> API validates that the `genericTypeDefinition` argument is a generic type definition.

## Version introduced

.NET 10 Preview 3

## Previous behavior

Previously, <xref:System.Type.MakeGenericSignatureType(System.Type,System.Type[])?displayProperty=nameWithType> accepted any type for the `genericTypeDefinition` argument, including non-generic types.

## New behavior

Starting in .NET 10, <xref:System.Type.MakeGenericSignatureType(System.Type,System.Type[])?displayProperty=nameWithType> requires the `genericTypeDefinition` argument to be a generic type definition. If the argument is not a generic type definition, the method throws an <xref:System.ArgumentException>.

## Type of breaking change

This change is a [behavioral change](../../categories.md#behavioral-change).

## Reason for change

The type created by <xref:System.Type.MakeGenericSignatureType(System.Type,System.Type[])?displayProperty=nameWithType> had non-sensical behavior when the `genericTypeDefinition` argument was not a generic type definition.

## Recommended action

Avoid calling <xref:System.Type.MakeGenericSignatureType(System.Type,System.Type[])?displayProperty=nameWithType> for types that are not generic type definitions. For example:

```csharp
// Before
Type instantiatedType = Type.MakeGenericSignatureType(originalType, instantiation);

// After
Type instantiatedType = originalType.IsGenericTypeDefinition ? Type.MakeGenericSignatureType(originalType, instantiation) : originalType;
```

## Affected APIs

- <xref:System.Type.MakeGenericSignatureType(System.Type,System.Type[])?displayProperty=fullName>
4 changes: 4 additions & 0 deletions docs/core/compatibility/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ items:
href: networking/10.0/default-http-streaming.md
- name: "'Uri' length limits removed"
href: networking/10.0/uri-length-limits-removed.md
- name: Reflection
items:
- name: Type.MakeGenericSignatureType argument validation
href: reflection/10/makegeneric-signaturetype-validation.md
- name: SDK and MSBuild
items:
- name: .NET CLI `--interactive` defaults to `true` in user scenarios
Expand Down