Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
cfcf99c7
R
runtime
项目概览
dotNET Platform
/
runtime
10 个月 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
cfcf99c7
编写于
5月 31, 2022
作者:
A
Aleksey Kliger (λgeek)
提交者:
GitHub
5月 31, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add MetadataUpdateOriginalTypeAttribute (#69751)
Fixes
https://github.com/dotnet/runtime/issues/66222
上级
62f5d4e6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
31 addition
and
0 deletion
+31
-0
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
...ivate.CoreLib/src/System.Private.CoreLib.Shared.projitems
+1
-0
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/MetadataUpdateOriginalTypeAttribute.cs
...e/CompilerServices/MetadataUpdateOriginalTypeAttribute.cs
+23
-0
src/libraries/System.Runtime.Loader/ref/System.Runtime.Loader.cs
...raries/System.Runtime.Loader/ref/System.Runtime.Loader.cs
+7
-0
未找到文件。
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
浏览文件 @
cfcf99c7
...
...
@@ -761,6 +761,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\MethodImplAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\MethodImplOptions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\ModuleInitializerAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\MetadataUpdateOriginalTypeAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\ReferenceAssemblyAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilder.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs" />
...
...
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/MetadataUpdateOriginalTypeAttribute.cs
0 → 100644
浏览文件 @
cfcf99c7
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace
System.Runtime.CompilerServices
;
[
AttributeUsage
(
System
.
AttributeTargets
.
Class
|
System
.
AttributeTargets
.
Struct
,
AllowMultiple
=
false
,
Inherited
=
false
)]
public
class
MetadataUpdateOriginalTypeAttribute
:
Attribute
{
/// <summary> This attribute is emited by Roslyn when a type that is marked with (or derives
/// from a type that is marked with) <see
/// cref="System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute" /> is updated
/// during a hot reload session. The <see cref="OriginalType" /> points to the original version
/// of the updated type. The next update of the type will have the same <see
/// cref="OriginalType" />. Frameworks that provide support for hot reload by implementing a
/// <see cref="System.Reflection.Metadata.MetadataUpdateHandlerAttribute" /> may use this
/// attribute to relate an updated type to its original version. </summary>
///
/// <param name="originalType">The original type that was updated</param>
public
MetadataUpdateOriginalTypeAttribute
(
Type
originalType
)
=>
OriginalType
=
originalType
;
/// Gets the original version of the type that this attribtue is attached to.
public
Type
OriginalType
{
get
;
}
}
src/libraries/System.Runtime.Loader/ref/System.Runtime.Loader.cs
浏览文件 @
cfcf99c7
...
...
@@ -30,6 +30,13 @@ namespace System.Runtime.CompilerServices
public
sealed
class
CreateNewOnMetadataUpdateAttribute
:
System
.
Attribute
{
}
[
AttributeUsage
(
System
.
AttributeTargets
.
Class
|
System
.
AttributeTargets
.
Struct
,
AllowMultiple
=
false
,
Inherited
=
false
)]
public
class
MetadataUpdateOriginalTypeAttribute
:
Attribute
{
public
MetadataUpdateOriginalTypeAttribute
(
Type
originalType
)
{
throw
null
;
}
public
Type
OriginalType
{
get
{
throw
null
;
}
}
}
}
namespace
System.Runtime.Loader
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录