<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Sandeep Prabhakar's WebLog</title><subtitle type="html">This blog provides tips, tricks and summaries of my experiences as being part of the .NET Compact Framework team.</subtitle><id>http://blogs.msdn.com/sandeepp/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sandeepp/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/sandeepp/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2005-08-22T17:10:00Z</updated><entry><title>Building a community</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sandeepp/archive/2005/11/30/Community-Building.aspx" /><id>http://blogs.msdn.com/sandeepp/archive/2005/11/30/Community-Building.aspx</id><published>2005-11-30T13:04:00Z</published><updated>2005-11-30T13:04:00Z</updated><content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"&gt;Community building is an important part of any product release – especially so for a platform like the .Net Compact Framework. One of the things that takes sometimes a significant fraction of my working day is interacting with the community in multiple forms. Since this is such a time consuming process, I thought I'd rationalize my thoughts on the issue. &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"&gt;&lt;SPAN style="mso-list: Ignore"&gt;1.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;What's its purpose?&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify; mso-list: l4 level1 lfo1; tab-stops: list .5in"&gt;To provide a feedback loop to improve the product. This is information flowing from the community to the product team. 
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify; mso-list: l4 level1 lfo1; tab-stops: list .5in"&gt;To disseminate knowledge from the people with answers to the people with questions. This is information flow in the reverse direction.&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify; mso-list: l4 level1 lfo1; tab-stops: list .5in"&gt;So the question is how do we provide a solution to these purposes quicker and more efficiently?&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify; mso-list: l3 level1 lfo2; tab-stops: list .5in"&gt;Feedback to improve the product: 
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify; mso-list: l3 level2 lfo2; tab-stops: list 1.0in"&gt;More aggregated and analyzed views of problems people are facing. This is where things like Watson reports are very useful, since they aggregate the problems into buckets which allow us to focus sparse resources on things that are impacting the most users. 
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify; mso-list: l3 level2 lfo2; tab-stops: list 1.0in"&gt;Deeper understanding of the underlying problems. Sometimes people complain that x, y and z are not working correctly. It takes some analysis and understanding to know why x, y and z is happening and if we have a solution to the underlying problem A, we automatically solve all other related problems.&lt;/LI&gt;&lt;/OL&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify; mso-list: l3 level2 lfo2; tab-stops: list 1.0in"&gt;To disseminate knowledge:&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify; mso-list: l3 level2 lfo2; tab-stops: list 1.0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dissemination of knowledge is governed by 2 factors: &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo3; tab-stops: list 1.5in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Number of people who have the knowledge and are willing to share it.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo3; tab-stops: list 1.5in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;What's the reach of the information shared?&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Let's discuss what these 2 factors mean. &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"&gt;Product teams developing software is typically very small.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Based on the size of the community it provides services to, it is not possible for the product team to answer each and every question in a timely manner. This is the main reason that community building is important around any product. A community is something where people are willing to share information that they gleaned the hard way so that it benefits a large community. This is where MVPs are so beneficial since they provide that spark to the community. The size of this community and the experience of the people in the technology are the principle factors that determine how long it takes for a question to be answered.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"&gt;Reach of information is also another thing that effects how efficiently the information is disseminated. For example say I solve a customer's problem over email. I might get n other customers over the space of a long time where I might need to revisit the problem and solve it again (or atleast dig out the last email I had). This is where I think blogging/ whitepapers is so useful. It’s a means to leverage your work you did when you solved customer 1's &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;problems. This is beneficial in 2 ways – first, it reduces the number of times the product team needs to look at the same issue again and again and second, it provides a quicker answer to the customer when he needs a solution to the problem he is facing.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level1 lfo5; tab-stops: list .25in"&gt;&lt;SPAN style="mso-list: Ignore"&gt;2.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;So what are the channels of communication?&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level2 lfo5; tab-stops: list .75in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Product support&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level2 lfo5; tab-stops: list .75in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Blogging&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level2 lfo5; tab-stops: list .75in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;White papers&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level2 lfo5; tab-stops: list .75in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;KB articles&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level2 lfo5; tab-stops: list .75in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Newsgroups&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level2 lfo5; tab-stops: list .75in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Interest groups&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level2 lfo5; tab-stops: list .75in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Chats&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level2 lfo5; tab-stops: list .75in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Email aliases&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level2 lfo5; tab-stops: list .75in"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level2 lfo5; tab-stops: list .75in"&gt;Each of these channels of communication has advantages and disadvantages. Some are suited for certain types of interaction whereas others are not.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level2 lfo5; tab-stops: list .75in"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level2 lfo5; tab-stops: list .75in"&gt;I am always on the lookout for better and more efficient use of time in such a way that it benefits the largest possible community. So if you have any feelings as to what form of communication works the best for you, please send me your comments.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=498283" width="1" height="1"&gt;</content><author><name>Sandeep Prabhakar</name><uri>http://blogs.msdn.com/members/Sandeep+Prabhakar.aspx</uri></author></entry><entry><title>My 2 cents on Performance</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sandeepp/archive/2005/10/25/Performance.aspx" /><id>http://blogs.msdn.com/sandeepp/archive/2005/10/25/Performance.aspx</id><published>2005-10-25T21:09:00Z</published><updated>2005-10-25T21:09:00Z</updated><content type="html">&lt;P&gt;One of the most common questions we are asked is how fast is .NET Compact Framework?&lt;/P&gt;
&lt;P&gt;There are 2 things that will help you the most for your project:&lt;BR&gt;&lt;STRONG&gt;&lt;EM&gt;1. Learning how .NET Compact Framework is architected from a performance viewpoint, you'd get do's and don't while coding up a managed application.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;A lot has been already described about this and I don't have anything to add that's not already in these awesome blogs from Mike, Scott and Roman:&lt;BR&gt;&lt;a href="http://blogs.msdn.com/mikezintel/archive/2005/03/30/403941.aspx"&gt;http://blogs.msdn.com/mikezintel/archive/2005/03/30/403941.aspx&lt;/A&gt;&lt;BR&gt;&lt;a href="http://blogs.msdn.com/scottholden/archive/2005/01/05/346770.aspx"&gt;http://blogs.msdn.com/scottholden/archive/2005/01/05/346770.aspx&lt;/A&gt;&lt;BR&gt;&lt;a href="http://blogs.msdn.com/netcfteam/archive/2005/05/04/414820.aspx"&gt;http://blogs.msdn.com/netcfteam/archive/2005/05/04/414820.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;2. Measuring your key scenarios using kernels early in the project.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Before writing a huge and bulky project in .NET Compact Framework, you should measure the running times using small kernel programs that are representative of your scenarios. It's said that the 3 important keywords to writing a performant application are "Measure, measure, measure...". Make sure that you have performance goals in mind at the very beginning of the project. Sometimes performance can be tweaked as an after thought, but in most cases this might require huge architectural changes and major rewrites of parts of your program. A few pointers when doing this performance measurement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;1. Put the operation you want to measure the time of in a loop. Measure the time before starting the loop and after the end of the loop. Do NOT measure the time for each iteration of the loop. Make sure that the loop has enough iterations to run for a few seconds. Run the test many times and average the times. The reason for there is some measurement error and if you time within each iteration of the loop, you are increasing the error. A simple example of seeing how long it takes to read from an XML File is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;startTime = Enviroment.TickCount();&lt;BR&gt;&amp;nbsp;for(int i=0;i&amp;lt;5000000;i++)&lt;BR&gt;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;// Code to read from XML File&lt;BR&gt;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;endTime = Enviroment.TickCount();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;TimePerIteration = (endTime-startTime) / 5000000;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;2. A second baseline for comparison, might be to translate the same kernel above to native code and see how long it takes for the same loop to execute. This way you can measure the overhead of managed code compared to native code. In some cases, the managed implementation could be faster than the native implementation due to the performance tweaks that we have done in the Compact Framework.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;3. If on the whole, the .NET Compact Framework program meets your performance goals except for a few scenarios (and the native implementation meets your goals), you could look at PInvoking to native code for those specific scenarios. However, we recommend against this as we have a robust framework and there might be some error checking that you might fail to do in your native kernel that gives it better performance. The PInvoke route is an option to not writing the entire application in native code, but just a few key pieces. (Think of it as what we used to do when comparing assembly code kernels in a mostly C program a sometime back...). Also, another option for scenarios that don't meet your performance goals, is to rewrite managed code using a different mechanism. There are multiple ways to perform the same functionality - like for instance, you can program to sockets rather than to web services. Of course, there are ease of use, interop considerations to take into account, but these tradeoffs need to be made early in the cycle rather than later.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;4. Sometimes there are variations in the time of the measured benchmark kernel. Turning on performance counters (&lt;A href="http://msdn2.microsoft.com/en-us/library/ms172525"&gt;http://msdn2.microsoft.com/en-us/library/ms172525&lt;/A&gt;) you can see if there are things that affect execution time by randomizing it. Things you should look for are GC's, JIT code pitches etc. If you loop is creating a huge amount of garbage, this might not be avoidable (But then if that's your scenario, you would like GC to execute cause then it's typical). If not, and the GC just happened to occur while you were executing the function - then you could add a GC.Collect() before starting the measurement of your kernel to eliminate the effects of GC on your timing. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;5. In order to get managed code to execute, there are 2 stages: JIT stage and running the Jitted code stage. In typical long running programs, the 2nd stage is the one that's important and takes the longest time. As a result, one of the common things we do when we measure performance it we prime the JITing process. That is we execute the operation once before we start measuring the time in a loop. This JIT's all the code in the codepath that's being measured before you actually start measuring the time and hence you get a more accurate timing of the 2nd stage which represents execution of the program.&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&amp;nbsp;For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Foo.Test();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;startTime = Enviroment.TickCount();&lt;BR&gt;&amp;nbsp;for(int i=0;i&amp;lt;5000000;i++)&lt;BR&gt;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;Foo.Test();&lt;BR&gt;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;endTime = Enviroment.TickCount();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;TimePerIteration = (endTime-startTime) / 5000000;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;FONT size=1&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=484748" width="1" height="1"&gt;</content><author><name>Sandeep Prabhakar</name><uri>http://blogs.msdn.com/members/Sandeep+Prabhakar.aspx</uri></author></entry><entry><title>Plugging into Events that happen on a device in managed code</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sandeepp/archive/2005/10/21/NetworkEvents.aspx" /><id>http://blogs.msdn.com/sandeepp/archive/2005/10/21/NetworkEvents.aspx</id><published>2005-10-21T20:57:00Z</published><updated>2005-10-21T20:57:00Z</updated><content type="html">&lt;P&gt;&lt;FONT color=#000000&gt;One of the most common requirements of a well written mobile application is to be network aware. For instance, &lt;/FONT&gt;&lt;FONT color=#000000&gt;as an app how do I determine if I am in the signal range of a GPRS network?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;There's this cool managed class that exposed in the windows mobile 5.0 SDK that offers a ton of properties &lt;/FONT&gt;&lt;FONT color=#000000&gt;that you can hook event handlers on. Thus for instance when you come in the range of the GPRS network, poof an &lt;/FONT&gt;&lt;FONT color=#000000&gt;event is fired and you code that needs to do some network operation is called.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;Hooking in the event handler for getting an event on a GPRS network becoming available is as follows:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;&amp;nbsp; &amp;nbsp;SystemState state =&amp;nbsp; new SystemState(SystemProperty.PhoneGprsCoverage);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state.Changed += new ChangeEventHandler(state_Changed);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;Check out the information in the SDK for all the events that can happen on a device and how you can plug into &lt;/FONT&gt;&lt;FONT color=#000000&gt;those events.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/T_Microsoft_WindowsMobile_Status_SystemState.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/T_Microsoft_WindowsMobile_Status_SystemState.asp&lt;/A&gt;&lt;BR&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/T_Microsoft_WindowsMobile_Sta"&gt;&lt;FONT color=#000000&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;FONT color=#800080&gt;&lt;U&gt;&lt;/A&gt;&lt;/U&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;&lt;BR&gt;&amp;nbsp;&lt;FONT size=1&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/T_Microsoft_WindowsMobile_Status_SystemState.asp"&gt;&lt;/A&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=483521" width="1" height="1"&gt;</content><author><name>Sandeep Prabhakar</name><uri>http://blogs.msdn.com/members/Sandeep+Prabhakar.aspx</uri></author></entry><entry><title>HowTo: Approach Debugging Networking Problems</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sandeepp/archive/2005/10/20/NetworkDebugging.aspx" /><id>http://blogs.msdn.com/sandeepp/archive/2005/10/20/NetworkDebugging.aspx</id><published>2005-10-21T04:15:00Z</published><updated>2005-10-21T04:15:00Z</updated><content type="html">&lt;P&gt;One of the things I’ve learn over the last few years and what I find missing is the answer to the question of, “&lt;EM&gt;What’s the best approach to debugging a network issue?”.&lt;/EM&gt; After spending long hours in front of nasty networking issues I think the following are the steps is the best way to go about it.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;1.&amp;nbsp;Understand the System&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR&gt;This is probably the most important step to debugging an application. You should find out all the entities you are interacting with and how the communication takes place. Create a picture of what the application is trying to do. For networking problems, I find timeline diagrams to be very useful. &lt;/P&gt;
&lt;P&gt;In addition, network sniffing tools are a big help in helping you know whether your model of how the system works is how it actually works. In my mind, there are 3 parts to understanding the system – understand the client, understand the network, understand the server. These are 3 active entities performing operations and without all 3 of them working together, we have a non-functional system. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;2.&amp;nbsp;Check the Configuration Options&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR&gt;One of the most common reasons for failure of network applications is due to incorrect configuration. Incorrect configuration could happen at the client, the network and the server. The following lists possible mistakes in configuration that networking applications depend upon:&lt;/P&gt;
&lt;P&gt;The client:&lt;BR&gt;•&amp;nbsp;If you are using a Pocket PC or a Smartphone, make sure you have the connection manager settings setup correctly.&lt;BR&gt;•&amp;nbsp;Make sure the client clock is correct and matches the server clock.&lt;BR&gt;•&amp;nbsp;Make sure you have the required certificates installed on the device.&lt;/P&gt;
&lt;P&gt;The Network:&lt;BR&gt;•&amp;nbsp;Firewall Issues&lt;BR&gt;•&amp;nbsp;IPSec Issues&lt;BR&gt;•&amp;nbsp;Errors in routing tables (presumably this never happens).&lt;/P&gt;
&lt;P&gt;The Server:&lt;BR&gt;•&amp;nbsp;Incorrectly configured redirection&lt;BR&gt;•&amp;nbsp;Server application problems&lt;BR&gt;•&amp;nbsp;Incorrectly configured authentication settings&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;3.&amp;nbsp;Perform Sanity Checks &amp;amp; Isolate the Subsystem Causing the Problem&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR&gt;Sanity checks are typically simple programs that check the validity of your setup and configuration. This kind of debugging is approaching the problem from the opposite direction as that described in the next section. In this section, we start out with a bunch of small programs each of which tests the sanity of (ideally) exactly one subsystem. This way we could start out small verifying the functionality of small systems which we will then make into larger programs to verify larger and larger subsystems. In the next section, we go in the other direction by taking a large application and removing all components that are not necessary and still be able reproduce the problem. This step is typically better for cases where we get 100% reproducible failures. This typically is caused due to some incorrect configuration and is quickly identified by this step.&lt;/P&gt;
&lt;P&gt;A scenario for how this would be used is say the test that tests SSL fails and all other http tests pass, then the options for rectifying the problem would be:&lt;BR&gt;•&amp;nbsp;Check that the dll that provides the SSL services is present on the device. (This is typically not a problem for standard devices, and more of a problem for custom devices).&lt;BR&gt;•&amp;nbsp;Check that the entire chain of CA upto the root CA of the server you are connecting to is installed on the device.&lt;BR&gt;•&amp;nbsp;Check that the system clock shows the correct time.&lt;/P&gt;
&lt;P&gt;Examples of checking the underlying components on which your program is built might be trying to verify the following pieces of information:&lt;BR&gt;Does DNS work?&amp;nbsp;&lt;BR&gt;Does a simple socket application work?&amp;nbsp;&lt;BR&gt;Does a simple http application using a GET request work?&amp;nbsp;&lt;BR&gt;Does a simple http application using a POST request work?&amp;nbsp;&lt;BR&gt;Does the authentication subsystem work?&amp;nbsp;&lt;BR&gt;Does SSL work?&amp;nbsp;&lt;BR&gt;Am I going through a proxy and does that work?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;4.&amp;nbsp;Create a Repro Case&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR&gt;In order to debug any application, the very first step is to isolate the problem to the smallest portion of code that could be causing the problem. Networking problems are no different. Isolating the smallest piece of code that reproduces the problem might involve stripping your application down to the minimum code that still has the problem. In some cases this might not be possible and you might feel like it is not worth the effort doing this. But if the problem is not apparent, this might be the only recourse to figuring out what the problem is.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;5.&amp;nbsp;Check the RFCs/ MSDN Documentation / KB Articles/ Whitepapers/ Blogs/ Search Online&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR&gt;These are useful in general, but more specifically after you hit a problem and you’ve narrowed down the scope of the problem using the information in the previous two sections, this step can really help you to understand how to solve the problem if it’s a known issue. MSDN docs and RFCs might have some caveats hidden in the documentation for some of the APIs or protocols. If the documentation falls short of describing what *should* happen in the situation you have encountered, fallback to checking the frames of reference by seeing how a native application behaves on the same device or how an application built on .NET running on a desktop machine behaves. This will help you to identify correct behaviors or atleast verify that more than one piece of software behaves the same way.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;6.&amp;nbsp;Ask for Help&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;There are multiple avenues available for asking for help. &lt;BR&gt;•&amp;nbsp;If you have friends who are knowledgeable about the technology, it is probably easiest and quickest to ask them. Part of this, is posting on the newsgroups in the technology area of interest. (For instance, the .NET Compact Framework’s newsgroup can be found at &lt;A href="http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=33"&gt;http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=33&lt;/A&gt;)&lt;BR&gt;•&amp;nbsp;As a last resort contact the product support people in the organization.&lt;/P&gt;
&lt;P&gt;When asking for help make sure you include all or most of the information below. While developers experienced in the technology can spot known problems immediately, the availability of any information helps debugging a problem. Things that stand out that are of immediate benefit for some third party debugging your issue are the output of network packet capture tools. Information that could be of use is as follows.&lt;BR&gt;•&amp;nbsp;Network traces at the client, server and proxy.&lt;BR&gt;•&amp;nbsp;The set of experiments conducted and the information about whether each of them succeeded or failed.&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=483274" width="1" height="1"&gt;</content><author><name>Sandeep Prabhakar</name><uri>http://blogs.msdn.com/members/Sandeep+Prabhakar.aspx</uri></author></entry><entry><title>How does .NET Compact Framework determine which proxy to use?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sandeepp/archive/2005/10/20/ProxyDetectionLogic.aspx" /><id>http://blogs.msdn.com/sandeepp/archive/2005/10/20/ProxyDetectionLogic.aspx</id><published>2005-10-21T03:40:00Z</published><updated>2005-10-21T03:40:00Z</updated><content type="html">&lt;P&gt;This is&amp;nbsp;how .NET Compact Framework determines which proxy to go through while communicating with a server.&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;The order in which .NET Compact Framework (NETCF) searches for proxy information is:&lt;BR&gt;Step 1: It checks if the programmer has specified this in his program using GlobalProxySelection.Select.&lt;BR&gt;Step 2: If the program does not specify this, .NET Compact Framework uses the System’s webproxy. There are 2 pieces of information retrieved: the proxy’s address and whether Bypass on local address is turned on or not.&lt;/P&gt;
&lt;P&gt;The way Step 2 above is performed on Pocket PC and Smartphones differs from how its performed on plain windows CE devices. NETCF tries to obtain the System’s default Web proxy as follows:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;For Windows CE devices:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;First it tries to get it from Internet Explorer. If IE is not installed it gets it from Pocket Internet Explorer’s registry settings.&lt;/P&gt;
&lt;P&gt;There is this property called BypassProxyOnLocal which can be set in Internet Explorer and Pocket Internet Explorer, which bypasses the proxy if the site is considered local.&lt;BR&gt;If (BypassProxyOnLocal == false) &lt;BR&gt;&amp;nbsp;Requests are always sent through the proxy.&lt;BR&gt;If(BypassProxyOnLocal == true)&lt;BR&gt;&amp;nbsp;Requests that are considered non-local and sent through the proxy if the URLs contain a dot “.”. If the URL does not contain a dot, the request is sent directly to the server.&lt;/P&gt;
&lt;P&gt;If you are sending data to a server using the IPAddress of the server which contains a dot, the request would be sent through the proxy. To avoid sending the request through proxy, you can do one of the following:&lt;BR&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace the numerical IP address with the machine’s host name and set BypassProxyOnLocal to true. &lt;BR&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set GlobalProxySelection.Select to an empty proxy before issuing the request. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;For Pocket PC and Smartphones:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;NETCF obtains the System’s web proxy by calling into connection manager to request for the proxy information.&lt;BR&gt;&lt;FONT size=1&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=483265" width="1" height="1"&gt;</content><author><name>Sandeep Prabhakar</name><uri>http://blogs.msdn.com/members/Sandeep+Prabhakar.aspx</uri></author></entry><entry><title>Static Constructors</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sandeepp/archive/2005/10/04/static-constructors.aspx" /><id>http://blogs.msdn.com/sandeepp/archive/2005/10/04/static-constructors.aspx</id><published>2005-10-05T04:30:00Z</published><updated>2005-10-05T04:30:00Z</updated><content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;There are some things that cannot be done in .NET Compact Framework in a static constructor which are possible in the full .NET Framework. Basically, all static constructors when are executed in a serialized fashion in .NET Compact Framework V2 (Note that this design may change in future versions of the product). As a result, you can result in deadlocks if you are doing certain operations in the static constructors. Take the following program for example. Here, I have 2 threads. In the main thread, I execute a function in StaticClass1 - this calls implicitly the static ctor for StaticClass1. In this static ctor, we wait on an Event that gets set by the Static Ctor of StaticClass2 which gets executed on another thread. Since the execution of static ctors are serialized in the .NET Compact Framework's execution engine, the StaticClass1 will never signal the event and never finish. Also, StaticClass2's ctor cannot execute since we prevent both the StaticClass1's and StaticClass2's ctors from executing at the same time... deadlock is the result. This applies only to .NET Compact Framework and works fine on the .NET Framework.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt" 0pt? 0in MARGIN:&gt;using System;&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;using System.Threading;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;using System.Net;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;public class Test&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public static SyncContainer sc = new SyncContainer();&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public static StaticClass1 static1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;static void Main (string[] args) &lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Thread t = new Thread(new ThreadStart(ThreadProc));&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;t.Start();&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;static1 = new StaticClass1();&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;string str = static1.Func();&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public static void ThreadProc() &lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine("Executing ThreadProc");&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;StaticClass2.Func();&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine("After Executing ThreadProc");&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;public class StaticClass2&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;static StaticClass2()&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Test.sc.are.Set();&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public static string Func()&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;return "world";&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;public class StaticClass1&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;static StaticClass1()&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine("Executing Static Ctor");&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Test.sc.are.WaitOne();&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine("After WaitOne");&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public string Func()&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;return "hello";&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;public class SyncContainer&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public AutoResetEvent are = new AutoResetEvent(false);&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The solution to this problem if you have a similar situation is to&amp;nbsp;take the code from the static ctor and put it in a static property/method and call that before you call anything else on that class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;This situation was found when a Web Service call was made in the static ctor. And since internally in the .NET Compact Framework's Networking code we use this paradigm of setting events to signal completion of networking transfer completion, we result in this deadlock.&lt;/P&gt;
&lt;P&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=477413" width="1" height="1"&gt;</content><author><name>Sandeep Prabhakar</name><uri>http://blogs.msdn.com/members/Sandeep+Prabhakar.aspx</uri></author></entry><entry><title>Of Overloads and Difference in behavior between .NET and .NET Compact Framework</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sandeepp/archive/2005/09/26/Overloads.aspx" /><id>http://blogs.msdn.com/sandeepp/archive/2005/09/26/Overloads.aspx</id><published>2005-09-26T20:00:00Z</published><updated>2005-09-26T20:00:00Z</updated><content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;One interesting issue that came up recently and not very obvious at first sight is the following:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;We found a difference in behavior in .NET Compact Framework compared to the Full .NET Framework. Basically we found that calling the same function on .NET and .NET Compact Framework had a differing behavior. The reason this came to be was .NET had more overloads for the same function compared to .NET Compact Framework. So for example is .NET had overloads:&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Foo(int bar);&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Foo(object bar);&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;whereas .NET Compact Framework had only the overload:&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Foo(object bar);&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;This is pretty common since we try to subset the full .NET Framework to give most of the utility of the .NET with the least amount of code. However as this specific issue came about, we found that there can be subtle differences. &lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;When the code such as the one below was compiled:&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Main()&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;bool flag = true;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Foo(flag);&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;on .NET, this would call into the more specific function overload Foo(int) whereas since on .NET Compact Framework since we didn't have that overload would target Foo(object). In this case, any internal implementation differences between the 2 overloads would manifest itself as a difference in behavior between .NET and .NET Compact Framework.&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The definitive way to determine if this is the cause of the difference in behavior is using ildasm to view the IL generated code and seeing which overload is being called.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=474028" width="1" height="1"&gt;</content><author><name>Sandeep Prabhakar</name><uri>http://blogs.msdn.com/members/Sandeep+Prabhakar.aspx</uri></author></entry><entry><title>Hello World!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sandeepp/archive/2005/08/22/Sandeep.aspx" /><id>http://blogs.msdn.com/sandeepp/archive/2005/08/22/Sandeep.aspx</id><published>2005-08-23T03:10:00Z</published><updated>2005-08-23T03:10:00Z</updated><content type="html">&lt;P&gt;True to my geeky background, I'll meet the world using the cliche'd phrase... To introduce myself, I'm a software developer working on the .NET Compact Framework team (usually called the NETCF team in short). I've been on the team for 2 years and its been a fun experience. The best part of being in this team is you walk in every week knowing you're going to be doing something totally different (I can't recall doing the same thing on two different weeks). I did my undergrad in Chennai, India in Anna University and my grad school in Virginia Tech. For the time I've been on the NETCF team, I've poked around with Networking, Globalization, Generics, Localization&amp;nbsp;and other odds and ends as the requirements come up. If you have any feedback about these areas about stuff that doesn't work right or things that are missing&amp;nbsp;or just someone to curse for your problems (in these areas ;) ... no curses like the weather sucks in seattle etc etc) send them on to me.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=454856" width="1" height="1"&gt;</content><author><name>Sandeep Prabhakar</name><uri>http://blogs.msdn.com/members/Sandeep+Prabhakar.aspx</uri></author></entry></feed>