System.TypeLoadException: Inheritance security rules violated by type: ”

I had this error:
A first chance exception of type ‘System.TypeLoadException’ occurred in mscorlib.dll
The configuration editor was unable to load an assembly. This may affect the configuration tasks you can perform.  The error encountered was: System.TypeLoadException: Inheritance security rules violated by type: ‘EntLibContrib.Validation.Validators.CollectionCountValidatorAttribute’. Derived types must either match the security accessibility of the base type or be less accessible.
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at Microsoft.Practices.EnterpriseLibrary.Configuration.Design.ViewModel.Services.AnnotationService.<DiscoverSubstituteTypesFromAssemblies>b__0(Assembly a) in D:\My Documents\EntLib50Src\Blocks\Configuration\Src\Design\ViewModel\Services\AnnotationService.cs:line 57
at Microsoft.Practices.EnterpriseLibrary.Configuration.Design.Extensions.SafeEnumerableExtensions.SelectManyIterator`2.MoveToNextInnerEnumerator() in D:\My Documents\EntLib50Src\Blocks\Configuration\Src\Design\Extensions\SafeEnumerableExtensions.cs:line 281

when trying to make a project that has Validators that inherits from EntLib.

The Cause:
The EntLib dlls assemblies has the attribute:
[assembly: SecurityRules(SecurityRuleSet.Level1)]
in their AssemblyInfo.cs

The solution:
add the same attribute to ur AssemblyInfo.cs

About Reader Man حسين ناجي الصفافير

حسين ناجي الصفافير Hussain Naji Al-Safafeer Info: https://readerman1.wordpress.com/aboutme
This entry was posted in EntLib (Enterprise Library) and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s