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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:39:41+00:00 2026-05-20T22:39:41+00:00

This new feature is really convenient. Lately I read the document of the Microsoft

  • 0

This new feature is really convenient.

Lately I read the document of the “Microsoft All-In-One Code Framework”, and it mentions that “Optional Parameters” is not CLS-Compliant.

So I tested it by using “Optional Parameters” in a public API, and turned on FxCop, then I compiled and FxCop did not complain about anything. At the mean while, FxCop did report a warning when I add an API that has uint as its return type.

So now I am confused, is “Optional Parameters” CLS-Compliant or not?

And what’s the best way to find out whether a new language feature is CLS-Compliant or not?

  • 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-20T22:39:42+00:00Added an answer on May 20, 2026 at 10:39 pm

    Optional arguments are “sort-of” CLS-compliant. Methods with optional arguments are legal and can be successfully compiled with the CLSCompliant attribute, but callers of those methods don’t necessarily need to take account of the default parameter values or the optional attribute. (In which case those methods would behave in exactly the same way as standard methods, requiring that all the arguments be stated explicitly at the call site.)

    Methods that use default parameters
    are allowed under the Common Language
    Specification (CLS); however, the CLS
    allows compilers to ignore the values
    that are assigned to these parameters.
    Code that is written for compilers
    that ignore default parameter values
    must explicitly provide arguments for
    each default parameter. To maintain
    the behavior that you want across
    programming languages, methods that
    use default parameters should be
    replaced with method overloads that
    provide the default parameters.

    (Taken from the documentation for “CA1026: Default parameters should not be used”.)

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

Sidebar

Related Questions

This is a new gmail labs feature that lets you specify an RSS feed
I really like the new built in feature of VS11 to find 'Code Clones'
In Git I can do this: 1. Start working on new feature: $ git
I just started to read about this new technology... Does someone have some knowledge
Soooo, I am starting this new job soon where most of the code is
Internet Explorer 8 has a new security feature, an XSS filter that tries to
I'm really struggling with this regex. We're launching a new version of our groups
I am really new to maven. I am bit confused about the dependency feature.
In the past few months, I've read multiple articles about this new unobtrusive JavaScript
I'm doing some tests with new features of CSS3, but this combination only works

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.