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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:55:06+00:00 2026-05-27T01:55:06+00:00

I am running FxCop against my Silverlight code and appear to be getting a

  • 0

I am running FxCop against my Silverlight code and appear to be getting a lot of CA1051 error codes:

Error, Certainty 90, for DoNotDeclareVisibleInstanceFields

Target       : #msgTextBox  (IntrospectionTargetMember)
Resolution   : "Because field 'MessagingControl.msgTextBox' is 
               visible outside of its declaring type, change its accessibility 
               to private and add a property, with the same accessibility 
               as the field has currently, to provide access to it."
Help         : http://msdn.microsoft.com/library/ms182141(VS.100).aspx  (String)
Category     : Microsoft.Design  (String)
CheckId      : CA1051  (String)
RuleFile     : Design Rules  (String)
Info         : "Instance fields that are visible outside of the type 
               that declares them, limit your ability to change the 
               implementation details for those data items. Use properties 
               instead. They do not compromise usability or performance 
               and they do provide flexibility in that they conceal 
               the implementation details of the underlying data."
Created      : 25/11/2011 10:59:54  (DateTime)
LastSeen     : 25/11/2011 14:57:49  (DateTime)
Status       : Active  (MessageStatus)
Fix Category : NonBreaking  (FixCategories)

Most of these seem to be from x:Name in the xaml so I don’t think it can be fixed? Is there anything I can do to fix these errors apart from suppressing them all?

  • 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-27T01:55:07+00:00Added an answer on May 27, 2026 at 1:55 am

    The default visibility for control fields is set to internal.

    use x:FieldModifier="<modifier>" e.g. <TextBox x:Name="msgTextBox" x:FieldModifier="private" /> to control this behavior.

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

Sidebar

Related Questions

After running Code Analysis in VS2010 beta (FxCop for previous versions) I'm getting the
I am running static code analysis with FxCop 1.36 and I keep getting warning
Running FxCop on my code, I get this warning: Microsoft.Maintainability : 'FooBar.ctor is coupled
I get the following error when running FXCop: CA1800 : Microsoft.Performance : 'obj', a
I'm running some code through FxCop and am currently looking at clearing all of
I am running my DLL against FxCop and it is returning problems as seen
Running the below code with Fiddler shows that plus signs are getting converted to
I'm running FxCop from MSBuild and during the analysis it throws an error stating
Running into a problem where on certain servers we get an error that the
Running FxCop on a WebProject that contains a UserControl will result in a CA2000

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.