<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://code.msdn.microsoft.com/rss.xsl"?><rss version="2.0"><channel><title>sourceanalysis Forum Rss Feed</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/List.aspx</link><description>sourceanalysis Forum Rss Description</description><item><title>NEW POST: VB Version?</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=383</link><description>&lt;div class="wikidoc"&gt;
Seems to me like the VB version would only need one rule:&lt;br /&gt; &lt;br /&gt;if (language == &amp;quot;VB.NET&amp;quot;)&lt;br /&gt;{&lt;br /&gt;  DisplayWarning(&amp;quot;Use a real language like C#&amp;quot;);&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;I am (partially!) joking of course.  I'm sure there will be support in a future version.  That said however, VB usage in the industry is on a steady decline, so how much of a priority it should be getting is another question.  For example in a recent Telerik poll asking which langauge devs are primarily developing in, VB usage trailed in at just 30% compared to C# on nearly 70%.  Here's some facts to back this up:&lt;br /&gt; &lt;br /&gt;http://telerikwatch.com/2009/06/survey-says-c-still-more-popular-than.html&lt;br /&gt;http://www.google.com/trends?q=VB.NET%2C+C%23&amp;amp;ctab=0&amp;amp;geo=all&amp;amp;date=ytd&amp;amp;sort=0&lt;br /&gt;http://radar.oreilly.com/2009/02/state-of-the-computer-book-mar-22.html&lt;br /&gt;
&lt;/div&gt;</description><author>danieldsmith</author><pubDate>Mon, 23 Nov 2009 19:06:00 GMT</pubDate><guid isPermaLink="false">NEW POST: VB Version? 20091123P</guid></item><item><title>NEW POST: Hide StyleCop Warnings when running msbuild</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2582</link><description>&lt;div class="wikidoc"&gt;
Try setting StyleCopEnabled=false at the top of your .bat file.&lt;br /&gt;
&lt;/div&gt;</description><author>jasonall</author><pubDate>Thu, 19 Nov 2009 18:19:18 GMT</pubDate><guid isPermaLink="false">NEW POST: Hide StyleCop Warnings when running msbuild 20091119P</guid></item><item><title>NEW POST: VB Version?</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=383</link><description>&lt;div class="wikidoc"&gt;
(Sigh.) Much as we'd all like to believe the mighty Microsoft has unlimited resources, it just isn't true. Hey, I'd like to see a StyleCop for every language available on .NET, but I don't think we'll be seeing that anytime soon. Really folks, we have four options, not necessarily mutually exclusive:&lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Be patient while the folks at MS break down the technical barrier&lt;/li&gt;&lt;li&gt;Write the tool ourselves, perhaps adapting something that already exists&lt;/li&gt;&lt;li&gt;Improve our coding habits--is it really that hard to follow the conventions used by MS's code examples?&lt;/li&gt;&lt;li&gt;Learn a different language--no single language is best at everything; .NET gives you plenty to pick from&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;Regarding the last point, the days of being a monolingual, single-platform developer are over. Expand your horizons, and bring back what you've learned to your preferred language and platform.&lt;br /&gt;
&lt;/div&gt;</description><author>LeeB</author><pubDate>Thu, 19 Nov 2009 16:56:20 GMT</pubDate><guid isPermaLink="false">NEW POST: VB Version? 20091119P</guid></item><item><title>NEW POST: VS2010 Beta2?</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2458</link><description>&lt;div class="wikidoc"&gt;
Any update on when VS2010 support will be added?&lt;br /&gt;
&lt;/div&gt;</description><author>TATWORTH</author><pubDate>Thu, 19 Nov 2009 15:40:01 GMT</pubDate><guid isPermaLink="false">NEW POST: VS2010 Beta2? 20091119P</guid></item><item><title>NEW POST: Hide StyleCop Warnings when running msbuild</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2582</link><description>&lt;div class="wikidoc"&gt;
Hello.&lt;br /&gt; &lt;br /&gt;I have a .bat file that is compiling some targets projects using msbuild command and I use also style cop to verify my code rules. &lt;br /&gt;I want to hide the warnings that stylecop produces. I tried /consoleloggerparameters:ErrorsOnly;Verbosity=q with no luck. The only thing that did it is specifying /noconsolelogger but this one hides everything.&lt;br /&gt; &lt;br /&gt;Is this possible?&lt;br /&gt; &lt;br /&gt;Thanks,&lt;br /&gt;Eusebiu&lt;br /&gt;
&lt;/div&gt;</description><author>eusebiu</author><pubDate>Thu, 19 Nov 2009 08:57:34 GMT</pubDate><guid isPermaLink="false">NEW POST: Hide StyleCop Warnings when running msbuild 20091119A</guid></item><item><title>NEW POST: Cannot Suppress SA1002 and SA1009</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2347</link><description>&lt;div class="wikidoc"&gt;
I was having the same problem with SA1118 but managed to fix it.  I opened up the rules assembly in reflector and looked at the rules enumeration.  Turns out the rule name in the help file and the enumeration representing it don't always match 100%.  In this case, the enumeration was ParameterMustNotSpanMultipleLines versus the rule name of ParametersMustNotSpanMultipleLines.  Notice the extra &amp;quot;s&amp;quot; on &amp;quot;Parameter&amp;quot; in the rule name.  When i left out the &amp;quot;s&amp;quot; and just used the enumeration name it worked.  Looking a bit more, i can see the xml files for all the rules in the Resources folder in reflector (looking at Microsoft.StyleCop.CSharp.Rules.dll).  In the ReadabilityRules xml file, i see the same issue with it using the name without the &amp;quot;s&amp;quot; on &amp;quot;Parameter&amp;quot;.&lt;br /&gt;
&lt;/div&gt;</description><author>Tallek</author><pubDate>Wed, 18 Nov 2009 17:21:28 GMT</pubDate><guid isPermaLink="false">NEW POST: Cannot Suppress SA1002 and SA1009 20091118P</guid></item><item><title>NEW POST: SA1009 with type-casting parenthesis</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2489</link><description>&lt;div class="wikidoc"&gt;
&lt;div class="quote"&gt;
 &lt;br /&gt;jasonall wrote:&lt;br /&gt;The recommendation is to have no space after the cast. I'm not sure why you're getting the violatiohn on that line. Maybe if you include more of the code we can figure it out.&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt; &lt;br /&gt;Jason,&lt;br /&gt;Thanks for the answer.&lt;br /&gt; &lt;br /&gt;Actually, I have two questions:&lt;br /&gt;1. I am using reflection and getting SA1009 when using &amp;quot;typeof&amp;quot; and casting in one line. It seems to be a little bug. I don't get SA1009 when I don't use &amp;quot;typeof&amp;quot; or when I put space after cast and before &amp;quot;typeof&amp;quot;.&lt;br /&gt;2. What do you think about creating a rule that would prohibit putting a space after cast? I consider this as a &amp;quot;bad style&amp;quot;, but it's up to you to decide, of course.&lt;br /&gt; &lt;br /&gt;Here is the code example that illustrates them.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;using System;&lt;br /&gt;using System.Reflection;&lt;br /&gt; &lt;br /&gt;namespace Shuruev.StyleCop.Test&lt;br /&gt;{&lt;br /&gt;	/// &amp;lt;summary&amp;gt;&lt;br /&gt;	/// Some code that illustrates wrong SA1009 firing.&lt;br /&gt;	/// &amp;lt;/summary&amp;gt;&lt;br /&gt;	public static class Class1&lt;br /&gt;	{&lt;br /&gt;		public static readonly Uri TestUri = new Uri(&amp;quot;http://www.microsoft.com&amp;quot;);&lt;br /&gt; &lt;br /&gt;		/// &amp;lt;summary&amp;gt;&lt;br /&gt;		/// I assume there is some problem with &amp;quot;typeof&amp;quot; checking&lt;br /&gt;		/// because the first part of code produces SA1009 (seems it should not).&lt;br /&gt;		/// The second part (with space after cast) doesn't produce SA1009,&lt;br /&gt;		/// but I I really don't like this way of typing.&lt;br /&gt;		/// &amp;lt;/summary&amp;gt;&lt;br /&gt;		public static void Test1()&lt;br /&gt;		{&lt;br /&gt;			&lt;b&gt;string innerA = (string)typeof(Uri).InvokeMember(&lt;/b&gt;&lt;br /&gt;				&amp;quot;m_String&amp;quot;,&lt;br /&gt;				BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetField,&lt;br /&gt;				null,&lt;br /&gt;				TestUri,&lt;br /&gt;				null);&lt;br /&gt; &lt;br /&gt;			&lt;b&gt;string innerB = (string) typeof(Uri).InvokeMember(&lt;/b&gt;&lt;br /&gt;				&amp;quot;m_String&amp;quot;,&lt;br /&gt;				BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetField,&lt;br /&gt;				null,&lt;br /&gt;				TestUri,&lt;br /&gt;				null);&lt;br /&gt;		}&lt;br /&gt; &lt;br /&gt;		/// &amp;lt;summary&amp;gt;&lt;br /&gt;		/// Here both parts work fine and don't produce SA1009.&lt;br /&gt;		/// But I think it would be nice to create a new rule that would prohibit putting a space after cast.&lt;br /&gt;		/// &amp;lt;/summary&amp;gt;&lt;br /&gt;		public static void Test2()&lt;br /&gt;		{&lt;br /&gt;			&lt;b&gt;string innerA = (string)TestUri.GetType().InvokeMember(&lt;/b&gt;&lt;br /&gt;				&amp;quot;m_String&amp;quot;,&lt;br /&gt;				BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetField,&lt;br /&gt;				null,&lt;br /&gt;				TestUri,&lt;br /&gt;				null);&lt;br /&gt; &lt;br /&gt;			&lt;b&gt;string innerB = (string) TestUri.GetType().InvokeMember(&lt;/b&gt;&lt;br /&gt;				&amp;quot;m_String&amp;quot;,&lt;br /&gt;				BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetField,&lt;br /&gt;				null,&lt;br /&gt;				TestUri,&lt;br /&gt;				null);&lt;br /&gt;		}&lt;br /&gt; &lt;br /&gt;		/// &amp;lt;summary&amp;gt;&lt;br /&gt;		/// Here both parts work fine and don't produce SA1009.&lt;br /&gt;		/// But I think it would be nice to create a new rule that would prohibit putting a space after cast.&lt;br /&gt;		/// &amp;lt;/summary&amp;gt;&lt;br /&gt;		public static void Test3()&lt;br /&gt;		{&lt;br /&gt;			Type type = typeof(Uri);&lt;br /&gt; &lt;br /&gt;			&lt;b&gt;string innerA = (string)type.InvokeMember(&lt;/b&gt;&lt;br /&gt;				&amp;quot;m_String&amp;quot;,&lt;br /&gt;				BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetField,&lt;br /&gt;				null,&lt;br /&gt;				TestUri,&lt;br /&gt;				null);&lt;br /&gt; &lt;br /&gt;			&lt;b&gt;string innerB = (string) type.InvokeMember(&lt;/b&gt;&lt;br /&gt;				&amp;quot;m_String&amp;quot;,&lt;br /&gt;				BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetField,&lt;br /&gt;				null,&lt;br /&gt;				TestUri,&lt;br /&gt;				null);&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;Best regards,&lt;br /&gt;Oleg Shuruev&lt;br /&gt;
&lt;/div&gt;</description><author>shuruev</author><pubDate>Tue, 17 Nov 2009 10:02:03 GMT</pubDate><guid isPermaLink="false">NEW POST: SA1009 with type-casting parenthesis 20091117A</guid></item><item><title>NEW POST: Visual Web Developer</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2563</link><description>&lt;div class="wikidoc"&gt;
Thanks&lt;br /&gt;
&lt;/div&gt;</description><author>krappies</author><pubDate>Tue, 17 Nov 2009 09:42:11 GMT</pubDate><guid isPermaLink="false">NEW POST: Visual Web Developer 20091117A</guid></item><item><title>NEW POST: SA1009 with type-casting parenthesis</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2489</link><description>&lt;div class="wikidoc"&gt;
The recommendation is to have no space after the cast. I'm not sure why you're getting the violatiohn on that line. Maybe if you include more of the code we can figure it out.&lt;br /&gt; &lt;br /&gt;Jason&lt;br /&gt;
&lt;/div&gt;</description><author>jasonall</author><pubDate>Tue, 17 Nov 2009 08:40:31 GMT</pubDate><guid isPermaLink="false">NEW POST: SA1009 with type-casting parenthesis 20091117A</guid></item><item><title>NEW POST: Visual Web Developer</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2563</link><description>&lt;div class="wikidoc"&gt;
VWD does not allow loading external VS packages, which prevents StyleCop from integrating into the shell. You can still use StyleCop by setting up MSBuild integration, as described in this blog post: http://blogs.msdn.com/sourceanalysis/pages/source-analysis-msbuild-integration.aspx&lt;br /&gt;
&lt;/div&gt;</description><author>jasonall</author><pubDate>Mon, 16 Nov 2009 18:21:16 GMT</pubDate><guid isPermaLink="false">NEW POST: Visual Web Developer 20091116P</guid></item><item><title>NEW POST: Visual Web Developer</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2563</link><description>&lt;div class="wikidoc"&gt;
Hi&lt;br /&gt; &lt;br /&gt;Is there a way to use StyleCop with VWD 2008?  I cannot find a way to do this.&lt;br /&gt; &lt;br /&gt;Thanks,&lt;br /&gt;Pieter&lt;br /&gt;
&lt;/div&gt;</description><author>krappies</author><pubDate>Mon, 16 Nov 2009 16:24:43 GMT</pubDate><guid isPermaLink="false">NEW POST: Visual Web Developer 20091116P</guid></item><item><title>NEW POST: File Header Format</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=394</link><description>&lt;div class="wikidoc"&gt;
&lt;div class="quote"&gt;
 &lt;br /&gt;olivier34 wrote:&lt;br /&gt;It seems also that &lt;b&gt;special chars&lt;/b&gt; like the (c) from copyright do not work when set in the match expression...&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;A new issue has been posted: http://code.msdn.microsoft.com/sourceanalysis/WorkItem/View.aspx?WorkItemId=260&lt;br /&gt;
&lt;/div&gt;</description><author>olivier34</author><pubDate>Thu, 12 Nov 2009 12:48:27 GMT</pubDate><guid isPermaLink="false">NEW POST: File Header Format 20091112P</guid></item><item><title>NEW POST: how to disable some rules</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2535</link><description>&lt;div class="wikidoc"&gt;
I like most of rules, but in real practice, I would like to disable some of them. But I cannot find how to disable some rules. Can anyone give some help?&lt;br /&gt;
&lt;/div&gt;</description><author>lory</author><pubDate>Wed, 11 Nov 2009 12:58:33 GMT</pubDate><guid isPermaLink="false">NEW POST: how to disable some rules 20091111P</guid></item><item><title>NEW POST: Visual Studio 2010 &amp; .NET 4.0</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2512</link><description>&lt;div class="wikidoc"&gt;
I have solved problem. The issue is that the default C# MSBuild targets file generates and adds this file intermediatly to the project structure, so StyleCop will check this file. To avoid that StyleCop is checking this file simply import the StyleCop targets before the import of the C# default targets.&lt;br /&gt; &lt;br /&gt;Importing projects like this:&lt;br /&gt;&lt;b&gt;&lt;i&gt;&amp;lt;Import Project=&amp;quot;$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.3\Microsoft.StyleCop.targets&amp;quot;/&amp;gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&amp;lt;Import Project=&amp;quot;$(MSBuildBinPath)\Microsoft.CSharp.targets&amp;quot;/&amp;gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;rather then explained on http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2283&lt;br /&gt;&lt;i&gt;&amp;lt;Import Project=&amp;quot;$(MSBuildBinPath)\Microsoft.CSharp.targets&amp;quot;/&amp;gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;lt;Import Project=&amp;quot;$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.3\Microsoft.StyleCop.targets&amp;quot;/&amp;gt;&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;Hope this helps also others ...&lt;br /&gt;Marco Erni&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>MarcoErni</author><pubDate>Tue, 10 Nov 2009 10:06:24 GMT</pubDate><guid isPermaLink="false">NEW POST: Visual Studio 2010 &amp; .NET 4.0 20091110A</guid></item><item><title>NEW POST: Visual Studio 2010 &amp; .NET 4.0</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2512</link><description>&lt;div class="wikidoc"&gt;
Hi&lt;br /&gt; &lt;br /&gt;I have installed and integrated StyleCop into Visual Studio 2010, respectively into the C# projects as described in the following thread: http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2283&lt;br /&gt;It works just fine for Projects targeting .NET Framework 3.5 (or 3.0 &amp;amp; 2.0). But if the Project targets the .NET Framework 4.0, StyleCop fires allways the following two warnings:&lt;br /&gt; &lt;br /&gt;- SA1003: The spacing around the symbol '=' is invalid.&lt;br /&gt;- SA1633: The file has no header, the header Xml is invalid, or the header is not located at the top of the file.&lt;br /&gt; &lt;br /&gt;Both warnings are issued by the the file &amp;quot;..\Local Settings\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.cs&amp;quot;&lt;br /&gt;It seems that Visual Studio 2010 produces that file an intermediate link this file into the C# project while building the project inside Visual Stduio.&lt;br /&gt; &lt;br /&gt;Has anbody the same problem or better a solution for that issue?&lt;br /&gt; &lt;br /&gt;Best Regards,&lt;br /&gt;Marco Erni&lt;br /&gt;
&lt;/div&gt;</description><author>MarcoErni</author><pubDate>Fri, 06 Nov 2009 12:17:45 GMT</pubDate><guid isPermaLink="false">NEW POST: Visual Studio 2010 &amp; .NET 4.0 20091106P</guid></item><item><title>NEW POST: VB Version?</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=383</link><description>&lt;div class="wikidoc"&gt;
I agree. Where's the VB version? Apart from the similarity with Java I completely fail to see the fascination with C#. VB code is so much easier to read. I'd also put in an ad for a documentation tool like NDoc for VB comments.   &lt;br /&gt;
&lt;/div&gt;</description><author>sedge55</author><pubDate>Thu, 05 Nov 2009 23:04:06 GMT</pubDate><guid isPermaLink="false">NEW POST: VB Version? 20091105P</guid></item><item><title>NEW POST: Installing StyleCop in w Team enviroment</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2497</link><description>&lt;div class="wikidoc"&gt;
Uh, what?&lt;br /&gt; &lt;br /&gt;I'm afraid I don't understand your question.&lt;br /&gt; &lt;br /&gt;If you're hand-editing a .csproj file, something has gone terribly wrong.&lt;br /&gt;
&lt;/div&gt;</description><author>Task</author><pubDate>Thu, 05 Nov 2009 14:10:11 GMT</pubDate><guid isPermaLink="false">NEW POST: Installing StyleCop in w Team enviroment 20091105P</guid></item><item><title>NEW POST: SuppressMessage not working for certain rules??</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2315</link><description>&lt;div class="wikidoc"&gt;
Hi!&lt;br /&gt; &lt;br /&gt;I do think that as StyleCop SuppressMessage must be set on an element, some rules, that applies to the whole file, can't be excluded this way.&lt;br /&gt; &lt;br /&gt;Regards,&lt;br /&gt; &lt;br /&gt;Olivier.&lt;br /&gt;
&lt;/div&gt;</description><author>olivier34</author><pubDate>Thu, 05 Nov 2009 13:00:38 GMT</pubDate><guid isPermaLink="false">NEW POST: SuppressMessage not working for certain rules?? 20091105P</guid></item><item><title>NEW POST: Installing StyleCop in w Team enviroment</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2497</link><description>&lt;div class="wikidoc"&gt;
Thanks very much Task.&lt;br /&gt; &lt;br /&gt;Do you need to add any import statements or the like into project files?&lt;br /&gt; &lt;br /&gt;Thank you!&lt;br /&gt;
&lt;/div&gt;</description><author>Tokyoant</author><pubDate>Wed, 04 Nov 2009 22:55:03 GMT</pubDate><guid isPermaLink="false">NEW POST: Installing StyleCop in w Team enviroment 20091104P</guid></item><item><title>NEW POST: SuppressMessage not working for certain rules??</title><link>http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=2315</link><description>&lt;div class="wikidoc"&gt;
 &lt;br /&gt;&lt;div class="quote"&gt;
 &lt;br /&gt;jestersoftware wrote:&lt;br /&gt;... any ideas? Am I placing the attribute wrong?&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt; &lt;br /&gt;Could be.&lt;br /&gt; &lt;br /&gt;He-he, show us yer code!&lt;br /&gt;
&lt;/div&gt;</description><author>Task</author><pubDate>Wed, 04 Nov 2009 20:14:28 GMT</pubDate><guid isPermaLink="false">NEW POST: SuppressMessage not working for certain rules?? 20091104P</guid></item></channel></rss>