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 6818775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:13:13+00:00 2026-05-26T21:13:13+00:00

[assembly: CLSCompliant(true)] //CS3016: Arrays as attribute arguments is not CLS-compliant. [ModuleExport(typeof(ModuleA), DependsOnModuleNames = new

  • 0
[assembly: CLSCompliant(true)]

//CS3016: Arrays as attribute arguments is not CLS-compliant.
[ModuleExport(typeof(ModuleA), DependsOnModuleNames = new [] { "ModuleB" })]
public class ModuleA : IModule { }

The only thing I can think of is to mark the class as [CLSCompliant(false)], but I was wondering if there is a better way to get around this?

  • 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-05-26T21:13:13+00:00Added an answer on May 26, 2026 at 9:13 pm

    As a workaround you can implement your own CLS compliant ModuleExportAttribute which uses a comma separated list instead of an string array:

    [MetadataAttribute]
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class StringListModuleExportAttribute : ExportAttribute, IModuleExport
    {
        public StringListModuleExportAttribute(Type moduleType)
            : base(typeof(IModule))
        {
            ModuleName = moduleType.Name;
            ModuleType = moduleType;
        }
    
        public string ModuleName { get; private set; }
        public Type ModuleType { get; private set; }
        public InitializationMode InitializationMode { get; private set; }
        public string[] DependsOnModuleNames
        {
            get
            {
                if (string.IsNullOrEmpty(DependsOnModuleNameList))
                    return new string[0];
                return DependsOnModuleNameList.Split(new[] {","}, StringSplitOptions.RemoveEmptyEntries);
            }
        }
    
        public string DependsOnModuleNameList { get; set; }
    }
    

    Usage:

    [StringListModuleExport(typeof(ModuleA), DependsOnModuleNameList = "ModuleB,ModuleC")]
    public class ModuleA : IModule
    {
        public void Initialize()
        {
            Debug.WriteLine("ModuleA init");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a project and I mark it as <Assembly: CLSCompliant(True)> Do I
IronPython.net documentation says the MSIL in the assembly isn't CLS-compliant, but is there a
Assembly Binding Log Viewer (fuslogvw) is not logging bindings for any version of the
Problem: SQLite assembly referenced in my DAL assembly does not get copied to the
Assembly.GetEntryAssembly() does not work for web applications. But... I really need something like that.
I have an assembly which should not be used by any application other than
Assembly assembly = Assembly.GetCallingAssembly(); assembly.CreateInstance(MyType); and Activator.CreateInstance(typeof(MyType)); Ok, the Activator.CreateInstance can be generic which
Maven assembly plugin has a predefined descriptor for jar-with-dependencies but not a jar-without-dependencies. I
Assembly [AssemblyName] must have a shared name to be installed globally I am getting
Assembly A - ResourceDictionary contains StyleA style. Assembly B - ResourceDictionary.MergedDictionaries to merge resources

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.