Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8644753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:22:37+00:00 2026-06-12T12:22:37+00:00

When I want to add my custom control assembly (DLL) file to the Visual

  • 0

When I want to add my custom control assembly (DLL) file to the Visual Studio Toolbox, I encounter with following error:

There was an error loading types from assembly “my assembly file.”

Inheritance security rules violated by type: ItemsCollectionEditor. Derived types must either match the security accessibility of the base type or be less accessible.

Furthermore, I add assembly SecurityRulesAttribute to AssemblyInfo.cs file for solve the problem. However, it didn’t work for me.

My AssemblyInfo file code is:

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;

[assembly: AssemblyTitle("WindowsFormsControlLibrary2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("SSSSSSSSS")]
[assembly: AssemblyProduct("WindowsFormsControlLibrary2")]
[assembly: AssemblyCopyright("Copyright © SSSSSSSSS 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: ComVisible(false)]   
[assembly: Guid("ed5d434c-36e8-4883-a4d3-3eb6459546b3")]

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

[assembly: AssemblyKeyFile("Saino.snk")]
[assembly: AssemblyKeyName("")]
[assembly: System.Security.AllowPartiallyTrustedCallers]

[assembly: SecurityRules(SecurityRuleSet.Level2, SkipVerificationInFullTrust = true)]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:22:39+00:00Added an answer on June 12, 2026 at 12:22 pm

    Thank you mikalai. Your comment has a clue to me. And I could solve my problem. I understand from your comment that may be my code is correct and problem from other things. Based on your comment, I find the problem and solve it that I describe solution as follows:

    If the assembly file is registered in the GAC and assembly file codes change again, and assembly file re-compiles, and we want to add new recompiled assembly file to Visual Studio toolbox, this error will occur. The reason of occurring this error is that new recompiled assembly file, registered in GAC before and registered assembly file in GAC is different with it. So, new recompiled assembly file must be registered again in GAC.

    Now, If add registered assembly file in GAC or new recompiled assembly file to the Visual Studio toolbox, this error will never occur.

    Another tip that must be considered, is deleting or commenting following line of code in AssemblyInfo.cs file:

    [assembly: System.Security.AllowPartiallyTrustedCallers]
    

    And now, it will work correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to add a custom configuration section in my app.config file. Is there
I have created a Dynamic View Panel custom control and want to add a
I want to create an custom control (descendant of TRichEdit). I simply want add
I have created a user control, and now I want to add custom properties
i'm building a Videoplayer custom control (Project called WpfCustomControlLibrary1) and want to add a
I have a Windows::Forms application and I want to add a custom control to
Is there an easy way to add a checkbox (or any other custom control,
In MOSS 2007 I want to add a custom control to the global link
I want to add question mark icon and help popup to my custom control
I am creating a custom control and i want to add some properties in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.