Disable CAS calls on System.Componentmodel.TypeDescriptor
authorSebastien Pouliot <sebastien@xamarin.com>
Fri, 30 Jan 2015 00:52:58 +0000 (19:52 -0500)
committerMarek Safar <marek.safar@gmail.com>
Mon, 2 May 2016 22:07:46 +0000 (00:07 +0200)
mcs/class/referencesource/System/compmod/system/componentmodel/TypeDescriptor.cs

index 44ef7f85be6c100ff06d7f50a0b04f4c1dbcd1f2..c1e1c43b23199a3ba9b9cfc98f580dd81d3699bc 100644 (file)
@@ -475,13 +475,17 @@ namespace System.ComponentModel
                     // sense that they provide a public API while not necessarily being public themselves. As such,
                     // we need to allow instantiation of internal TypeDescriptionProviders. See the thread attached
                     // to VSWhidbey #500522 for a more detailed discussion.
+#if !DISABLE_CAS_USE
                     IntSecurity.FullReflection.Assert();
                     try {
+#endif
                         prov = (TypeDescriptionProvider)Activator.CreateInstance(providerType);
+#if !DISABLE_CAS_USE
                     }
                     finally {
                         CodeAccessPermission.RevertAssert();
                     }
+#endif
                     Trace("Providers : Default provider found : {0}", providerType.Name);
                     AddProvider(prov, type);
                     providerAdded = true;