<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Running FxCop rules against Silverlight or WPF XAML</title>
	<atom:link href="http://michaelshim.com/blog/2009/11/23/running-fxcop-rules-against-silverlight-xaml/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaelshim.com/blog/2009/11/23/running-fxcop-rules-against-silverlight-xaml/</link>
	<description>XAML, WPF &#38; Silverlight</description>
	<lastBuildDate>Fri, 07 May 2010 16:52:53 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Michael Shim</title>
		<link>http://michaelshim.com/blog/2009/11/23/running-fxcop-rules-against-silverlight-xaml/comment-page-1/#comment-187</link>
		<dc:creator>Michael Shim</dc:creator>
		<pubDate>Fri, 07 May 2010 16:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshim.com/blog/?p=29#comment-187</guid>
		<description>It&#039;s in Microsxoft.Xaml.Tools.XamlDom.   Here&#039;s a simple sample where we check to see if a property is set more than once:

&lt;code&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xaml.Tools.XamlDom;
using System.Xaml;
using Microsoft.FxCop.Sdk;

namespace Microsoft.Xaml.Tools.FxCop.Rules
{
    public class PropertiesCanOnlyBeSetOnce : BaseXamlRule
    {
        public PropertiesCanOnlyBeSetOnce() : base(&quot;PropertiesCanOnlyBeSetOnce&quot;) { }

        public override void CheckXaml(XamlDomObject rootObjectNode, System.Xaml.XamlSchemaContext schemaContext, string resourceName)
        {
            foreach (XamlDomObject objectNode in rootObjectNode.DescendantsAndSelf())
            {
                List&lt;XamlMember&gt; membersSet = new List&lt;XamlMember&gt;();
                foreach (XamlDomMember memberNode in objectNode.MemberNodes)
                {
                    if (!membersSet.Contains(memberNode.Member))
                    {
                        membersSet.Add(memberNode.Member);
                    }
                    else
                    {
                        Problems.Add(CreateProblem(GetResolution(memberNode.Member.Name), memberNode.Member.Name, memberNode, resourceName));
                    }
                }
            }
        }
    }
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>It&#8217;s in Microsxoft.Xaml.Tools.XamlDom.   Here&#8217;s a simple sample where we check to see if a property is set more than once:</p>
<p><code><br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Text;<br />
using Microsoft.Xaml.Tools.XamlDom;<br />
using System.Xaml;<br />
using Microsoft.FxCop.Sdk;</p>
<p>namespace Microsoft.Xaml.Tools.FxCop.Rules<br />
{<br />
    public class PropertiesCanOnlyBeSetOnce : BaseXamlRule<br />
    {<br />
        public PropertiesCanOnlyBeSetOnce() : base("PropertiesCanOnlyBeSetOnce") { }</p>
<p>        public override void CheckXaml(XamlDomObject rootObjectNode, System.Xaml.XamlSchemaContext schemaContext, string resourceName)<br />
        {<br />
            foreach (XamlDomObject objectNode in rootObjectNode.DescendantsAndSelf())<br />
            {<br />
                List<xamlmember> membersSet = new List</xamlmember><xamlmember>();<br />
                foreach (XamlDomMember memberNode in objectNode.MemberNodes)<br />
                {<br />
                    if (!membersSet.Contains(memberNode.Member))<br />
                    {<br />
                        membersSet.Add(memberNode.Member);<br />
                    }<br />
                    else<br />
                    {<br />
                        Problems.Add(CreateProblem(GetResolution(memberNode.Member.Name), memberNode.Member.Name, memberNode, resourceName));<br />
                    }<br />
                }<br />
            }<br />
        }<br />
    }<br />
}<br />
</xamlmember></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Parixit Pandey</title>
		<link>http://michaelshim.com/blog/2009/11/23/running-fxcop-rules-against-silverlight-xaml/comment-page-1/#comment-181</link>
		<dc:creator>Parixit Pandey</dc:creator>
		<pubDate>Thu, 06 May 2010 08:04:38 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshim.com/blog/?p=29#comment-181</guid>
		<description>Hi Michael,

Now I am able to add XAML Toolkit Rules in FxCop 1.36 and even able to run the silverlight Application against it. But After running the application Not getting any error.

In case I want to write my own custom rules for XMAL what steps I have to follow. Could I get any sample code snippets. 
Already I had added following code 
 public abstract class BaseXamlRule : BaseIntrospectionRule
    {
        public abstract void CheckXaml(XamlDomObject rootObjectNode,
                      XamlSchemaContext schemaContext,
                      string resourceName)
        {

        }
    }

for XamlSchemaContext added System.XMAL Namespace but still I am not able to get XamlDomObject Class. What namespace  I have to add for it ?

Please Provide sample code snippets writing XMAL rules.

Thanks, 
Parixit Pandey</description>
		<content:encoded><![CDATA[<p>Hi Michael,</p>
<p>Now I am able to add XAML Toolkit Rules in FxCop 1.36 and even able to run the silverlight Application against it. But After running the application Not getting any error.</p>
<p>In case I want to write my own custom rules for XMAL what steps I have to follow. Could I get any sample code snippets.<br />
Already I had added following code<br />
 public abstract class BaseXamlRule : BaseIntrospectionRule<br />
    {<br />
        public abstract void CheckXaml(XamlDomObject rootObjectNode,<br />
                      XamlSchemaContext schemaContext,<br />
                      string resourceName)<br />
        {</p>
<p>        }<br />
    }</p>
<p>for XamlSchemaContext added System.XMAL Namespace but still I am not able to get XamlDomObject Class. What namespace  I have to add for it ?</p>
<p>Please Provide sample code snippets writing XMAL rules.</p>
<p>Thanks,<br />
Parixit Pandey</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Shim</title>
		<link>http://michaelshim.com/blog/2009/11/23/running-fxcop-rules-against-silverlight-xaml/comment-page-1/#comment-169</link>
		<dc:creator>Michael Shim</dc:creator>
		<pubDate>Tue, 04 May 2010 04:15:30 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshim.com/blog/?p=29#comment-169</guid>
		<description>We&#039;re currently working on getting a build of the Xaml Toolkit that works well against VS2010 RTM &amp; FxCop 10.  We&#039;ll update you when we fix this.</description>
		<content:encoded><![CDATA[<p>We&#8217;re currently working on getting a build of the Xaml Toolkit that works well against VS2010 RTM &#038; FxCop 10.  We&#8217;ll update you when we fix this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Parixit Pandey</title>
		<link>http://michaelshim.com/blog/2009/11/23/running-fxcop-rules-against-silverlight-xaml/comment-page-1/#comment-136</link>
		<dc:creator>Parixit Pandey</dc:creator>
		<pubDate>Fri, 23 Apr 2010 10:51:06 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshim.com/blog/?p=29#comment-136</guid>
		<description>Hi Michael,

In my Machine I had Installed VS2010 Ultimate edition. even I had Installed FxCop 1.36 and Downloaded XAML Toolkit Rules. in Fxcop FxCop.exe.config file changed VS2010 Version But when I am trying to add rules in Fxcorp it giving error rules are not valid.</description>
		<content:encoded><![CDATA[<p>Hi Michael,</p>
<p>In my Machine I had Installed VS2010 Ultimate edition. even I had Installed FxCop 1.36 and Downloaded XAML Toolkit Rules. in Fxcop FxCop.exe.config file changed VS2010 Version But when I am trying to add rules in Fxcorp it giving error rules are not valid.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: loyawild-online</title>
		<link>http://michaelshim.com/blog/2009/11/23/running-fxcop-rules-against-silverlight-xaml/comment-page-1/#comment-57</link>
		<dc:creator>loyawild-online</dc:creator>
		<pubDate>Mon, 08 Mar 2010 05:12:30 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshim.com/blog/?p=29#comment-57</guid>
		<description>Aprendi mucho</description>
		<content:encoded><![CDATA[<p>Aprendi mucho</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie</title>
		<link>http://michaelshim.com/blog/2009/11/23/running-fxcop-rules-against-silverlight-xaml/comment-page-1/#comment-45</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Tue, 16 Feb 2010 18:35:21 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshim.com/blog/?p=29#comment-45</guid>
		<description>When are the FxCop bits going to be updated for the new release candidates of VS and .NET Fx?

FxCop crashes when you point it at the new runtime.

Thanks</description>
		<content:encoded><![CDATA[<p>When are the FxCop bits going to be updated for the new release candidates of VS and .NET Fx?</p>
<p>FxCop crashes when you point it at the new runtime.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Shim</title>
		<link>http://michaelshim.com/blog/2009/11/23/running-fxcop-rules-against-silverlight-xaml/comment-page-1/#comment-19</link>
		<dc:creator>Michael Shim</dc:creator>
		<pubDate>Thu, 10 Dec 2009 16:54:48 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshim.com/blog/?p=29#comment-19</guid>
		<description>Do you want to analyze 3.5 XAML or run XAML FxCop on 3.5?

We should be able to run against 3.5 XAML. I&#039;ll try it out and see what issues pop up. 

The XamlToolkit is built on System.Xaml which is a .net 4 component so we&#039;d have to port that first (which may not be possible). Why do you want to use 3.5?</description>
		<content:encoded><![CDATA[<p>Do you want to analyze 3.5 XAML or run XAML FxCop on 3.5?</p>
<p>We should be able to run against 3.5 XAML. I&#8217;ll try it out and see what issues pop up. </p>
<p>The XamlToolkit is built on System.Xaml which is a .net 4 component so we&#8217;d have to port that first (which may not be possible). Why do you want to use 3.5?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sync</title>
		<link>http://michaelshim.com/blog/2009/11/23/running-fxcop-rules-against-silverlight-xaml/comment-page-1/#comment-18</link>
		<dc:creator>Michael Sync</dc:creator>
		<pubDate>Thu, 10 Dec 2009 00:59:52 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshim.com/blog/?p=29#comment-18</guid>
		<description>Could you please support .NET 3.5 as well?</description>
		<content:encoded><![CDATA[<p>Could you please support .NET 3.5 as well?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vikd</title>
		<link>http://michaelshim.com/blog/2009/11/23/running-fxcop-rules-against-silverlight-xaml/comment-page-1/#comment-16</link>
		<dc:creator>Vikd</dc:creator>
		<pubDate>Wed, 02 Dec 2009 08:34:05 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshim.com/blog/?p=29#comment-16</guid>
		<description>Thanks for posting this Michael.

I am still facing the same issue mentioned by Thadeus. 

Took the latest version from http://code.msdn.microsoft.com/XAML/Release/ProjectReleases.aspx?ReleaseId=3598</description>
		<content:encoded><![CDATA[<p>Thanks for posting this Michael.</p>
<p>I am still facing the same issue mentioned by Thadeus. </p>
<p>Took the latest version from <a href="http://code.msdn.microsoft.com/XAML/Release/ProjectReleases.aspx?ReleaseId=3598" rel="nofollow">http://code.msdn.microsoft.com/XAML/Release/ProjectReleases.aspx?ReleaseId=3598</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Shim</title>
		<link>http://michaelshim.com/blog/2009/11/23/running-fxcop-rules-against-silverlight-xaml/comment-page-1/#comment-14</link>
		<dc:creator>Michael Shim</dc:creator>
		<pubDate>Tue, 24 Nov 2009 23:03:34 +0000</pubDate>
		<guid isPermaLink="false">http://michaelshim.com/blog/?p=29#comment-14</guid>
		<description>Sorry about that Thadeus.  We had a couple of issues but it should be all fixed now.  Let me know if you still have issues.</description>
		<content:encoded><![CDATA[<p>Sorry about that Thadeus.  We had a couple of issues but it should be all fixed now.  Let me know if you still have issues.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
