<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Programming tidbits: store &amp; retrieve : Visual Studio</title><link>http://blogs.msdn.com/oanapl/archive/tags/Visual+Studio/default.aspx</link><description>Tags: Visual Studio</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>.NET Framework 4.0 implements WS-Discovery</title><link>http://blogs.msdn.com/oanapl/archive/2009/06/11/net-framework-4-0-implements-ws-discovery.aspx</link><pubDate>Fri, 12 Jun 2009 00:52:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9727941</guid><dc:creator>OanaPlaton</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/oanapl/comments/9727941.aspx</comments><wfw:commentRss>http://blogs.msdn.com/oanapl/commentrss.aspx?PostID=9727941</wfw:commentRss><description>&lt;p&gt;The &lt;a href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx"&gt;.NET Framework 4.0 and Visual Studio 2010 Beta 1&lt;/a&gt; are live. If you haven’t tried the bits, do so and give the team &lt;a href="http://go.microsoft.com/fwlink/?LinkID=151484"&gt;feedback&lt;/a&gt;. There are some very cool features added – just take a look at the &lt;a href="http://msdn.microsoft.com/en-us/library/dd409230(VS.100).aspx"&gt;highlights&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;On the Communications front, Windows Communication Foundation has 3 major new features: support for WS-Discovery, standard endpoints (pre-defined endpoints with some of the properties fixed) and workflow services (messaging activities make the implementation of workflows very easy). &lt;/p&gt;  &lt;p&gt;I am really excited with the support for the &lt;a href="http://docs.oasis-open.org/ws-dd/discovery/1.1/cs-01/wsdd-discovery-1.1-spec-cs-01.pdf"&gt;WS-Discovery protocol&lt;/a&gt;. From the msdn documentation:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;“The Service Discovery feature enables client applications to dynamically discover service addresses at run time in an interoperable way using WS-Discovery. The WS-Discovery specification outlines the message-exchange patterns (MEPs) required for performing lightweight discovery of services, both by multicast (ad hoc) and unicast (using a network resource).”&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;To learn more about Discovery, take a at the &lt;a href="http://msdn.microsoft.com/en-us/library/dd483326%28VS.100%29.aspx"&gt;Discovery MSDN SDK samples&lt;/a&gt;. Plus, the Discovery team is blogging, so go to the &lt;a href="http://blogs.msdn.com/discovery/"&gt;Discovery team’s blog&lt;/a&gt;. Or start with the &lt;a href="http://channel9.msdn.com/shows/Endpoint/endpointtv-Service-Discovery-with-WCF/"&gt;Channel9 Discovery video&lt;/a&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a title="Service Discovery with WCF" href="http://channel9.msdn.com/shows/Endpoint/endpointtv-Service-Discovery-with-WCF/"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/oanapl/WindowsLiveWriter/NETFramework4.0implementsWSDiscovery_D13F/image_3.png" width="244" height="214" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9727941" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/oanapl/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/oanapl/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/oanapl/archive/tags/WS-Discovery/default.aspx">WS-Discovery</category></item><item><title>Performance Comparison: Regex versus string operations</title><link>http://blogs.msdn.com/oanapl/archive/2009/04/04/performance-comparison-regex-versus-string-operations.aspx</link><pubDate>Sat, 04 Apr 2009 23:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9531533</guid><dc:creator>OanaPlaton</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/oanapl/comments/9531533.aspx</comments><wfw:commentRss>http://blogs.msdn.com/oanapl/commentrss.aspx?PostID=9531533</wfw:commentRss><description>&lt;P&gt;I consider &lt;A href="http://www.regular-expressions.info/" mce_href="http://www.regular-expressions.info/"&gt;regular expressions&lt;/A&gt; one of the most useful features ever. I use them a lot, not only when coding, but also when editing files and instead of copy and paste. I find the Visual Studio Find/Replace feature with regular expressions really useful as well. In case you are not familiar with it, you can use regular expressions to find and replace characters like this:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/oanapl/WindowsLiveWriter/PerformanceComparisonRegexversusstringco_B123/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/oanapl/WindowsLiveWriter/PerformanceComparisonRegexversusstringco_B123/image_4.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=282 alt=image src="http://blogs.msdn.com/blogfiles/oanapl/WindowsLiveWriter/PerformanceComparisonRegexversusstringco_B123/image_thumb_1.png" width=290 border=0 mce_src="http://blogs.msdn.com/blogfiles/oanapl/WindowsLiveWriter/PerformanceComparisonRegexversusstringco_B123/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;In the picture, I used the expression &lt;STRONG&gt;{[^;]+}; &lt;/STRONG&gt;- meaning tag the string formed by any characters until ";" (at least one character) and replace the matching text with "// " followed by the tagged expression, forgetting the last ";". There are a lot of tutorials about regular expressions. I just learned the basics, and now I just try, fail, undo, and try again until I get it right.&lt;/P&gt;
&lt;P&gt;Moving back to coding, &lt;A href="http://msdn.microsoft.com/en-us/library/hs600312(VS.71).aspx" mce_href="http://msdn.microsoft.com/en-us/library/hs600312(VS.71).aspx"&gt;.NET has great support for regular expressions&lt;/A&gt;. The classes are relatively easy to use (though at the beginning I had to play a while to find out how to capture strings in one match and other more advanced features). The biggest advantages I find in using Regex are that it makes parsing input very easy (once you have the regular expression in place) and it makes it much harder to introduce bugs - less code has by definition fewer bugs, and parsing with regular expressions requires less code than the traditional method of parsing strings with different string methods like get substring at different indexes, check that is starts or ends with certain characters etc. &lt;/P&gt;
&lt;P&gt;However, there are cases when the string concatenation and parsing is better than the regular expressions: when the checks are done on a path that is executed a lot (a hot path), and that has strict performance requirements. Why? The regular expressions are slower than string concatenation. &lt;/P&gt;
&lt;P&gt;I did a simple experiment and measured the time needed by regex and strings to perform the same operations. I considered I need to keep data about persons in the format "Firstname:Oana Lastname:Platon Money:2183 UniqueIdentifier:fwsjfjehfjkwh8r378". I have defined a constant that represents this format, and I'll use it to serialize the person data.&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto; mso-border-shadow: yes"&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;const&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; nameFormat = &lt;SPAN style="COLOR: #a31515"&gt;"Firstname:{0} Lastname:{1} Money:{2} UniqueIdentifier:{3}"&lt;/SPAN&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;The data must be serialized and deserialized a lot of times (lets say that we need to send the data on the wire frequently or something like that). When deserializing the data, we need to make sure that it respects the pattern and then we need to extract the firstname, lastname etc.&lt;/P&gt;
&lt;P&gt;1. Using &lt;A href="http://msdn.microsoft.com/en-us/library/30wbz966(VS.71).aspx" mce_href="http://msdn.microsoft.com/en-us/library/30wbz966(VS.71).aspx"&gt;regular expressions&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I defined a regular expression like this:&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto; mso-border-shadow: yes"&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Regex&lt;/SPAN&gt; regex = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Regex&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #a31515"&gt;"^Firstname:(\\w+)\\sLastname:(\\w+)\\sMoney:(\\d{1,9})\\sUniqueIdentifier:([\\w-]+)$"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #2b91af"&gt;RegexOptions&lt;/SPAN&gt;.IgnoreCase | &lt;SPAN style="COLOR: #2b91af"&gt;RegexOptions&lt;/SPAN&gt;.Compiled);&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;Then, the code to parse the expressions and get the desired data is:&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto; mso-border-shadow: yes"&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ParseWithRegex(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; description)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Match&lt;/SPAN&gt; m = regex.Match(description);&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (!m.Success)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;throw&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ArgumentException&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #a31515"&gt;"description doesn't follow the expected format"&lt;/SPAN&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.firstname = m.Groups[1].Value;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.lastname = m.Groups[2].Value;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (!&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt;.TryParse(m.Groups[3].Value, &lt;SPAN style="COLOR: blue"&gt;out&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.age))&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;throw&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ArgumentException&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #a31515"&gt;"age doesn't have the correct value"&lt;/SPAN&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.uniqueIdentifier = m.Groups[4].Value;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;2. Using string operations &lt;/P&gt;
&lt;P&gt;The verification that the&amp;nbsp;given string respects the format becomes more difficult. In our case, the patters is pretty simple, but imagine that we&amp;nbsp;needed to check an email address or something more complicated. In that case, the code would have had a lot of cases, to follow all possible solutions. &lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto; mso-border-shadow: yes"&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ParseWithStrings(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; description)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;[] parts = description.Split(&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;char&lt;/SPAN&gt;[] { &lt;SPAN style="COLOR: #a31515"&gt;' '&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #a31515"&gt;'\t'&lt;/SPAN&gt; });&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (parts.Length != 4)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;throw&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ArgumentException&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #a31515"&gt;"description doesn't follow the expected pattern"&lt;/SPAN&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.firstname = parts[0].Substring(parts[0].IndexOf(&lt;SPAN style="COLOR: #a31515"&gt;":"&lt;/SPAN&gt;) + 1);&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.lastname = parts[1].Substring(parts[1].IndexOf(&lt;SPAN style="COLOR: #a31515"&gt;":"&lt;/SPAN&gt;) + 1);&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (!&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt;.TryParse(parts[2].Substring(parts[2].IndexOf(&lt;SPAN style="COLOR: #a31515"&gt;":"&lt;/SPAN&gt;) + 1), &lt;SPAN style="COLOR: blue"&gt;out&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.age))&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;throw&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ArgumentException&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #a31515"&gt;"age doesn't have the correct value"&lt;/SPAN&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.uniqueIdentifier = parts[3].Substring(parts[3].IndexOf(&lt;SPAN style="COLOR: #a31515"&gt;":"&lt;/SPAN&gt;) + 1); ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;}&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;See that this is much more error prone than the previous code, because it needs to look at a lot of indexes and to substract the desired part of the string.&lt;/P&gt;
&lt;P&gt;However, when I run the 2 methods in a loop and I measure how long they take with a stopwatch (from System.Diagnostics namespace), I get these results:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/oanapl/WindowsLiveWriter/PerformanceComparisonRegexversusstringco_B123/image_8.png" mce_href="http://blogs.msdn.com/blogfiles/oanapl/WindowsLiveWriter/PerformanceComparisonRegexversusstringco_B123/image_8.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=260 alt=image src="http://blogs.msdn.com/blogfiles/oanapl/WindowsLiveWriter/PerformanceComparisonRegexversusstringco_B123/image_thumb_3.png" width=374 border=0 mce_src="http://blogs.msdn.com/blogfiles/oanapl/WindowsLiveWriter/PerformanceComparisonRegexversusstringco_B123/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;In conclusion, when choosing between using traditional string parsing or regular expressions, I would recommend:&lt;/P&gt;
&lt;P&gt;- Start with regular expressions; if the path is not a hot path and doesn't have any strict performance requirements, this is the best choice, since it makes the code easier to read and maintain.&lt;/P&gt;
&lt;P&gt;- If the performance goals are not reached (which means you have performance goals and you measured the performance!), try to improve your regular expressions. For example, adding ^ and $ (to specify that the pattern you are looking for is at the beginning or at the end of the string) when appropriate can improve the performance a lot. Also, make sure you use compiled expressions (if possible).&lt;/P&gt;
&lt;P&gt;- If you are still not in graphic, replace the regular expressions with string concatenation and parsing.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9531533" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/oanapl/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/oanapl/archive/tags/Performance/default.aspx">Performance</category><category domain="http://blogs.msdn.com/oanapl/archive/tags/C_2300_/default.aspx">C#</category></item><item><title>Visual Studio Templates – Add New Item to project</title><link>http://blogs.msdn.com/oanapl/archive/2009/03/06/visual-studio-templates-add-new-item-to-project.aspx</link><pubDate>Fri, 06 Mar 2009 05:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9461322</guid><dc:creator>OanaPlaton</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/oanapl/comments/9461322.aspx</comments><wfw:commentRss>http://blogs.msdn.com/oanapl/commentrss.aspx?PostID=9461322</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;FONT face=Calibri size=3&gt;Using Visual Studio to write code requires creating a project (well, you can use Visual Studio without a project, but you won’t get very much past Notepad functionality – there’s not even Intellisense on files) . After creating / opening an existing project, we can add new files (classes, class diagrams, XML files etc) by selecting the &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;Project&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; menu, then &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;Add New Item&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; (or add Class / Windows Forms / Windows Component or User Control, if this is what you need). After you specify all the details (file name), a file is added with some default text in it. Assuming you have Visual Studio 2008 SP1 installed, the templates that generate this text are stored at &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;and &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplatesCache&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; (for x64 machines, look in &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;% ProgramFiles(x86)%&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;). &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;FONT face=Calibri size=3&gt;Let’s add a new C# class, &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;Tester&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;, to the class library project &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;SimpleTests&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;. By default, in Visual Studio 2008 it will contain the following text:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto; mso-border-shadow: yes"&gt;
&lt;P class=Ccode style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Collections.Generic;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Linq;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Text;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Ccode style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;namespace&lt;/SPAN&gt; SimpleTests&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Courier New"&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Tester&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;FONT face=Calibri size=3&gt;This text comes from the Class template. If we look in the &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;ProjectTemplateCache&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; folder, inside &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;CSharp&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; (the language we used to add the class) -&amp;gt; &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;Code&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; -&amp;gt; &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;1033&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; -&amp;gt; &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;Class.zip&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;, we find a class.cs looking like this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto; mso-border-shadow: yes"&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Collections.Generic;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;$&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt;$ ($targetframeworkversion$ == 3.5)&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Linq;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;$endif$&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Text;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;namespace&lt;/SPAN&gt; $rootnamespace$&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; $safeitemrootname$&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;FONT face=Calibri size=3&gt;This explains the text we get. But how can we customize the default? I really would appreciate some changes:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-layout-grid-align: none; mso-add-space: auto"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;-&lt;/FONT&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;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;I don’t want all these usings added by default – I prefer to start without any using statement, and to add them while the code requires them. Of course, I could do it the other way around: add all the usings I think I may need; when I am done coding, remove the unused ones. Visual Studio lets you do that easily by right clicking on the page, selecting &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;Organize Usings&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; -&amp;gt; &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;Remove Unused Usings&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; (or &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;Remove and Sort&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;). &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo1; mso-layout-grid-align: none; mso-add-space: auto"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;-&lt;/FONT&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;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Second, I prefer Usings inside the namespace declaration and I want to add a header to the file.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;FONT face=Calibri size=3&gt;I can change the Class.cs file and replace the Class.zip in &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;ProjectTemplatesCache&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; folder:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto; mso-border-shadow: yes"&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;//------------------------------------------------------------&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;// Copyright (c) Oana Platon&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;//------------------------------------------------------------&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;namespace&lt;/SPAN&gt; $rootnamespace$&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; $safeitemrootname$&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;FONT face=Calibri size=3&gt;Then when I reopen Visual Studio and Add a class, I get this file:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto; mso-border-shadow: yes"&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;//------------------------------------------------------------&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;// Copyright (c) Oana Platon&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;//------------------------------------------------------------&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;namespace&lt;/SPAN&gt; SimpleTests&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;MyCustomizedTester&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Ccode style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-shading: white; mso-shading-themecolor: background1; mso-pattern: gray-5 auto"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;FONT face=Calibri size=3&gt;Cool, right?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;This change will be lost the first time when &lt;SPAN class=Command&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN"&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;devenv /installvstemplates&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN; mso-bidi-font-weight: bold"&gt; command is called (this command replaces the &lt;/SPAN&gt;&lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;ItemTemplatesCache&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-ansi-language: EN; mso-bidi-font-weight: bold"&gt; &lt;SPAN lang=EN&gt;folder with what finds in &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;ItemTemplates&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-ansi-language: EN; mso-bidi-font-weight: bold"&gt; &lt;SPAN lang=EN&gt;folder). To make it permanent, make the change in &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;ItemTemplates &lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN; mso-bidi-font-weight: bold"&gt;folder instead and run &lt;/SPAN&gt;&lt;SPAN class=Command&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN"&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;devenv /installvstemplates&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN; mso-bidi-font-weight: bold"&gt; to propagate the change to &lt;/SPAN&gt;&lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;ItemTemplatesCache&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN; mso-bidi-font-weight: bold"&gt;.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9461322" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/oanapl/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>The Beauty of Visual Studio Immediate Window</title><link>http://blogs.msdn.com/oanapl/archive/2008/08/23/the-beauty-of-visual-studio-immediate-window.aspx</link><pubDate>Sun, 24 Aug 2008 00:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8890789</guid><dc:creator>OanaPlaton</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/oanapl/comments/8890789.aspx</comments><wfw:commentRss>http://blogs.msdn.com/oanapl/commentrss.aspx?PostID=8890789</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;The Visual Studio Immediate Window is a great tool to increase your productivity. A lot of people are not aware that you can test functions in your program without writing any code by using this little tool. Look in the &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/f177hahy.aspx"&gt;&lt;FONT face=Calibri color=#800080 size=3&gt;msdn entry for Immediate Window&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; for more information. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Here is an example on how I use it. I have a small function I want to test, and I don’t want to add any testing code for it. Don’t do that for production code, it works great for prototypes only. I start debugging: from the Debug menu-&amp;gt;Start Debugging (F5) if you have some breakpoints defined or the best way is with Debug-&amp;gt;Step Over (F10), that stops on the first line of Main.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;To bring my immediate window, I usually start the &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/c785s0kz.aspx"&gt;&lt;FONT face=Calibri color=#800080 size=3&gt;Command Window&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; (shortcut Ctrl+Alt+A by default, or go to View-&amp;gt;Other Windows-&amp;gt;Command Window). In the Command Window, I type &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;immed&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; – which brings the immediate window. Now I start calling my function. And I have IntelliSense and everything I need!&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;IMG title="Immediate Window - IntelliSense" style="WIDTH: 785px; HEIGHT: 685px" height=685 alt="Immediate Window - IntelliSense" src="http://blogs.msdn.com/photos/oanapl/images/8890784/original.aspx" width=785 mce_src="http://blogs.msdn.com/photos/oanapl/images/8890784/original.aspx"&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;Here are the results:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;IMG title="Immediate Window - function calls results" style="WIDTH: 785px; HEIGHT: 685px" height=685 alt="Immediate Window - function calls results" src="http://blogs.msdn.com/photos/oanapl/images/8890785/original.aspx" width=785 mce_src="http://blogs.msdn.com/photos/oanapl/images/8890785/original.aspx"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8890789" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/oanapl/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>Visual Studio 2008: Missing items from toolbox</title><link>http://blogs.msdn.com/oanapl/archive/2008/06/08/visual-studio-2008-missing-items-from-toolbox.aspx</link><pubDate>Sun, 08 Jun 2008 23:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8581906</guid><dc:creator>OanaPlaton</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/oanapl/comments/8581906.aspx</comments><wfw:commentRss>http://blogs.msdn.com/oanapl/commentrss.aspx?PostID=8581906</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;A couple of days ago I reinstalled VS 2008 RTM version and I happily tried to create a website. Unfortunately, my productivity was totally ruined ‘cause most of the toolbox items were missing. To be exact, I only had the HTML tab.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Here are the steps to get your items back. Navigate to C:\Users\&amp;lt;username&amp;gt;\AppData\Local\Microsoft\VisualStudio\9.0 (on Vista or Longhorn) or “C:\Documents and Settings\&amp;lt;username&amp;gt;\Local Settings\Application Data\Microsoft\VisualStudio\9.0” (older Windows versions) from a command prompt or in explorer (you may need to configure explorer to show hidden folders: Tools -&amp;gt; Folder Options -&amp;gt; View -&amp;gt; check Show hidden files and folders). Here, just delete these files:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&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;FONT size=3&gt;·&lt;/FONT&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;&lt;FONT face=Calibri size=3&gt;toolbox.tbd&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&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;FONT size=3&gt;·&lt;/FONT&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;&lt;FONT face=Calibri size=3&gt;toolboxIndex.tbd&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&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;FONT size=3&gt;·&lt;/FONT&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;&lt;FONT face=Calibri size=3&gt;toolbox_reset.tbd&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&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;FONT size=3&gt;·&lt;/FONT&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;&lt;FONT face=Calibri size=3&gt;toolboxIndex_reset.tbd&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Then restart VS 2008 and the toolbox should look normal again. Same steps apply to VS 2005 (just replace 8.0 with 9.0 in the path)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;If you still have problems, try the following:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;-&lt;/FONT&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;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Check that the .NET Framework is properly installed. You could use&amp;nbsp;the script at &lt;A class="" title=".Net Framework 3.5 Installation validation tool" href="http://blogs.msdn.com/aaronru/archive/2007/11/29/net-framework-3-5-installation-validation-tool.aspx" target=_blank mce_href="http://blogs.msdn.com/aaronru/archive/2007/11/29/net-framework-3-5-installation-validation-tool.aspx"&gt;.NET Framework 3.5 Installation validation tool&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;-&lt;/FONT&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;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Try restoring the IDE's default settings: from the folder where VS 2008 is installed (eg. %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE), run &lt;SPAN class=Command&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;devenv.exe /ResetSettings&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;. You can also specify a VSSettings file to restore settings from.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;-&lt;/FONT&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;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;To clears all SkipLoading tags added to VSPackages, run &lt;STRONG&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;devenv.exe /ResetSkipPkgs&lt;/FONT&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;-&lt;/FONT&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;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Launches the IDE in safe mode loading minimal windows: &lt;STRONG&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;FONT color=#984806&gt;devenv.exe /SafeMode&lt;/FONT&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;If your controls are grayed out, you might want to check your mouse.&amp;nbsp;&lt;A class="" href="http://www.west-wind.net/WebLog/posts/279041.aspx" mce_href="http://www.west-wind.net/WebLog/posts/279041.aspx"&gt;This post&lt;/A&gt;&lt;/FONT&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;shows the effects of a weird interaction between some wireless mice drivers and the idle timing that ASP.NET designer relies on.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8581906" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/oanapl/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item></channel></rss>