-
Notifications
You must be signed in to change notification settings - Fork 6k
Add docs for SYSLIB1230 #42884
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
Add docs for SYSLIB1230 #42884
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8467ffe
Add docs for SYSLIB1230
jkoritzinsky 4425dbf
Update docs/fundamentals/syslib-diagnostics/syslib1230.md
jkoritzinsky e895e71
Fix duplicate H1 warning
jkoritzinsky 92ed6d4
Apply suggestions from code review
jkoritzinsky 8930538
combine index files
gewarren aff0e91
add to main index
gewarren 4d16ef5
fix f1 keywords
gewarren 791d827
extra headers
gewarren ffa8146
fix links
gewarren 04a4fbc
add redirect
gewarren 7ca4450
COMInteropGenerator -> ComInterfaceGenerator (to match the terminolog…
jkoritzinsky 91f2374
Apply suggestions from code review
gewarren a7089ff
Update docs/fundamentals/syslib-diagnostics/syslib1230.md
gewarren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
title: SYSLIB1230 warning | ||
description: Learn about the diagnostic that generates compile-time warning SYSLIB1230. | ||
ms.date: 10/08/2024 | ||
f1_keywords: | ||
- syslib1230 | ||
--- | ||
|
||
# SYSLIB1230: Deriving from a `GeneratedComInterface`-attributed interface defined in another assembly is not supported | ||
|
||
In .NET 9 and later versions, defining an interface with the <xref:System.Runtime.InteropServices.Marshalling.GeneratedComInterfaceAttribute> attribute that derives from a `GeneratedComInterface`-attributed interface that's defined in another assembly is supported with the following restrictions: | ||
|
||
- The base interface type must be compiled targeting the same framework as the derived type. | ||
- The base interface type must not shadow any members of its base interface, if it has one. | ||
|
||
Additionally, any changes to any generated virtual method offsets in the base interface chain defined in another assembly won't be accounted for in the derived interfaces until the project is rebuilt. | ||
|
||
When you define an interface with the <xref:System.Runtime.InteropServices.Marshalling.GeneratedComInterfaceAttribute> attribute that derives from a `GeneratedComInterface`-attributed interface that's defined in another assembly, the SYSLIB1230 warning is emitted to inform you of the limitations. To acknowledge the limitations, suppress the warning in code as follows: | ||
|
||
```csharp | ||
// Disable the warning. | ||
#pragma warning disable SYSLIB1230 | ||
[GeneratedComInterface] | ||
interface IDerived : IBaseInOtherAssembly | ||
// Re-enable the warning. | ||
#pragma warning restore SYSLIB1230 | ||
{ | ||
// the interface definition | ||
} | ||
``` | ||
|
||
[!INCLUDE [suppress-syslib-warning](includes/suppress-source-generator-diagnostics.md)] | ||
|
||
## See also | ||
|
||
- [SYSLIB diagnostics for COM interop source generation](syslib-cominterfacegenerator.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.