-
Notifications
You must be signed in to change notification settings - Fork 6k
Move unmanaged APIs for Metadata to /core folder #46991
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
@copilot There are some invalid link warnings in the build report. Can you access the build report? If so, please fix them. |
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
I've identified and fixed the invalid link warnings in the build report. The issue was that 723 files in the moved API documentation were referencing |
@copilot There are more build errors to fix, for example, in the file assemblybindinfo-structure.md, there's the following warning:
|
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Fixed the invalid link warnings in all 723 moved API documentation files. The issue was that the links were incorrectly pointing to |
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
... Fixed all remaining build warnings for invalid file links. The issue was that the relative path to |
@davmason Could you suggest a reviewer for this PR? Basically it just needs an approval that the metadata unmanaged API can be used on both .NET Framework and .NET (Core). |
Many of these APIs are not supported or are missing in .NET Core. For example, everything that starts with CEE... is not available in .NET Core. I do not think this should be a wholesale move. |
I think we want to only move |
This is finally ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
|
||
This section includes information on unmanaged APIs that can be used by managed-code-related applications, such as runtime hosts, compilers, disassemblers, obfuscators, debuggers, and profilers. | ||
|
||
These articles describe APIs that were introduced in .NET Core 2.0 and later versions, or APIs that can be used with both .NET Framework and .NET. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These articles describe APIs that were introduced in .NET Core 2.0 and later versions, or APIs that can be used with both .NET Framework and .NET. | |
These articles describe APIs that can be used with both .NET Framework and .NET. |
There APIs were introduced a long time in .NET Framework and they were available in .NET Core 1.0 as well.
|
||
**Header:** MsCorEE.h | ||
|
||
**Library:** Included as a resource in MsCorEE.dll |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what "Included as a resource in MsCorEE.dll" is trying to say.
mscoree.dll is part of Windows / .NET Framework only (c:\Windows\system32\mscoree.dll) and these APIs are certainly not resources of that binary.
For enumerations and structures, I would delete this line or change it to **Library:** None
For interfaces, I would change it to **Library:** CorGuids.lib
- "AssemblyFlags enumeration [.NET Framework metadata]" | ||
ms.assetid: 40f9bd9e-16ec-447e-81b0-168c875e9866 | ||
topic_type: | ||
topic_type: | ||
- "apiref" | ||
--- | ||
# AssemblyFlags Enumeration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only used by ALink interfaces that are .NET Framework-specific. This should stay under .NET Framework.
The one reference to this enum from docs\core\unmanaged-api\metadata\interfaces\imetadataassemblyemit-setassemblyprops-method.md
is wrong. imetadataassemblyemit-setassemblyprops-method.md should be referencing CorAssemblyFlags enum instead.
|
||
```cpp | ||
typedef enum { | ||
afImplicitExportedTypes = 0x0001, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not match the definition of the enum for .NET Framework SDK. (I cannot think of a enum with these kind of members in the public .NET Framework or .NET Core surface.)
Correct definition from C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\Include\um\alink.h
on my machine:
typedef enum _AssemblyFlags {
afNone = 0x00000000, // Normal case
afInMemory = 0x00000001, // An InMemory single-file assembly the filename == AssemblyName
afCleanModules = 0x00000002, // Use DeleteToken and Merging to remove the AssemblyAttributesGoHere
afNoRefHash = 0x00000004, // Do not generate hashes for AssemblyRefs
afNoDupTypeCheck = 0x00000008, // Do not check for duplicate types (ExportedType table + manifest file's TypeDef table)
afDupeCheckTypeFwds = 0x00000010, // Do dupe checking for type forwarders. This is so you can specify afNoDupTypeCheck for regular typedefs + afDupeCheckTypeFwds.
} AssemblyFlags;
|
||
|Member|Description| | ||
|------------|-----------------| | ||
|`arfFullOriginator`|Specifies that the assembly reference contains full, unhashed information about the publisher of the assembly.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be deleted. There is no AssemblyRefFlags enumeration like this in any public surface.
docs\core\unmanaged-api\metadata\interfaces\imetadataassemblyemit-setassemblyrefprops-method.md and docs\core\unmanaged-api\metadata\interfaces\imetadataassemblyimport-getassemblyrefprops-method.md should be fixed to point for CorAssemblyFlags enumeration instead.
|`afPA_MSIL`|Indicates that the processor architecture is neutral (PE32).| | ||
|`afPA_x86`|Indicates that the processor architecture is x86 (PE32).| | ||
|`afPA_IA64`|Indicates that the processor architecture is Itanium (PE32+).| | ||
|`afPA_AMD64`|Indicates that the processor architecture is AMD X64 (PE32+).| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|`afPA_AMD64`|Indicates that the processor architecture is AMD X64 (PE32+).| | |
|`afPA_AMD64`|Indicates that the processor architecture is x86-64 (PE32+).| |
AMD x64 is not the right way to refer to this architecture
gpDefaultConstructorConstraint = 0x0010 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gpDefaultConstructorConstraint = 0x0010 | |
gpDefaultConstructorConstraint = 0x0010, | |
gpAllowByRefLike = 0x0020, | |
|`gpNoSpecialConstraint`|Indicates that no constraint applies to the <xref:System.Type> parameter.| | ||
|`gpReferenceTypeConstraint`|Indicates that the <xref:System.Type> parameter must be a reference type.| | ||
|`gpNotNullableValueTypeConstraint`|Indicates that the <xref:System.Type> parameter must be a value type that cannot be a null value.| | ||
|`gpDefaultConstructorConstraint`|Indicates that the <xref:System.Type> parameter must have a default public constructor that takes no parameters.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|`gpDefaultConstructorConstraint`|Indicates that the <xref:System.Type> parameter must have a default public constructor that takes no parameters.| | |
|`gpDefaultConstructorConstraint`|Indicates that the <xref:System.Type> parameter must have a default public constructor that takes no parameters.| | |
|`gpAllowByRefLike`|Indicates that the <xref:System.Type> parameter can be a [byref-like type](xref:System.Type.IsByRefLike). (available since .NET 7) | |
- "IMetaDataConverter::GetMetaDataFromTypeInfo method [.NET Framework metadata]" | ||
ms.assetid: d44484bb-23a3-49c3-9e46-69d0d9ab4f0f | ||
topic_type: | ||
topic_type: | ||
- "apiref" | ||
--- | ||
# IMetaDataConverter::GetMetaDataFromTypeInfo Method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMetadataConverter does not exist in .NET Core. It should stay in the .NET Framework specific part.
--- | ||
# IMetaDataDispenserEx::GetCORSystemDirectory Method | ||
|
||
Gets the directory that holds the current common language runtime (CLR). This method is supported only for use by out-of-process debuggers. If called from another component, it will return E_NOTIMPL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gets the directory that holds the current common language runtime (CLR). This method is supported only for use by out-of-process debuggers. If called from another component, it will return E_NOTIMPL. | |
Gets the directory that holds the current common language runtime (CLR). This method is supported only for use by .NET Framework out-of-process debuggers. If called from another component, it will return E_NOTIMPL. |
Since they can be used on both .NET and .NET Framework, this PR moves unmanaged APIs for Metadata from the
/docs/**framework**/unmanaged-api/
folder to the/docs/**core**/unmanaged-api/
folder, following the pattern established in PR #37206 for debugging and profiling APIs.Changes Made
APIs Moved
Documentation Updates
/docs/core/unmanaged-api/index.md
as the main landing page for cross-platform unmanaged APIs/docs/framework/unmanaged-api/index.md
to clarify it's for .NET Framework-specific APIs and added cross-references to moved contenttoc.yml
) files for the new core structureCross-Reference Fixes
Updated internal links in the following files to point to the new locations:
docs/fundamentals/reflection/emitting-dynamic-methods-and-assemblies.md
docs/fundamentals/runtime-libraries/system-threading-thread.md
Contributes to #37227.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Internal previews
Toggle expand/collapse
Note
This table shows preview links for the 30 files with the most changes. For preview links for other files in this PR, select OpenPublishing.Build Details within checks.