473,625 Members | 2,632 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
"UnsealedPublic TypesDoNotHaveI nternalVirtualM embers"
{
Target : "set_cmdClear(S ystem.Windows.F orms.Button):Sy stem.Void"
(IntrospectionT argetMethod)
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 1382
* "Eric Sabine" <mopar41@hyotyt _mail_noundersc ores.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.c om/team/fxcop/docs/rules/SecurityRules/InternalVirtual Mbrs.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_noundersc ores.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
1510
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 nicer, but I will have to move my rules over. Fair enough, but I notice that there is still no documentation for the SDK, I understand that's because there may be
3
2888
by: Steve | last post by:
I have some general catch clauses in my app as follows: try { } catch(Exception ex) { } try
3
3428
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 looked at http://msdn2.microsoft.com/library/ms182066(en-us,vs.80).aspx
8
1892
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 blnLoggedIn As Boolean) If Not (blnLoggedIn) Then System.Web.HttpContext.Current.Response.Redirect(pcPageLogin) End If
3
2383
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 Maritz.Learning.HP.Callcenter.BusinessServices.Searchs(base.ConnectionString); searchs.Search(this.FirstNameTextbox.Text, this.LastNameTextbox.Text,
6
1368
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 think I understand the error, but not the fix. I really need to fix this as it is called from other programs and I do not want code elevating privileges in this function. Thanks.
7
1572
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 I'm catching all errors in my user interface I've got a fair few of these in my code. I'm doing this so that if a user presses a button if for some reason my code fails the worst case scenario for the user is either a usefull error message of a...
2
1997
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 computers our source code compiles \ builds without any problem. However, on the designated building computer when compiling the source we get roughtly 30 fxcop related errors of type CA1823. Obviously using vs2005 ts there aswell. Viewing the...
1
2198
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: http://www.c-sharpcorner.com/UploadFile/mahesh/VS2005ProjectPropertoes07232005081339AM/VS2005ProjectPropertoes.aspx?ArticleID=c88756d3-cd2b-4919-8e1f-11aabf430ee7 However, in my IDE, there is no checkbox with the caption 'Enable FxCop' in my copy of VS 2005 Pro as the article...
0
8182
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8688
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8352
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4085
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2614
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1800
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1496
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.