This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
System.Private.CoreLib/Resources Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 2884
2884
<data name =" NotSupported_CollectibleBoundNonCollectible" xml : space =" preserve" >
2885
2885
<value >A non-collectible assembly may not reference a collectible assembly.</value >
2886
2886
</data >
2887
+ <data name =" NotSupported_CollectibleWinRT" xml : space =" preserve" >
2888
+ <value >WinRT Interop is not supported for collectible types.</value >
2889
+ </data >
2887
2890
<data name =" NotSupported_CreateInstanceWithTypeBuilder" xml : space =" preserve" >
2888
2891
<value >CreateInstance cannot be used with an object of type TypeBuilder.</value >
2889
2892
</data >
Original file line number Diff line number Diff line change @@ -837,6 +837,12 @@ BOOL Module::CanCacheWinRTTypeByGuid(MethodTable *pMT)
837
837
}
838
838
CONTRACTL_END;
839
839
840
+ // Don't cache WinRT types in collectible modules.
841
+ if (IsCollectible ())
842
+ {
843
+ return FALSE ;
844
+ }
845
+
840
846
// Don't cache mscorlib-internal declarations of WinRT types.
841
847
if (IsSystem () && pMT->IsProjectedFromWinRT ())
842
848
return FALSE ;
Original file line number Diff line number Diff line change @@ -5161,6 +5161,14 @@ ClassFactoryBase *GetComClassFactory(MethodTable* pClassMT)
5161
5161
5162
5162
if (pClsFac == NULL )
5163
5163
{
5164
+ //
5165
+ // Collectible types do not support WinRT interop
5166
+ //
5167
+ if (pClassMT->IsExportedToWinRT () || pClassMT->IsProjectedFromWinRT ())
5168
+ {
5169
+ COMPlusThrow (kNotSupportedException , W (" NotSupported_CollectibleWinRT" ));
5170
+ }
5171
+
5164
5172
NewHolder<ClassFactoryBase> pNewFactory;
5165
5173
5166
5174
if (pClassMT->IsExportedToWinRT ())
You can’t perform that action at this time.
0 commit comments