Ent lib and silverlight 5 RC Inheritance security rules violated

Topics: Enterprise Library Core, Silverlight Integration Pack
Sep 11, 2011 at 10:33 AM

Аfter update to 5 rc I gеt this exception from entlib in vs & blend designers (at runtime everything is still fine but with this exception I cannot design in blend or visual studio):
“Inheritance security rules violated while overriding member: 'System.Xml.Linq.XObject.System.Xml.IXmlLineInfo.HasLineInfo()'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.
   at Microsoft.Practices.EnterpriseLibrary.Common.Utility.XamlActivator.CreateInstance[T](String typeXName)
   at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.Unity.UnityContainerConfigurator.AddValidationExtension()
   at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.Unity.UnityContainerConfigurator..ctor(IUnityContainer container)”

And my code:
var container = new UnityContainer().AddNewExtension<EnterpriseLibraryCoreExtension>();
RegisterTypes(container); // My method for registering interfaces
IServiceLocator locator = new UnityServiceLocator(container);
EnterpriseLibraryContainer.Current = locator;

Sep 11, 2011 at 3:20 PM

This is actually more of a SilverLight issue, not an EntLib issue.

If you want, you can keep track of this by checking at this forum: http://forums.silverlight.net/p/238699/591489.aspx/1?+SL5RC+Blend+for+SL5RC+Throws+Exception+if+TemplatedControl+uses+XElement

Hope this helps :)