473,386 Members | 1,819 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,386 software developers and data experts.

Website Code Analysis

mc
When I run Code analysis on my website I always get 4 errors, one from
each of my Global.asax functions Application_Error,Application_Start,
Session_End, Session_Start. the error is "'Function Name' appears to
have no upstream public or protected callers." Is this expected?

I guess it is as IIS would call these not any of my code explicitly?

can I tell the code analysis tool to ignore these functions?

TIA
Mike
Aug 11 '06 #1
1 4091
Hello Mike,

As for the "Application_Error,Application_Start, Session_End,
Session_Start" methods, they're really of the special case which will
violate the normal best practice rules defined by the built-in code
analysis categories. Actually, it is the ASP.NET runtime which call the
these methods at the proper time.

For these methods, since they're of the particular case and should be
isolated from other normal functions, you can consider the following
options:

1. Since the warning you get is rule "CA1811: Avoid uncalled private
code", you can modify all the functions in the global.asax file as
"protected" , e.g.

protected void Application_Start(...)

this can help suppress the CA1811 warning in thsi particular case.
2. It is a quite reasonable and normal scenario that we may have some
particular methods or code module which violate the common best practice
though they're under our control. The .net 2.0 code analysis provide
warning suppress setting in different granularity. We can enable/disable
certain rules in IDE/project setting or suppress rules for a particular
unit(method, module ....).

For this case, you can use the "SuppressMessageAttribute" to decorate the
functions in the global.asax against the CA1811 rule.

#In Source Suppression Overview
http://msdn2.microsoft.com/en-us/library/ms244717.aspx

e.g.

=====================
[System.Diagnostics.CodeAnalysis.SuppressMessage("M icrosoft.Performance",
"CA1811")]
void Application_Start(object sender, EventArgs e)
{
................
}
=====================
Hope this helps you.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Aug 11 '06 #2

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

Similar topics

10
by: Harry Slaughter | last post by:
I've got a client who wants to see some immediate results on a brand new website. within a week, they'd like to see the following: 1) basic user authentication (using php sessions/cookies to...
9
by: Xueilonox | last post by:
I'm working on a project that has a website with some streaming video. We're tracking clicks on the custom video player (Windows Media Player) to a mysql database (requirement). Is there a...
11
by: GaryDean | last post by:
We created a "File" website on XP and transferred it over to server2003. Now we want to change it to an HTTP site. Without creating a new project and importing everthing, it there a way to convert...
5
by: Coogan | last post by:
Hi-- I'm using Python for the first time to make a plug-in for Firefox. The goal of this plug-in is to take the source code from a website and use the metadata and body text for different...
2
by: Max2006 | last post by:
Hi, After I right-click on my web application project file and choose "Publish ." and do the publishing, the result publishable files does not include the *.ashx files. Is it by design? How...
3
by: jasone | last post by:
Hello all! I want to create an analysis tool for my client, the website will have a shopping cart etc. and i would like to create a protected section to the website to track the following...
3
by: =?Utf-8?B?SGVyYg==?= | last post by:
Can I use the Website Administration tool to manage users and roles for multiple ASP.NET applications using a single, common ASPNETDB? If so, what changes do I have to make to the web.config...
21
by: =?ISO-8859-1?Q?Fad=A5?= | last post by:
Hello guys, I want to do kinda of an A/B split testing on a website I run. I just created a new version but I need to keep both version running and see which one will perform better. First, I'm...
3
by: =?Utf-8?B?SGVyYg==?= | last post by:
I've developed an ASP.NET website that runs fine on my local WinXP IIS and on my server's IIS, both are IIS6.0 The site uses a master page that has the following declaration: <%@ Master...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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
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,...
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...

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.