473,418 Members | 2,075 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

FxCop Error on command button

I'm running FX Cop on my assembly and on a form, tons of my labels and
buttons are being flagged with this error. I don't really get the error and
what I am supposed to do to resolve the error. I know that even the form
generated code isn't FxCop "safe" in the 1.1 DNF but apparently 2.0 will be.
Until then... can someone explan to me what needs to be fixed?

The button in this example is a simple one called cmdClear.
thanks
Eric
Error, Certainty 50, for
"UnsealedPublicTypesDoNotHaveInternalVirtualMember s"
{
Target : "set_cmdClear(System.Windows.Forms.Button):System. Void"
(IntrospectionTargetMethod)
Resolution : "The method 'set_cmdClear' is an internal, virtual method
defined in public type 'SearchDialog1'. Change the method to be non-virtual,
or secure the type with an inheritance demand for a strong name key that you
own.
"
Help : "file:
http://www.gotdotnet.com/team/fxcop/...rtualMbrs.html "
(String)
RuleFile : "SecurityRules.dll" (String)
Info : "When internal virtual members exist on a public type running on
version 1.0 of the .NET Framework, subclasses
can overwrite the internal virtual member, possibly creating an exploitable
security weakness."

More Info : "Callers might assume that they are accessing a member that is
defined internally, when the code being executed is actually defined in a
subclass of the type. Even though the 'internal' keyword is present on the
virtual member, on version 1.0 of the .NET framework this subclass
can be located in a different assembly. If the caller asserts permissions
before accessing the overridden member, the member code could run with
elevated permissions. Also, callers that make decisions based on data
returned by the member might be vulnerable to attack. While the assembly
containing the subclass must have access to the defining type in order to
override its members,the 'internal' key word is not, by itself, sufficient
to prevent this access. If you do not fix a violation of this rule, be sure
to review all code that calls this method to ensure any information returned
by the vulnerable member is being used safely."
Created : "6/17/2004 3:29:23 PM" (DateTime)
LastSeen : "6/17/2004 4:14:58 PM" (DateTime)
Status : Active (MessageStatus)
Nov 20 '05 #1
2 1366
* "Eric Sabine" <mopar41@hyotyt_mail_nounderscores.com> scripsit:
I'm running FX Cop on my assembly and on a form, tons of my labels and
buttons are being flagged with this error. I don't really get the error and
what I am supposed to do to resolve the error. I know that even the form
generated code isn't FxCop "safe" in the 1.1 DNF but apparently 2.0 will be.
Until then... can someone explan to me what needs to be fixed?


Sure you read <URL:http://www.gotdotnet.com/team/fxcop/docs/rules/SecurityRules/InternalVirtualMbrs.html>?

Maybe marking the method as 'NotOverridable' helps, but this should be
done automatically if the method doesn't override a base class
procedure. Another solution would be to change the modifier of the
members to 'Private' or 'Protected', or to simply ignore what FxCop
says.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Marking the label, i.e, Private WithEvents ThisLable as
System.Windows.Forms.Lable, with Private does the trick. Thanks.
Eric
Herfried K. Wagner [MVP] wrote:
* "Eric Sabine" <mopar41@hyotyt_mail_nounderscores.com> scripsit:
I'm running FX Cop on my assembly and on a form, tons of my labels
and buttons are being flagged with this error. I don't really get
the error and what I am supposed to do to resolve the error. I know
that even the form generated code isn't FxCop "safe" in the 1.1 DNF
but apparently 2.0 will be. Until then... can someone explan to me
what needs to be fixed?
Sure you read

<URL:http://www.gotdotnet.com/team/fxcop/...les/InternalVi
rtualMbrs.html>?
Maybe marking the method as 'NotOverridable' helps, but this should be
done automatically if the method doesn't override a base class
procedure. Another solution would be to change the modifier of the
members to 'Private' or 'Protected', or to simply ignore what FxCop
says.

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Crocker Data Processing | last post by:
Hi. I've written a bunch of custom rules for FxCop version 1.23, and today happened to download and install (separately) the new FxCop 1.321. Arrgghh ! The new introspection stuff is a lot...
3
by: Steve | last post by:
I have some general catch clauses in my app as follows: try { } catch(Exception ex) { } try
3
by: Rasmus | last post by:
I VS 2005 beta 2 i have a solution with - a number of classes - a website - a httphandler - a http module I want to run fxcop on my class files - but cant find out how to enable it. I've...
8
by: hansiman | last post by:
Just beginning using FxCop in my asp.net projects... I get a lot of error messages under the header: AvoidUnusedParameters for funtions and routines lik: Sub isUserAuthenticated(ByVal...
3
by: Doug Durrett | last post by:
I'm having an issue and wanted to pass it by everyone to see what you think. Here is my code. //Code Start searchs = new...
6
by: John Wright | last post by:
I ran FxCop against a program and was pleased with the security review except I get the following error: Do not indirectly expose methods How would I fix this code so this error goes away. I...
7
by: Dave | last post by:
Hi all, I'm using FxCop to go through my code and it's showing bad things in my code. It is saying that you should never ever catch a general exception, and since in my (apparent) foolishness...
2
by: RedLars | last post by:
Hi, Need some advice on debugging the static code analysis (fxcop) service in vs2005 teamsenter. In our solution any fxcop fault is configured to result in a compiler error. On all development...
1
by: Water Cooler v2 | last post by:
I am trying to add FxCop to work inside Visual Studio 2005 Professional Edition. I believe there are two approaches. The first is outlined in this short article: ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.