<?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: Generate Serialization Classes As Part of Your Build (Part 2)</title>
	<atom:link href="http://davedewinter.com/2008/09/28/generate-serialization-classes-as-part-of-your-build-part-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://davedewinter.com/2008/09/28/generate-serialization-classes-as-part-of-your-build-part-2/</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Thu, 22 Sep 2011 22:12:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<item>
		<title>By: David DeWinter</title>
		<link>http://davedewinter.com/2008/09/28/generate-serialization-classes-as-part-of-your-build-part-2/#comment-143</link>
		<dc:creator>David DeWinter</dc:creator>
		<pubDate>Fri, 09 Jan 2009 00:30:23 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.rev-net.com/ddewinter/2008/09/28/generate-serialization-classes-as-part-of-your-build-part-2/#comment-143</guid>
		<description>Dave, I think the easiest option would be to write an MSBuild task that translates the XSD file to CodeDom, and then instead of writing the CodeDom code to one file, split it into multiple files. I haven&#039;t tried it, but I assume you can do this by ensuring there is only one type declaration in the CodeNamespace before you save it.

David</description>
		<content:encoded><![CDATA[<p>Dave, I think the easiest option would be to write an MSBuild task that translates the XSD file to CodeDom, and then instead of writing the CodeDom code to one file, split it into multiple files. I haven&#8217;t tried it, but I assume you can do this by ensuring there is only one type declaration in the CodeNamespace before you save it.</p>
<p>David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Black</title>
		<link>http://davedewinter.com/2008/09/28/generate-serialization-classes-as-part-of-your-build-part-2/#comment-142</link>
		<dc:creator>Dave Black</dc:creator>
		<pubDate>Thu, 08 Jan 2009 20:58:12 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.rev-net.com/ddewinter/2008/09/28/generate-serialization-classes-as-part-of-your-build-part-2/#comment-142</guid>
		<description>Hi David,

Do you know if it&#039;s possible to have individual .cs files (i.e. each class in its own file) for each class?  I&#039;ve been looking for something like this for a while.  Though I like partial classes, I can&#039;t stand it when there is more than one class in a .cs file.  In fact, it often violates the coding standards for most of my clients.

Any assistance is appreciated : )</description>
		<content:encoded><![CDATA[<p>Hi David,</p>
<p>Do you know if it&#8217;s possible to have individual .cs files (i.e. each class in its own file) for each class?  I&#8217;ve been looking for something like this for a while.  Though I like partial classes, I can&#8217;t stand it when there is more than one class in a .cs file.  In fact, it often violates the coding standards for most of my clients.</p>
<p>Any assistance is appreciated : )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Communion</title>
		<link>http://davedewinter.com/2008/09/28/generate-serialization-classes-as-part-of-your-build-part-2/#comment-141</link>
		<dc:creator>Bob Communion</dc:creator>
		<pubDate>Wed, 15 Oct 2008 23:24:32 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.rev-net.com/ddewinter/2008/09/28/generate-serialization-classes-as-part-of-your-build-part-2/#comment-141</guid>
		<description>Thanks David,

I changed my outputs to 

Outputs=&quot;@(GenerateSerializationClass-&gt;&apos;%(RelativeDir)%(Filename).cs&apos;)&quot; 

And it does build incrementally.  Thanks for your help.</description>
		<content:encoded><![CDATA[<p>Thanks David,</p>
<p>I changed my outputs to </p>
<p>Outputs=&quot;@(GenerateSerializationClass-&gt;&apos;%(RelativeDir)%(Filename).cs&apos;)&quot; </p>
<p>And it does build incrementally.  Thanks for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David DeWinter</title>
		<link>http://davedewinter.com/2008/09/28/generate-serialization-classes-as-part-of-your-build-part-2/#comment-140</link>
		<dc:creator>David DeWinter</dc:creator>
		<pubDate>Wed, 15 Oct 2008 12:28:44 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.rev-net.com/ddewinter/2008/09/28/generate-serialization-classes-as-part-of-your-build-part-2/#comment-140</guid>
		<description>Hi Bob,

In your GenerateSerializationClasses target&#039;s Outputs, try using %(RelativeDir) instead of %(Directory). %(Directory) will give you the full directory path (without the drive letter) to your file, which MSBuild will treat as relative.

An easy way to debug these sorts of problems is to increase the verbosity of your MSBuild output. To do that within VS, go to Tools &gt; Options... &gt; Projects and Solutions &gt; Build and Run, and on the options page you should see a drop down for MSBuild project build output verbosity. Usually &quot;Detailed&quot; is enough to see something like this:

Output file &quot;UsersddewinterDocumentsProjectsDBML FixupImplementationDeWinter.DbmlFixupDeWinter.DbmlFixup.IntegrationConceptualDbmlFixupPreferences.cs&quot; does not exist.
  Output file &quot;UsersddewinterDocumentsProjectsDBML FixupImplementationDeWinter.DbmlFixupDeWinter.DbmlFixup.IntegrationConceptualDbmlSchema.cs&quot; does not exist.

Hope this helps!

David</description>
		<content:encoded><![CDATA[<p>Hi Bob,</p>
<p>In your GenerateSerializationClasses target&#8217;s Outputs, try using %(RelativeDir) instead of %(Directory). %(Directory) will give you the full directory path (without the drive letter) to your file, which MSBuild will treat as relative.</p>
<p>An easy way to debug these sorts of problems is to increase the verbosity of your MSBuild output. To do that within VS, go to Tools > Options&#8230; > Projects and Solutions > Build and Run, and on the options page you should see a drop down for MSBuild project build output verbosity. Usually &#8220;Detailed&#8221; is enough to see something like this:</p>
<p>Output file &#8220;UsersddewinterDocumentsProjectsDBML FixupImplementationDeWinter.DbmlFixupDeWinter.DbmlFixup.IntegrationConceptualDbmlFixupPreferences.cs&#8221; does not exist.<br />
  Output file &#8220;UsersddewinterDocumentsProjectsDBML FixupImplementationDeWinter.DbmlFixupDeWinter.DbmlFixup.IntegrationConceptualDbmlSchema.cs&#8221; does not exist.</p>
<p>Hope this helps!</p>
<p>David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Communion</title>
		<link>http://davedewinter.com/2008/09/28/generate-serialization-classes-as-part-of-your-build-part-2/#comment-139</link>
		<dc:creator>Bob Communion</dc:creator>
		<pubDate>Wed, 15 Oct 2008 06:33:11 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.rev-net.com/ddewinter/2008/09/28/generate-serialization-classes-as-part-of-your-build-part-2/#comment-139</guid>
		<description>Hello,

I have been trying to cater for multiple xsd files in a project by modifying the build rules you put in part 1.  I have come up with the following sample build file.  The only problem I am having is that the classes are regenerated every time msbuild is run, which means I have to have the files checked out every time I do a build.  Do you know how to get this to work incrementally?

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;Project ToolsVersion=&quot;3.5&quot; DefaultTargets=&quot;Build&quot; xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&gt;
  &lt;ItemGroup&gt;
    &lt;GenerateSerializationClass Include=&quot;DataSourcesChequeData.xsd&quot; /&gt;
    &lt;GenerateSerializationClass Include=&quot;DataSourcesLoadDataResponse.xsd&quot; /&gt;
  &lt;/ItemGroup&gt;
&lt;Target 
    Name=&quot;GenerateSerializationClasses&quot; 
    Inputs=&quot;@(GenerateSerializationClass)&quot;
    Outputs=&quot;@(GenerateSerializationClass-&gt;&apos;%(Directory)%(Filename).cs&apos;)&quot;&gt;
    &lt;Exec 
	WorkingDirectory=&quot;DataSources&quot; 
	Command=&quot;&quot;C:Program FilesMicrosoft SDKsWindowsv6.0aBinxsd.exe&quot; %(GenerateSerializationClass.Filename)%(GenerateSerializationClass.Extension) /classes /n:MyCompanyName.Logic.DataSources&quot;
     /&gt;
  &lt;/Target&gt;
  &lt;Target Name=&quot;Build&quot; DependsOnTargets=&quot;GenerateSerializationClasses&quot;&gt;
  &lt;/Target&gt;
&lt;/Project&gt;</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I have been trying to cater for multiple xsd files in a project by modifying the build rules you put in part 1.  I have come up with the following sample build file.  The only problem I am having is that the classes are regenerated every time msbuild is run, which means I have to have the files checked out every time I do a build.  Do you know how to get this to work incrementally?</p>
<p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br />
&lt;Project ToolsVersion=&quot;3.5&quot; DefaultTargets=&quot;Build&quot; xmlns=&quot;<a href="http://schemas.microsoft.com/developer/msbuild/2003&quot;&#038;gt" rel="nofollow">http://schemas.microsoft.com/developer/msbuild/2003&quot;&#038;gt</a>;<br />
  &lt;ItemGroup&gt;<br />
    &lt;GenerateSerializationClass Include=&quot;DataSourcesChequeData.xsd&quot; /&gt;<br />
    &lt;GenerateSerializationClass Include=&quot;DataSourcesLoadDataResponse.xsd&quot; /&gt;<br />
  &lt;/ItemGroup&gt;<br />
&lt;Target<br />
    Name=&quot;GenerateSerializationClasses&quot;<br />
    Inputs=&quot;@(GenerateSerializationClass)&quot;<br />
    Outputs=&quot;@(GenerateSerializationClass-&gt;&apos;%(Directory)%(Filename).cs&apos;)&quot;&gt;<br />
    &lt;Exec<br />
	WorkingDirectory=&quot;DataSources&quot;<br />
	Command=&quot;&amp;quot;C:Program FilesMicrosoft SDKsWindowsv6.0aBinxsd.exe&amp;quot; %(GenerateSerializationClass.Filename)%(GenerateSerializationClass.Extension) /classes /n:MyCompanyName.Logic.DataSources&quot;<br />
     /&gt;<br />
  &lt;/Target&gt;<br />
  &lt;Target Name=&quot;Build&quot; DependsOnTargets=&quot;GenerateSerializationClasses&quot;&gt;<br />
  &lt;/Target&gt;<br />
&lt;/Project&gt;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

