<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.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>/bill's House O Insomnia&lt;img src="http://www.williamgryan.com/images/originalcuckoo.jpg" alt="Bill Ryan" /&gt; : .NET 3.0 Framework</title><link>http://msmvps.com/blogs/williamryan/archive/tags/.NET+3.0+Framework/default.aspx</link><description>Tags: .NET 3.0 Framework</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>WF Persistence - Where [DataContract] != [Serializable]</title><link>http://msmvps.com/blogs/williamryan/archive/2008/11/01/wf-persistence-where-datacontract-serializable.aspx</link><pubDate>Sat, 01 Nov 2008 07:27:07 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1652742</guid><dc:creator>William</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=1652742</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=1652742</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2008/11/01/wf-persistence-where-datacontract-serializable.aspx#comments</comments><description>&lt;p&gt;Let&amp;#39;s say you were using Workflow Foundation (WF) and Windows Communication Foundation (WCF). Assume you wanted to use WF&amp;#39;s Persistence mechanism (which requires types to be &lt;a href="http://msdn.microsoft.com/en-us/library/system.serializableattribute(VS.71).aspx"&gt;Serializable&lt;/a&gt;). And assume that all the objects you were using in the workflow were decorated with the &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.aspx"&gt;[DataContract]&lt;/a&gt; attribute.&amp;nbsp; Would you expect any problems related to Serialization?&amp;nbsp; &lt;em&gt;(I can but to the chase really quickly here if you don&amp;#39;t want my belabored background information and explanation. If you&amp;#39;re creating a type to use w/ Workflow Foundation that will be saved via the Workflow Foundation Persistence Service which makes use of the &lt;a href="http://msdn.microsoft.com/en-us/library/system.workflow.runtime.hosting.sqlworkflowpersistenceservice.aspx"&gt;SqlWorkflowPersistenceService&lt;/a&gt; class, marking the class as a &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.aspx"&gt;[DataContract]&lt;/a&gt; alone will not work for WF&amp;#39;s persistence mechanism. It does make the class &lt;a href="http://msdn.microsoft.com/en-us/library/system.serializableattribute(VS.71).aspx"&gt;serializable&lt;/a&gt; in a literal sense and will suffice [provided you meet the other requirements of a &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.aspx"&gt;[DataContract]&lt;/a&gt;  for WCF&amp;#39;s serialization needs, but it is insufficient for WF (see the References section at the end of this post for more details on WF Serialization) - so make sure you use the &lt;a href="http://msdn.microsoft.com/en-us/library/system.serializableattribute(VS.71).aspx"&gt;Serializable&lt;/a&gt; attribute on any type that&amp;#39;ll be consumed by the Persistence Service).&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;MSDN describes the &lt;/strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.aspx"&gt;&lt;strong&gt;DataContract class&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; the following way:&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p align="left"&gt;&lt;em&gt; Specifies that the type defines or implements a data contract and is serializable by a serializer, such as&amp;nbsp;&amp;nbsp; the &lt;/em&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer.aspx"&gt;&lt;em&gt;DataContractSerializer&lt;/em&gt;&lt;/a&gt;&lt;em&gt;. To make their type &lt;a href="http://msdn.microsoft.com/en-us/library/system.serializableattribute(VS.71).aspx"&gt;serializable&lt;/a&gt;, type authors must define a data contract for their type.&lt;/em&gt; &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;If you spend a lot of time in WCF, you&amp;#39;d likely assume that b/c types decorated with the &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.aspx"&gt;DataContract&lt;/a&gt; attribute would satisfy any requirement for the type to be &lt;a href="http://msdn.microsoft.com/en-us/library/system.serializableattribute(VS.71).aspx"&gt;Serializable&lt;/a&gt;.&amp;nbsp; But you&amp;#39;d likely be wrong. Yes, a type that is a &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.aspx"&gt;[DataContract]&lt;/a&gt;&amp;nbsp; is serializable in the literal sense, but it&amp;#39;s serialized by the &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer.aspx"&gt;DataContractSerializer&lt;/a&gt; (see the &lt;em&gt;References&lt;/em&gt; section at the end of this post for more details on WF Serialization) &lt;p&gt;So why is this an issue and what do you do about it?&amp;nbsp; Often, non-trivial workflows span an amount of time that exceeds any given user&amp;#39;s session.&amp;nbsp; In fact, it&amp;#39;s not uncommon for a non-trivial workflow to span as much as 30 days.&amp;nbsp; Using a simple example, let&amp;#39;s say that you are writing a Workflow to manage new employees.&amp;nbsp; Further assume that there are several document requirements and that any deficiencies would result in severe penalties or liability risks.&amp;nbsp; Just to make it clear, assume that each of the following must be procured before a new employee can start working.&amp;nbsp; Further, assume that b/c of fees associated with each, if any previous one fails, that the whole process terminates (if someone&amp;#39;s reference checks don&amp;#39;t pass, there&amp;#39;s no need to spend the money for a full background investigation as you know you&amp;#39;re not going to hire them). [Also, this isn&amp;#39;t a post on workplace hiring guidelines and is solely used for illustration - no need to point out why &amp;#39;its bad business to drug test or whatever else]. &lt;ol&gt; &lt;li&gt;Employment Application&lt;/li&gt; &lt;li&gt;Proof of Citizenship or ability to work in the U.S.&lt;/li&gt; &lt;li&gt;State withholding form&lt;/li&gt; &lt;li&gt;Federal withholding form&lt;/li&gt; &lt;li&gt;Reference check&lt;/li&gt; &lt;li&gt;License check&lt;/li&gt; &lt;li&gt;Completed Drug Screen&lt;/li&gt; &lt;li&gt;Full Background check&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Implementation policies will vary from company to company but assume that all of these tasks wouldn&amp;#39;t be completed within the user session that first created the entity. If you couldn&amp;#39;t persist the workflow somehow and come back to it later, it would be of very little use.&amp;nbsp;&amp;nbsp; Workflow foundation provides an out-of-the-box solution named not surprisingly -&amp;nbsp; &lt;a href="http://msdn.microsoft.com/en-us/library/ms735722(VS.85).aspx"&gt;Windows Workflow Persistence Service&lt;/a&gt; to help with long running workflows&lt;/p&gt; &lt;p&gt;Since Workflow Foundation is still in its infancy in terms of user adoption, many shops don&amp;#39;t have well established design rules in place specifically for Workflow items.&amp;nbsp; This can have some profound (although easily addressed in most cases) effects on Workflow development. It&amp;#39;s common for a workflow to start out small in terms of steps and happen relatively quickly.&amp;nbsp; When this is the case, there&amp;#39;s little need for a persistence mechanism for the workflow.&amp;nbsp; But as people get comfortable with WF and are willing to try more involved solutions, steps get added that often increase the time span the workflow could run to a point that&amp;#39;s longer than the user session.&amp;nbsp; For people new to WF, adding that first activity that&amp;#39;ll possibly span a large amount of time is the first time they actually think seriously about the persistence service. And that&amp;#39;s the point at which they often go back and try to retrofit things.&amp;nbsp; In many cases, the number of &amp;quot;things&amp;quot; will be fairly substantial so it&amp;#39;s quite easy to overlook something.&amp;nbsp; Once you implement the persistence service, you&amp;#39;ll typically go through the testing phase and make sure everything persist and can be retrieved correctly.&amp;nbsp; And this is the time serialization problems with show themselves - often in a manner that&amp;#39;s hard to isolate b/c the number of items involved.&amp;nbsp; &lt;/p&gt; &lt;p&gt; In some cases, if there&amp;#39;s a serialization problem, a fault will result.&amp;nbsp; &lt;a href="http://odetocode.com/Blogs/scott/archive/2007/01/24/9943.aspx"&gt;Unhandled faults&lt;/a&gt; in WF cause behavior that deviates from what you&amp;#39;d typically expect. So depending on your logging and tracing, you may or may not find the issue quickly. in many cases, you&amp;#39;ll find the fault is related to serialization and you&amp;#39;ll address it on the specific type, then go back and try to find every other type and make it &lt;a href="http://msdn.microsoft.com/en-us/library/system.serializableattribute(VS.71).aspx"&gt;serializable&lt;/a&gt; as well.&amp;nbsp; This is likely to be overkill though - b/c you&amp;#39;re likely to have some types that aren&amp;#39;t involved in anything that&amp;#39;s persisted and consequently don&amp;#39;t require persistence.&amp;nbsp; So you try to only make the items that will be persisted &lt;a href="http://msdn.microsoft.com/en-us/library/system.serializableattribute(VS.71).aspx"&gt;serializable&lt;/a&gt;. Until you get to the point where you&amp;#39;re addressing everything in the planning and design stages, you&amp;#39;re likely to run into situations like this and the only way out typically involves a lot of trial-and-error.&amp;nbsp; That&amp;#39;s why this post is relevant. If you go back and define each type that will be persisted as a &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.aspx"&gt;[DataContract]&lt;/a&gt; , it&amp;#39;ll take you some time to do, may necessitate you adding new references to some projects and ultimately, after all that&amp;#39;s done, won&amp;#39;t fix the problem. The following type may work all day long when just dealing with WCF&amp;#39;s serialization requirements...&lt;/p&gt; &lt;p&gt;namespace Ger911.HCStandard.Core.Shared&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataContract]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class MatrixItem&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String EntityName { get; set; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String ContactName { get; set; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Int32 BedCount { get; set; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String HospitalStatus { get; set; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public DateTime ModifiedDateTime { get; set; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;} &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;But unless you modify it like this, you&amp;#39;ll be in for some unpleasant surprises in WF:&lt;/p&gt; &lt;p&gt;namespace Ger911.HCStandard.Core.Shared&lt;br /&gt;{&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Serializable]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataContract]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class MatrixItem&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String EntityName { get; set; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String ContactName { get; set; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Int32 BedCount { get; set; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String HospitalStatus { get; set; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public DateTime ModifiedDateTime { get; set; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/p&gt; &lt;p&gt;References:&lt;/p&gt; &lt;p&gt;Using &lt;a href="http://www.red-gate.com/products/reflector/"&gt;Red Gate&amp;#39;s Reflector&lt;/a&gt;, here&amp;#39;s what you&amp;#39;ll see under the hood of the &lt;a href="http://msdn.microsoft.com/en-us/library/system.workflow.runtime.hosting.workflowpersistenceservice.aspx"&gt;WorkflowPesistenceService&lt;/a&gt; class&amp;#39;s &lt;a href="http://msdn.microsoft.com/en-us/library/system.workflow.runtime.hosting.workflowpersistenceservice.restorefromdefaultserializedform.aspx"&gt;RestoreFromDefaultSerializedForm&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/system.workflow.runtime.hosting.workflowpersistenceservice.getdefaultserializedform.aspx"&gt;GetDefaultSerializedForm&lt;/a&gt;.&amp;nbsp; For further insight into this, use &lt;a href="http://www.red-gate.com/products/reflector/"&gt;Reflector&lt;/a&gt; and examine the &lt;a href="http://msdn.microsoft.com/en-us/library/system.workflow.runtime.hosting.sqlworkflowpersistenceservice.aspx"&gt;SqlWorkflowPersistenceService&lt;/a&gt;:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;&lt;strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.workflow.runtime.hosting.workflowpersistenceservice.restorefromdefaultserializedform.aspx"&gt;RestoreFromDefaultSerializedForm&lt;/a&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;protected static Activity RestoreFromDefaultSerializedForm(byte[] activityBytes, Activity outerActivity)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Activity activity;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime now = DateTime.Now;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MemoryStream stream = new MemoryStream(activityBytes);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stream.Position = 0L;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (GZipStream stream2 = new GZipStream(stream, CompressionMode.Decompress, true))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; activity = Activity.Load(stream2, outerActivity);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TimeSpan span = (TimeSpan)(DateTime.Now - now);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WorkflowTrace.Host.TraceEvent(TraceEventType.Information, 0, &amp;quot;Deserialized a {0} to length {1}. Took {2}.&amp;quot;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new object[] { activity, stream.Length, span }); return activity;&lt;br /&gt; } &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.workflow.runtime.hosting.workflowpersistenceservice.getdefaultserializedform.aspx"&gt;GetDefaultSerializedForm&lt;/a&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;protected static byte[] GetDefaultSerializedForm(Activity activity)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime now = DateTime.Now;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (MemoryStream stream = new MemoryStream(0x2800))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stream.Position = 0L;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; activity.Save(stream);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (MemoryStream stream2 = new MemoryStream((int)stream.Length))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (GZipStream stream3 = new GZipStream(stream2, CompressionMode.Compress, true))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stream3.Write(stream.GetBuffer(), 0, (int)stream.Length);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActivityExecutionContextInfo info = (ActivityExecutionContextInfo)activity.GetValue(Activity.ActivityExecutionContextInfoProperty);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TimeSpan span = (TimeSpan)(DateTime.Now - now);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WorkflowTrace.Host.TraceEvent(TraceEventType.Information, 0, &amp;quot;Serialized a {0} with id {1} to length {2}. Took {3}.&amp;quot;, new object[] { info, info.ContextGuid, stream2.Length, span });&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] array = stream2.GetBuffer();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Array.Resize&amp;lt;byte&amp;gt;(ref array, Convert.ToInt32(stream2.Length));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return array;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;} &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer.aspx"&gt;&lt;font size="3"&gt;&lt;strong&gt;DataContractSerializer&lt;/strong&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;public sealed class DataContractSerializer : XmlObjectSerializer&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Fields&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private IDataContractSurrogate dataContractSurrogate;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private bool ignoreExtensionDataObject;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal Dictionary&amp;lt;XmlQualifiedName, DataContract&amp;gt; knownDataContracts;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private ReadOnlyCollection&amp;lt;Type&amp;gt; knownTypeCollection;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal IList&amp;lt;Type&amp;gt; knownTypeList;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private int maxItemsInObjectGraph;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private bool needsContractNsAtRoot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private bool preserveObjectReferences;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private DataContract rootContract;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private XmlDictionaryString rootName;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private XmlDictionaryString rootNamespace;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private Type rootType;  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Methods&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public DataContractSerializer(Type type);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public DataContractSerializer(Type type, IEnumerable&amp;lt;Type&amp;gt; knownTypes);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public DataContractSerializer(Type type, string rootName, string rootNamespace);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public DataContractSerializer(Type type, XmlDictionaryString rootName, XmlDictionaryString rootNamespace);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public DataContractSerializer(Type type, string rootName, string rootNamespace, IEnumerable&amp;lt;Type&amp;gt; knownTypes);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public DataContractSerializer(Type type, XmlDictionaryString rootName, XmlDictionaryString rootNamespace, IEnumerable&amp;lt;Type&amp;gt; knownTypes);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public DataContractSerializer(Type type, IEnumerable&amp;lt;Type&amp;gt; knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, bool preserveObjectReferences, IDataContractSurrogate dataContractSurrogate);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public DataContractSerializer(Type type, string rootName, string rootNamespace, IEnumerable&amp;lt;Type&amp;gt; knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, bool preserveObjectReferences, IDataContractSurrogate dataContractSurrogate);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public DataContractSerializer(Type type, XmlDictionaryString rootName, XmlDictionaryString rootNamespace, IEnumerable&amp;lt;Type&amp;gt; knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, bool preserveObjectReferences, IDataContractSurrogate dataContractSurrogate);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal static DataContract GetDataContract(DataContract declaredTypeContract, Type declaredType, Type objectType);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal override Type GetDeserializeType();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal override Type GetSerializeType(object graph);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal static Type GetSurrogatedType(IDataContractSurrogate dataContractSurrogate, Type type);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void Initialize(Type type, IEnumerable&amp;lt;Type&amp;gt; knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, bool preserveObjectReferences, IDataContractSurrogate dataContractSurrogate);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void Initialize(Type type, XmlDictionaryString rootName, XmlDictionaryString rootNamespace, IEnumerable&amp;lt;Type&amp;gt; knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, bool preserveObjectReferences, IDataContractSurrogate dataContractSurrogate);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal override bool InternalIsStartObject(XmlReaderDelegator reader);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal override object InternalReadObject(XmlReaderDelegator xmlReader, bool verifyObjectName);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal override void InternalWriteEndObject(XmlWriterDelegator writer);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal override void InternalWriteObject(XmlWriterDelegator writer, object graph);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal override void InternalWriteObjectContent(XmlWriterDelegator writer, object graph);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal override void InternalWriteStartObject(XmlWriterDelegator writer, object graph);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override bool IsStartObject(XmlDictionaryReader reader);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override bool IsStartObject(XmlReader reader);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override object ReadObject(XmlReader reader);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override object ReadObject(XmlDictionaryReader reader, bool verifyObjectName);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override object ReadObject(XmlReader reader, bool verifyObjectName);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal static object SurrogateToDataContractType(IDataContractSurrogate dataContractSurrogate, object oldObj, Type surrogatedDeclaredType, ref Type objType);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void WriteEndObject(XmlDictionaryWriter writer);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void WriteEndObject(XmlWriter writer);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void WriteObject(XmlWriter writer, object graph);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void WriteObjectContent(XmlDictionaryWriter writer, object graph);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void WriteObjectContent(XmlWriter writer, object graph);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void WriteStartObject(XmlDictionaryWriter writer, object graph);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void WriteStartObject(XmlWriter writer, object graph);  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Properties&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public IDataContractSurrogate DataContractSurrogate { get; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public bool IgnoreExtensionDataObject { get; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal Dictionary&amp;lt;XmlQualifiedName, DataContract&amp;gt; KnownDataContracts { get; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public ReadOnlyCollection&amp;lt;Type&amp;gt; KnownTypes { get; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int MaxItemsInObjectGraph { get; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public bool PreserveObjectReferences { get; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private DataContract RootContract { get; }&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1652742" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+General/default.aspx">.NET General</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WCF/default.aspx">WCF</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WIndows+Communication+Foundation/default.aspx">WIndows Communication Foundation</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+3.0+Framework/default.aspx">.NET 3.0 Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Workflow/default.aspx">Workflow</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+3.5+Framework/default.aspx">.NET 3.5 Framework</category></item><item><title>Looking for some .NET Developers</title><link>http://msmvps.com/blogs/williamryan/archive/2008/06/06/looking-for-some-net-developers.aspx</link><pubDate>Sat, 07 Jun 2008 02:19:26 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1632527</guid><dc:creator>William</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=1632527</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=1632527</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2008/06/06/looking-for-some-net-developers.aspx#comments</comments><description>&lt;p&gt;A client of mine located in the Aiken/Columbia South Carolina Area has asked me if I had any friends who are .NET Developers and looking for a job. They are looking for at least one Junior Developer, on Mid-Level Developer and several Senior developers.&amp;nbsp; I know these folks quite well and I can vouch for the following:&amp;nbsp; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;They pay extremely well&lt;/li&gt; &lt;li&gt;Generous benefits package&lt;/li&gt; &lt;li&gt;There&amp;#39;s plenty of cool people on their staff&lt;/li&gt; &lt;li&gt;They are growing at an explosive rate so there&amp;#39;s plenty of room for upward mobility. There&amp;#39;s also a very strong focus on learning/teaching and career development.&lt;/li&gt; &lt;li&gt;They are an Agile/SCRUM shop&lt;/li&gt; &lt;li&gt;Currently developing with the following technologies:&lt;/li&gt; &lt;ul&gt; &lt;li&gt; Visual Studio Team System 2008 / .NET 3.5 Framework&lt;/li&gt; &lt;li&gt;Windows Communication Foundation&lt;/li&gt; &lt;li&gt;Windows Presentation Foundation&lt;/li&gt; &lt;li&gt;ASP.NET&lt;/li&gt; &lt;li&gt;LINQ&lt;/li&gt; &lt;li&gt;Silverlight&lt;/li&gt; &lt;li&gt;Windows Mobile 5/ Windows Mobile 6/ .NET Compact Framework&lt;/li&gt; &lt;li&gt;Sql Server 2005 / Sql Server 2008&lt;/li&gt; &lt;li&gt;Windows Installer for XML&lt;/li&gt; &lt;li&gt;Sandcastle&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;p&gt;If you&amp;#39;re in the area and looking for a job... if you know someone who looking for a job.... or if you&amp;#39;re willing to move, please drop me a line using the Contact option on&amp;nbsp; my blog or emailing me directly at &lt;a href="mailto://WilliamRyan@gmail.com"&gt;WilliamRyan@gmail.com&lt;/a&gt; and I&amp;#39;ll put you in contact with them.&amp;nbsp; They are looking to hire folks immediately so I can probably get you an interview within a few days.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Junior Developer:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Ideal candidate will be a recent college graduate with a Computer Science of MIS degree.&amp;nbsp; No experience is necessary for this position. The main soft-skill qualifications for this position are:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;A true love for development&lt;/li&gt; &lt;li&gt;Strong desire to learn&lt;/li&gt; &lt;li&gt;A desire to stand out among one&amp;#39;s peers&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt; The hard-skill qualifications include a good theoretical understanding of at least two of the following:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Object Oriented Design and Analysis&lt;/li&gt; &lt;li&gt;Relational Database theory&lt;/li&gt; &lt;li&gt;Design Patterns&lt;/li&gt; &lt;li&gt;Familiarity with at least two of the following:&amp;nbsp; C, C++, Java, C#, VB.NET&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;This is essentially a dream job for recent college grads b/c the job is being offered &amp;quot;no experience required&amp;quot;.&amp;nbsp; Since they are a SCRUM/Agile shop, you&amp;#39;ll get to work extensively with their Senior and Mid level devs via Pair Programming.&amp;nbsp;&amp;nbsp; You&amp;#39;ll be able to pick&amp;nbsp; an area to specialize in which you will decide on for yourself. Additionally, you&amp;#39;ll be using some of the most sought after Microsoft technologies available.&amp;nbsp; Go to Monster.com or Dice.com and see for yourself how much demand there is for the above technologies and how much those jobs pay.&amp;nbsp; You&amp;#39;ll get to work with these on day 1 and essentially carve out a path for yourself using whichever technologies you like the best.&amp;nbsp; If you want to be a &amp;quot;UI&amp;quot; expert, that&amp;#39;s where you&amp;#39;ll be put. If you want to be a Web Services dev, again, that&amp;#39;s what you can focus on.&amp;nbsp; If you want to be an expert buildmaster who specializes in installers, that&amp;#39;s what you&amp;#39;ll get to do.&amp;nbsp; The company is looking for some excellent candidates and willing to offer a really fun and great paying job with plenty of training and career development available.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Mid-Level Developer:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The ideal candidate will have a computer science or MIS degree and 1-3 years of development experience.&amp;nbsp; The ideal candidate will have two or more the following abilities:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Solid command of OOP/OOD using C++, C#, Java or VB.NET&lt;/li&gt; &lt;li&gt;Test Driven Design&lt;/li&gt; &lt;li&gt;Service Oriented Architecture&lt;/li&gt; &lt;li&gt;Familiarity with MySql, Sql Server (T-SQL), Oracle (PL/SQL)&lt;/li&gt; &lt;li&gt;Basic understanding of both Winforms and ASP.NET&lt;/li&gt; &lt;li&gt;Basic familiarity with Web Services, MSMQ, Enterprise Services/COM+, .NET Remoting, DCOM, J2EE, Java Beans&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Just like the Junior development positions, these ones will provide a great deal of flexibility to learn and specialize the area of your choice.&amp;nbsp; These are considered &amp;#39;fast track&amp;#39; positions to move into the Senior Developer or Architect roles&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Senior Developer:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The ideal candidate will be someone with at least 4 years experience.&amp;nbsp; This person will love challenges and love coming up with solutions to problems that other people run from.&amp;nbsp; They will be people that love figuring out how to do things that everyone else said can&amp;#39;t be done.&amp;nbsp; They will be the stereotypical Alpha-Geek, Someone that spends their spare time &lt;a href="http://newtechusa.com/csharp-dotnet-quiz.asp"&gt;answering quiz questions like these&lt;/a&gt;:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;All of the requirements for the Mid-Level Developer as well as several of the following skills:&lt;/li&gt; &lt;ul&gt; &lt;li&gt;Proficiency with T-Sql or PL/SQL.&amp;nbsp; You should be able to write a 5 table join on your own. You should have written several stored procedures that were &amp;gt; 100 lines long.&lt;/li&gt; &lt;li&gt;Strong command of query tuning and ability to easily spot design flaws&lt;/li&gt; &lt;li&gt;Ability to design &amp;#39;real&amp;#39; objects.&amp;nbsp; &lt;/li&gt; &lt;ul&gt; &lt;li&gt;Someone who pays meticulous attention to the scope modifiers of their classes/functions/properties&lt;/li&gt; &lt;li&gt;Someone who understands the problems associated with coupling and strives to avoid it.&lt;/li&gt; &lt;li&gt;Someone who can write and use events in their classes without thinking twice about it.&lt;/li&gt; &lt;li&gt;Someone with a solid understanding of thread safety and thread synchronization&lt;/li&gt; &lt;li&gt;Someone who is comfortable using several different design patterns&lt;/li&gt; &lt;li&gt;Someone who is comfortable implementing several different interfaces in one object, using combinations of interface implementation and inheritance and someone who can use inheritance responsibly&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;Keeps up with technology, reads computer books regularly, has favorite blogs in multiple disciplines and/or blogs themselves, attends or speaks at user&amp;#39;s groups, is active in one or more online forum or newsgroup&lt;/li&gt; &lt;li&gt;Someone who answers &amp;quot;Which is better, C# or VB.NET?&amp;quot; with &amp;quot;Either can be better depending on the circumstances but I&amp;#39;m comfortable writing in either of them&amp;quot; and then &amp;quot;But I&amp;#39;ve been learning F# lately and it&amp;#39;s really been growing on me&amp;quot;&lt;/li&gt; &lt;li&gt;Experience with .NET Remoting, Web Services &amp;amp; Web Services Enhancements, MSMQ, Enterprise Services and/or WCF&lt;/li&gt; &lt;li&gt;Ability to create syntactically correct UML diagrams (meaning they can do more than write the letters &amp;quot;UML&amp;quot; on their resume) and if not, they are willing to learn to do this.&lt;/li&gt; &lt;li&gt;Understands data structures solidly and could easily implement their own HashTable or LinkedList &lt;/li&gt; &lt;li&gt;Someone who&amp;#39;s always looking to come up with a newer, cooler, faster, and more secure way to do implement something&lt;/li&gt; &lt;li&gt;Experienced with either Biztalk server or Sharepoint&lt;/li&gt; &lt;li&gt;Takes pride in their code without falling in love with it or getting all defensive about it.&amp;nbsp; Ability to acknowledge the fact that everyone makes mistakes and can talk about their mistakes/bugs without getting defensive.&lt;/li&gt; &lt;li&gt;Someone who is the first to raise their hand whenever the boss says &amp;quot;I need someone to learn ____________, do I have any volunteers&amp;quot;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;p&gt;Basically, if you love development, love creating new cutting edge solutions all the while making a lot of money and having a lot of fun you definitely should talk to these folks.&amp;nbsp; If you&amp;#39;re interested...... Please drop me a line using the Contact option on&amp;nbsp; my blog or emailing me directly at &lt;a href="mailto://WilliamRyan@gmail.com"&gt;WilliamRyan@gmail.com&lt;/a&gt; and I&amp;#39;ll put you in contact with them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1632527" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Compact+Framework/default.aspx">Compact Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Web+Services+_2F00_+WSE/default.aspx">Web Services / WSE</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+Basics/default.aspx">.NET Basics</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+General/default.aspx">.NET General</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Coding+Techniques/default.aspx">Coding Techniques</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Misc+Technology/default.aspx">Misc Technology</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Biztalk/default.aspx">Biztalk</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WPF/default.aspx">WPF</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WCF/default.aspx">WCF</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+3.0+Framework/default.aspx">.NET 3.0 Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WIX/default.aspx">WIX</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Sql+Server+Integration+Services/default.aspx">Sql Server Integration Services</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/SSIS/default.aspx">SSIS</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Sql+Server/default.aspx">Sql Server</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Sql+Server+2008/default.aspx">Sql Server 2008</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Sharepoint/default.aspx">Sharepoint</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/LINQ+To+ADO.NET/default.aspx">LINQ To ADO.NET</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+3.5+Framework/default.aspx">.NET 3.5 Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/LINQ+Training/default.aspx">LINQ Training</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/ADO.NET+3.5/default.aspx">ADO.NET 3.5</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/C_2300_+3.5/default.aspx">C# 3.5</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Windows+Mobile/default.aspx">Windows Mobile</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Job+Stuff/default.aspx">Job Stuff</category></item><item><title>Filtering data ADO.NET Synchronization Services</title><link>http://msmvps.com/blogs/williamryan/archive/2007/11/13/filtering-data-ado-net-synchronization-services.aspx</link><pubDate>Wed, 14 Nov 2007 02:20:57 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1308509</guid><dc:creator>William</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=1308509</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=1308509</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2007/11/13/filtering-data-ado-net-synchronization-services.aspx#comments</comments><description>&lt;p&gt;If you dabble in Orcas or are a data aficionado, then you have probably at least heard of &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=02989F70-49AA-43D7-81B8-A651120F8D65&amp;amp;displaylang=en" target="_blank"&gt;Synchronization Services&lt;/a&gt;.&amp;nbsp; If you haven&amp;#39;t heard of it, let me try to pique your interest.&lt;/p&gt; &lt;p&gt;The business case for &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=02989F70-49AA-43D7-81B8-A651120F8D65&amp;amp;displaylang=en" target="_blank"&gt;Sync Services&lt;/a&gt;&amp;nbsp;is simple. You have data in one place and you want to sync it with Data in another place.&amp;nbsp; This is an old school problem that has been dealt with many times before by many different people. That should clue you in to the realization that such problems should probably be approached using design patterns and &lt;a href="http://msdn2.microsoft.com/en-us/library/ms998449.aspx" target="_blank"&gt;Data Oriented Design Patterns in particular&lt;/a&gt;.&amp;nbsp; My memory is a little foggy but I don&amp;#39;t specifically remember reading any &amp;#39;data movement patterns&amp;#39; in the seminal design pattern book, &amp;nbsp;&lt;a href="http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612" target="_blank"&gt;Design Patterns: Elements of Reusable Object-Oriented Software&lt;/a&gt;&amp;nbsp;by the &lt;a href="http://en.wikipedia.org/wiki/Design_Patterns" target="_blank"&gt;Gang of Four&lt;/a&gt;.&amp;nbsp; (As a slight digression, I&amp;#39;ve found quite a few superb design pattern books and a few stinkers.&amp;nbsp; The GOF book is by far the best one I&amp;#39;ve come across in terms of being understandable and easy to follow and can say with comfort that it won&amp;#39;t disappoint).&lt;/p&gt; &lt;p&gt;So you can roll your own code, you can use an existing mechanism like Replication, or you can go new school and try SS. I don&amp;#39;t claim to be an expert at SS but so far, I&amp;#39;ve found it shocking easily to use and learn. Of all the zillions of new MS products rolling out of Microsoft, SS is one of the easiest I&amp;#39;ve come across, at least in terms of getting up and running.&lt;/p&gt; &lt;p&gt;Now, chances are that if you have the need to sync data back and forth (for instance, moving data from a database server to your salesforce&amp;#39;s Tablet PC&amp;#39;s), you will have a lot more data on your server than you&amp;#39;d need or be able to use on the remote machine. Even if you wanted all of that data, in many cases you won&amp;#39;t be able to get it all b/c moving it would take forever and the target machine is resource constrained. To that end, the out of the box demo code that ships with SS will need some modification.&lt;/p&gt; &lt;p&gt;The first point I&amp;#39;d make is that Yes, it is possible to sync only portions of the data.&amp;nbsp; This came up recently in one of the newsgroups I frequent and it&amp;#39;s an excellent question.&amp;nbsp; Just to get a conceptual feel for this, think of the same scenario I mentioned earlier. You have a db server and a mobile salesforce (or nursing force, or delivery force, or you&amp;#39;re a large law firm, consulting group, accounting practice...you get the idea) and you only need to sync each target machine with a subset of data. In an ideal world remote users could see everything that&amp;nbsp;users at the&amp;nbsp;home base could, but moving the data could take forever in many large companies. Moreover, you probably wouldn&amp;#39;t need most of it.&amp;nbsp; If you&amp;#39;re a nurse that makes house calls,&amp;nbsp;you probably wouldn&amp;#39;t need information for people that have passed on, or that have moved or even that you&amp;#39;re not visiting. If your device was a PDA, you need to&amp;nbsp;economize on every resource possible. But even if you had a laptop or tablet you still&amp;nbsp;have&amp;nbsp;some resource limits.&amp;nbsp;Hence,&amp;nbsp;envision a case where&amp;nbsp;you might just want to sync only the data related to each person&amp;#39;s active clients (and probably augment the query&amp;#39;s restriction with a date filter of some sort and perhaps an active account indicator) that have engaged in at least one transaction in the last year.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;You could give each person some sort of UI tool which they could initiate that queries the db and writes the data to a file, which they in turn copy over to their machine.&lt;/li&gt; &lt;li&gt;You could do the same thing, but run it as a job so it&amp;#39;s done automatically&lt;/li&gt; &lt;li&gt;You could expose the query results as a web service and let them retrieve data as they needed it&lt;/li&gt; &lt;li&gt;You could export the data to Excel or Access (the latter of which I&amp;#39;ve seen done more times than I care to remember)&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Each of these approaches is easy enough to implement but has major suckiness associated with it.&amp;nbsp; The first approach is one of the simpler ones and fairly fool-proof.&amp;nbsp; Writing out the file is something you could automate via a schedule but not copying it to the device, unless of course you were positive the device would always be available when the job ran.&amp;nbsp; With the web service, you&amp;#39;re depending on internet connectivity which, even in this day where everyone has mobile broadband, there are still a lot of coverage holes. If you had any sort of substantial dataset, pulling it down over a mobile broadband connection would be a doubleplusbad. Copying it to Access or Excel would have the same issues and shortcomings that the first approach, after all it really is the same approach but simply uses a different file format.&lt;/p&gt; &lt;p&gt;Referring to the &lt;font face="Courier New"&gt;SyncServices_CSharp_DownloadOnly&lt;/font&gt; sample included in the Sync Services install, refer to the &lt;font face="Courier New"&gt;SampleServerSyncProvider&lt;/font&gt; method of the &lt;font face="Courier New"&gt;&lt;em&gt;SampleServerSyncProvider.cs&lt;/em&gt;&lt;/font&gt; or &lt;font face="Courier New"&gt;&lt;em&gt;SampleServerSyncProvider.vb&lt;/em&gt;&lt;/font&gt; file, you see the following code (the Author was kind enough to include copious comments which explain each portion - I&amp;#39;ve removed them for readability but would encourage you to refer to them if you&amp;#39;re unfamiliar with Sync Service):&lt;/p&gt; &lt;p&gt;public class SampleServerSyncProvider : DbServerSyncProvider&lt;br /&gt;&amp;nbsp;&amp;nbsp; { &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public SampleServerSyncProvider()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Connection = new SqlConnection(Properties.Settings.Default.ServerConnString); &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;br /&gt;&lt;font color="#0000ff"&gt;string awNewAnchorVariable = &amp;quot;@&amp;quot; + SyncSession.SyncNewReceivedAnchor;&lt;br /&gt;SqlCommand selectNewAnchorCommand = new SqlCommand();&lt;br /&gt;selectNewAnchorCommand.CommandText = &amp;quot;SELECT &amp;quot; + awNewAnchorVariable + &amp;quot; = @@DBTS&amp;quot;;&lt;br /&gt;selectNewAnchorCommand.Parameters.Add(awNewAnchorVariable, SqlDbType.Timestamp);&lt;br /&gt;selectNewAnchorCommand.Parameters[awNewAnchorVariable].Size = 8;&lt;br /&gt;selectNewAnchorCommand.Parameters[awNewAnchorVariable].Direction = ParameterDirection.Output;&lt;br /&gt;selectNewAnchorCommand.Connection = (SqlConnection)this.Connection;&lt;br /&gt;this.SelectNewAnchorCommand = selectNewAnchorCommand;&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&amp;nbsp;SqlSyncAdapterBuilder builder = new SqlSyncAdapterBuilder((SqlConnection)this.Connection); &lt;/p&gt; &lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;font color="#008080"&gt;builder.TableName = &amp;quot;Sales.Customer&amp;quot;;&lt;br /&gt;&amp;nbsp;builder.TombstoneTableName = builder.TableName + &amp;quot;_Tombstone&amp;quot;;&lt;br /&gt;&amp;nbsp;builder.TombstoneFilterClause = filterCommand;&lt;/font&gt;&amp;nbsp; &lt;p&gt;&lt;br /&gt;&amp;nbsp;builder.DataColumns.Add(&amp;quot;CustomerId&amp;quot;);&lt;br /&gt;&amp;nbsp;builder.DataColumns.Add(&amp;quot;CustomerName&amp;quot;);&lt;br /&gt;&amp;nbsp;builder.DataColumns.Add(&amp;quot;SalesPerson&amp;quot;);  &lt;p&gt;&lt;br /&gt;&amp;nbsp;builder.CreationTrackingColumn = &amp;quot;InsertTimestamp&amp;quot;;&lt;br /&gt;&amp;nbsp;builder.UpdateTrackingColumn = &amp;quot;UpdateTimestamp&amp;quot;;&lt;br /&gt;&amp;nbsp;builder.DeletionTrackingColumn = &amp;quot;DeleteTimestamp&amp;quot;;  &lt;p&gt;&lt;br /&gt;&amp;nbsp;SyncAdapter customerSyncAdapter = builder.ToSyncAdapter();&lt;br /&gt;&amp;nbsp;customerSyncAdapter.TableName = &amp;quot;Customer&amp;quot;;&lt;br /&gt;&amp;nbsp;this.SyncAdapters.Add(customerSyncAdapter);&lt;br /&gt;}&lt;/p&gt; &lt;p&gt;}&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;[Note:&amp;nbsp; Even with the comments, some of this code may be hard to follow when you first read it.&amp;nbsp; One thing I did which was very enlightening and always a useful thing to do in such situations is fire up good ole&amp;#39; Sql Profiler, then run the application and see exactly what happens, what objects are being used and what commands are being sent to the db]. &lt;p&gt;I show some of the relevant results from the trace below (I&amp;#39;ve color coded the results to the portion of the code that which caused it to happen): &lt;blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;declare @p3 binary(8)&lt;br /&gt;set @p3=0x0000000000000FA0&lt;br /&gt;exec sp_executesql N&amp;#39;SELECT @sync_new_received_anchor = @@DBTS&amp;#39;,N&amp;#39;@sync_new_received_anchor timestamp &lt;br /&gt;output&amp;#39;,@sync_new_received_anchor=@p3 output&lt;br /&gt;select @p3&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#408080"&gt;exec sp_executesql N&amp;#39;SELECT [CustomerId], [CustomerName], [SalesPerson] FROM Sales.Customer WHERE&amp;nbsp;&lt;br /&gt; (InsertTimestamp &amp;gt; @sync_last_received_anchor AND InsertTimestamp &amp;lt;= &lt;br /&gt;@sync_new_received_anchor)&amp;#39;,N&amp;#39;@sync_last_received_anchor binary(8000),@sync_new_received_anchor &lt;br /&gt;binary(8)&amp;#39;,@sync_last_received_anchor=0x00,@sync_new_received_anchor=0x0000000000000FA0&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#008080"&gt;exec sp_executesql N&amp;#39;SELECT [CustomerId], [CustomerName], [SalesPerson] FROM Sales.Customer WHERE &lt;br /&gt;(CustomerName=&amp;#39;&amp;#39;Sharp Bikes&amp;#39;&amp;#39;) AND (UpdateTimestamp &amp;gt; @sync_last_received_anchor AND UpdateTimestamp &amp;lt;= &lt;br /&gt;@sync_new_received_anchor AND InsertTimestamp &amp;lt;= @sync_last_received_anchor)&amp;#39;,N&amp;#39;@sync_last_received_anchor &lt;br /&gt;timestamp,@sync_new_received_anchor &lt;br /&gt;timestamp&amp;#39;,@sync_last_received_anchor=0x0000000000000000,@sync_new_received_anchor=0x0000000000000FA0&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#008080"&gt;exec sp_executesql N&amp;#39;SELECT [CustomerId], [CustomerName], [SalesPerson], [CustomerType], [DeleteId], &lt;br /&gt;[DeleteTimestamp] FROM Sales.Customer_Tombstone WHERE (CustomerName=&amp;#39;&amp;#39;Sharp Bikes&amp;#39;&amp;#39;) AND (@sync_initialized = 1 &lt;br /&gt;AND DeleteTimestamp &amp;gt; @sync_last_received_anchor AND DeleteTimestamp &amp;lt;= &lt;br /&gt;@sync_new_received_anchor)&amp;#39;,N&amp;#39;@sync_initialized bit,@sync_last_received_anchor &lt;br /&gt;timestamp,@sync_new_received_anchor &lt;br /&gt;timestamp&amp;#39;,@sync_initialized=0,@sync_last_received_anchor=NULL,@sync_new_received_anchor=0x0000000000000FA0&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp; &lt;p&gt;As it stands, the code above is pulling everything from the &lt;font face="Courier New"&gt;Sales.Customer&lt;/font&gt; table.&amp;nbsp; But as I mentioned, chances are that you wouldn&amp;#39;t want the whole resultset. Rather, you&amp;#39;d probably want a filtered subset.&amp;nbsp; For the sake of visual simplicity, I&amp;#39;m going to violate one of my biggest coding Pet Peeves and concatenate a sql statement to include a parameter instead of doing it the right way, but I&amp;#39;ll show the correct way shortly. &lt;p&gt;The &lt;font face="Courier New"&gt;SqlSyncAdapterBuilder&lt;/font&gt; has several properties and for filtering purposes, you can simply set the &lt;font face="Courier New"&gt;FilterClause&lt;/font&gt; property.&amp;nbsp; Starting with the code beginning at the adapter instantiation, I modified the code to just return records that have a &lt;font face="Courier New"&gt;CustomerName&lt;/font&gt; value equal to the literal &amp;#39;&lt;font face="Courier New"&gt;Sharp Bikes&amp;#39; (The relevant portions are included in &lt;strong&gt;Bold &lt;/strong&gt;face)&lt;/font&gt;: &lt;blockquote&gt; &lt;p&gt;SqlSyncAdapterBuilder builder = new SqlSyncAdapterBuilder((SqlConnection)this.Connection);  &lt;p&gt;&lt;br /&gt;&lt;strong&gt;String FilterCommand = &amp;quot;CustomerName=&amp;#39;Sharp Bikes&amp;#39;&amp;quot;;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;builder.TableName = &amp;quot;Sales.Customer&amp;quot;;&lt;br /&gt;builder.TombstoneTableName = builder.TableName + &amp;quot;_Tombstone&amp;quot;;&lt;br /&gt;&lt;strong&gt;builder.FilterClause = FilterCommand ;&lt;br /&gt;builder.TombstoneFilterClause = FilterCommand;&lt;/strong&gt; &lt;/p&gt; &lt;p&gt;builder.SyncDirection = SyncDirection.DownloadOnly;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;So, it&amp;#39;s pretty much this easy, you simply need to set the FilterClause property of the &lt;font face="Courier New"&gt;SqlSyncAdapterBuilder&lt;/font&gt; and absent some really compelling reason to do so, set the &lt;font face="Courier New"&gt;TombStoneFilterClause&lt;/font&gt; to the same value.&amp;nbsp; Because you use the same statement, it&amp;#39;s best to use a String literal so that the two &lt;font face="Courier New"&gt;FilterClause&lt;/font&gt; values don&amp;#39;t get out of sync. Just as you set the &lt;font face="Courier New"&gt;FilterClause&lt;/font&gt; and &lt;font face="Courier New"&gt;TombstoneFilterClause&lt;/font&gt; properties to facilitate filtering, if you use a parameter, you need to add a &lt;font face="Courier New"&gt;SqlParameter&lt;/font&gt; (or &lt;font face="Courier New"&gt;SqlParameter&lt;/font&gt;(s)) to the &lt;font face="Courier New"&gt;FilterParameters&lt;/font&gt; and &lt;font face="Courier New"&gt;TombstoneFilterParameters&lt;/font&gt; collections.&amp;nbsp; So, the below code shows the previous snippet modified to use a &lt;font face="Courier New"&gt;SqlParameter&lt;/font&gt; instead of concatenating the Sql text, again, the relevant portions are included in &lt;strong&gt;Bold &lt;/strong&gt;face: &lt;blockquote&gt; &lt;p&gt;SqlSyncAdapterBuilder builder = new SqlSyncAdapterBuilder((SqlConnection)this.Connection);&lt;br /&gt;SqlParameter CustomerNameParameter = new SqlParameter(&amp;quot;@CustomerName&amp;quot;, SqlDbType.NVarChar);  &lt;p&gt;&lt;br /&gt;&lt;strong&gt;String FilterCommand = &amp;quot;CustomerName=@CustomerName&amp;quot;;&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;builder.TableName = &amp;quot;Sales.Customer&amp;quot;;&lt;br /&gt;builder.TombstoneTableName = builder.TableName + &amp;quot;_Tombstone&amp;quot;;&lt;br /&gt;builder.FilterClause = FilterCommand ;&lt;br /&gt;builder.TombstoneFilterClause = FilterCommand;&lt;br /&gt;&lt;strong&gt;builder.FilterParameters.Add(CustomerNameParameter);&lt;br /&gt;builder.TombstoneFilterParameters.Add(CustomerNameParameter);&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Now the results from Profiler show something notably different: &lt;blockquote&gt; &lt;p&gt;exec sp_executesql N&amp;#39;SELECT [CustomerId], [CustomerName], [SalesPerson] FROM Sales.Customer WHERE &lt;br /&gt;(&lt;font size="3"&gt;&lt;strong&gt;&lt;em&gt;CustomerName=@CustomerName&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;) AND (InsertTimestamp &amp;gt; @sync_last_received_anchor AND InsertTimestamp &amp;lt;= &lt;br /&gt;@sync_new_received_anchor)&amp;#39;,N&amp;#39;@CustomerName nvarchar(11),@sync_last_received_anchor &lt;br /&gt;binary(8000),@sync_new_received_anchor binary(8)&amp;#39;,@&lt;strong&gt;&lt;font size="3"&gt;&lt;em&gt;CustomerName=N&amp;#39;Sharp &lt;br /&gt;Bikes&amp;#39;&lt;/em&gt;&lt;/font&gt;&lt;/strong&gt;,@sync_last_received_anchor=0x00,@sync_new_received_anchor=0x0000000000000FA0&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;exec sp_executesql N&amp;#39;SELECT [CustomerId], [CustomerName], [SalesPerson] FROM Sales.Customer WHERE &lt;br /&gt;(&lt;font size="3"&gt;&lt;strong&gt;&lt;em&gt;CustomerName=@CustomerName&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;) AND (UpdateTimestamp &amp;gt; @sync_last_received_anchor AND UpdateTimestamp &amp;lt;= &lt;br /&gt;@sync_new_received_anchor AND InsertTimestamp &amp;lt;= @sync_last_received_anchor)&amp;#39;,N&amp;#39;@CustomerName &lt;br /&gt;nvarchar(11),@sync_last_received_anchor timestamp,@sync_new_received_anchor timestamp&amp;#39;,@&lt;font size="3"&gt;&lt;strong&gt;&lt;em&gt;CustomerName=N&amp;#39;Sharp &lt;br /&gt;Bikes&amp;#39;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;,@sync_last_received_anchor=0x0000000000000000,@sync_new_received_anchor=0x0000000000000FA0&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;exec sp_executesql N&amp;#39;SELECT [CustomerId], [CustomerName], [SalesPerson], [CustomerType], [DeleteId], &lt;br /&gt;[DeleteTimestamp] FROM Sales.Customer_Tombstone WHERE (&lt;font size="3"&gt;&lt;strong&gt;&lt;em&gt;CustomerName=@CustomerName&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;) AND (@sync_initialized = 1 &lt;br /&gt;AND DeleteTimestamp &amp;gt; @sync_last_received_anchor AND DeleteTimestamp &amp;lt;= &lt;br /&gt;@sync_new_received_anchor)&amp;#39;,N&amp;#39;@CustomerName nvarchar(11),@sync_initialized bit,@sync_last_received_anchor &lt;br /&gt;timestamp,@sync_new_received_anchor timestamp&amp;#39;&lt;font size="3"&gt;&lt;strong&gt;&lt;em&gt;,@CustomerName=N&amp;#39;Sharp &lt;br /&gt;Bikes&amp;#39;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;,@sync_initialized=0,@sync_last_received_anchor=NULL,@sync_new_received_anchor=0x0000000000000FA0&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;You can see here clearly that not only is the &lt;font face="Courier New"&gt;@CustomerName&lt;/font&gt; parameter being used, it&amp;#39;s being set to the literal &lt;font face="Courier New"&gt;Sharp Bikes&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;There&amp;#39;s one catch though when using real parameters. If you modify the code as I did above and try to run it, you&amp;#39;ll encounter the following exception:&lt;/p&gt; &lt;p&gt;&amp;nbsp; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;&lt;font color="#ff0000"&gt;Microsoft.Synchronization.Data.SessionVariableException was unhandled&lt;br /&gt;&amp;nbsp; Message=&amp;quot;Unable to set session parameters in DbServerSyncProvider. Cannot obtain the value for command parameter &amp;#39;@CustomerName&amp;#39;.&amp;quot;&lt;br /&gt;&amp;nbsp; Source=&amp;quot;Microsoft.Synchronization.Data.Server&amp;quot;&lt;br /&gt;&amp;nbsp; SyncSource=&amp;quot;ServerSyncProvider&amp;quot;&lt;br /&gt;&amp;nbsp; StackTrace:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at Microsoft.Synchronization.Data.Server.DbServerSyncProvider.SetSessionParameters(IDbCommand cmd, SyncGroupMetadata groupMetadata, SyncTableMetadata tableMetadata, SyncSession syncSession, DataColumnCollection columns, SyncStage stage)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at Microsoft.Synchronization.Data.Server.DbServerSyncProvider.EnumerateChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession, IDbTransaction transaction, EnumerateChangeType changeType)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at Microsoft.Synchronization.Data.Server.DbServerSyncProvider.GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at Microsoft.Synchronization.SyncAgent.DownloadChanges(SyncGroupMetadata groupMetadata)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at Microsoft.Synchronization.SyncAgent.Synchronize()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at Microsoft.Samples.Synchronization.MainForm.btnSynchronize_Click(Object sender, EventArgs e) in C:\SyncServicesCode\SyncServices_CSharp_DownloadOnly\Client\Forms\MainForm.cs:...&lt;/font&gt;&lt;/em&gt;&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Nothing too shocking though right, after all, although we specified a parameter be used in the &lt;font face="Courier New"&gt;CommandText&lt;/font&gt; property, we never set the value so it&amp;#39;s not surprising that an exception was thrown unless the parameter had a default value, which in this case it clearly did not.  &lt;p&gt;But if you change the code to explicitly set the value for the parameter, for instance like this... &lt;blockquote&gt; &lt;p&gt;SqlParameter CustomerNameParameter = new SqlParameter(&amp;quot;@CustomerName&amp;quot;, SqlDbType.NVarChar);&lt;br /&gt;&lt;strong&gt;CustomerNameParameter.Value = &amp;quot;Sharp Bikes&amp;quot;;&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;you&amp;#39;ll still get the same exception.&amp;nbsp; This really threw me for a loop b/c I used the debugger and &lt;em&gt;proved&lt;/em&gt; to myself that the value wasn&amp;#39;t null or left out. If you step through with the debugger, you can verify for yourself that the above code is in fact setting the value of &lt;font face="Courier New"&gt;@CustomerName = &amp;quot;Sharp Bikes&amp;quot;&lt;/font&gt; &lt;p&gt;One point that&amp;#39;s extremely important... Normally, as long as you modify your &lt;font face="Courier New"&gt;CommandText&lt;/font&gt; to refer to the&amp;nbsp;&lt;font face="Courier New"&gt;SqlParameter&lt;/font&gt;&amp;nbsp; and&amp;nbsp;add a &lt;font face="Courier New"&gt;SqlParameter&lt;/font&gt; object to a &lt;font face="Courier New"&gt;SqlCommand&lt;/font&gt; object&amp;#39;s &lt;font face="Courier New"&gt;Parameters&lt;/font&gt; collection, you don&amp;#39;t need to do anything else. But as I just babbled on about, that won&amp;#39;t cut it here... something is still missing. &lt;p&gt;As it turns out, (and makes perfect sense once I cleared my tunnel vision), the &lt;font face="Courier New"&gt;SyncAgent &lt;/font&gt;(&lt;em&gt;Microsoft.Synchronization.SyncAgent&lt;/em&gt;) class is what actually does much of the heavy lifting and just because you have a Parameter referenced in code in your &lt;font face="Courier New"&gt;SqlSyncAdapterBuilder&lt;/font&gt;, the &lt;font face="Courier New"&gt;SyncAgent&lt;/font&gt; doesn&amp;#39;t know anything about it. Since it doesn&amp;#39;t know anything about it, it doesn&amp;#39;t know to pass in a value or what value to pass to it, so when it tries to finish processing the value for the parameter isn&amp;#39;t set. It didn&amp;#39;t matter that we set it explicitly because we set it in the wrong place. &lt;p&gt;Fortunately, it&amp;#39;s very easy to address.&amp;nbsp; The code below is the&lt;font face="Courier New"&gt; SyncAgent&amp;#39;s&lt;/font&gt; code, the last line in Bold is what you need to add if you&amp;#39;re using a parameterized filter: &lt;p&gt;public class SampleSyncAgent : Microsoft.Synchronization.SyncAgent&lt;br /&gt;&amp;nbsp;{ &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public SampleSyncAgent()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SqlCeClientSyncProvider clientSyncProvider = new SqlCeClientSyncProvider(Properties.Settings.Default.ClientConnString, true);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.LocalProvider = clientSyncProvider;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clientSyncProvider.ChangesApplied += new EventHandler&amp;lt;ChangesAppliedEventArgs&amp;gt;(clientSyncProvider_ChangesApplied);  &lt;p&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.RemoteProvider = new SampleServerSyncProvider();  &lt;p&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SyncTable customerSyncTable = new SyncTable(&amp;quot;Customer&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customerSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customerSyncTable.SyncDirection = SyncDirection.DownloadOnly;  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Configuration.SyncTables.Add(customerSyncTable);&lt;br /&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Configuration.SyncParameters.Add(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new SyncParameter(&amp;quot;@CustomerName&amp;quot;, &amp;quot;Sharp Bikes&amp;quot;));&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;p&gt;} &lt;p&gt;(Part of this class was left out for brevity - all that is missing is the private variables and their corresponding public properties). &lt;p&gt;The corresponding code is available &lt;a href="http://www.williamgryan.com/downloads/code/syncservices" target="_blank"&gt;Here&lt;/a&gt;.&amp;nbsp; Please note that this code is taken from the Synchronization Services samples that are included when you install Synchronization Services.&amp;nbsp; I merely modified that code to support parameterized filters.&amp;nbsp; I will be adding a UI Element on the MainForm object so that you can set the value dynamically instead of hard coding it as I did.&amp;nbsp; Again, although this post is a little long, we really are talking about basically adding less than 10 lines of code to add filtering. You need to set the FilterClause, the TombstoneFilterClause, FilterParameters, TombstoneFilterParameters and then add a SyncParameter to the SyncAgent.&amp;nbsp; As you can infer, you if you need more expressions, you can just add them accordingly to meet whatever your requirements happen to be. &lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1308509" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Compact+Framework/default.aspx">Compact Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Coding+Techniques/default.aspx">Coding Techniques</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/ADO.NET+Synchronization+Services/default.aspx">ADO.NET Synchronization Services</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+3.0+Framework/default.aspx">.NET 3.0 Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/DBServerSyncProvider/default.aspx">DBServerSyncProvider</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Synchronization+Services/default.aspx">Synchronization Services</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/SyncAgent/default.aspx">SyncAgent</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Microsoft.Synchronization/default.aspx">Microsoft.Synchronization</category></item><item><title>Free Silverlight Training</title><link>http://msmvps.com/blogs/williamryan/archive/2007/08/14/free-silverlight-training.aspx</link><pubDate>Tue, 14 Aug 2007 19:53:43 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1111448</guid><dc:creator>William</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=1111448</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=1111448</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2007/08/14/free-silverlight-training.aspx#comments</comments><description>&lt;p&gt;My friend &lt;a href="http://msmvps.com/blogs/brianmadsen/default.aspx" target="_blank"&gt;Brian Madsen&lt;/a&gt;&amp;nbsp;who owns &lt;a href="http://www.csharpzealot.com" target="_blank"&gt;CSharpZealot&lt;/a&gt;&amp;nbsp;has teamed up with &lt;a href="http://www.innerworkings.com/promotions/664b06ea-357c-4730-8cb0-44376cceb865/csharpzealot-silverlight-promotion" target="_blank"&gt;InnerWorkings&lt;/a&gt; to extend a really slick offer for &lt;a href="http://msmvps.com/blogs/brianmadsen/archive/2007/08/14/innerworkings-steps-up-and-offers-free-silverlight-training-for-csharpzealot-com-members.aspx" target="_blank"&gt;Free Silverlight Training for CSharpZealot members&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;In addition, &lt;a href="http://adoguy.com/" target="_blank"&gt;Shawn Wildermuth&lt;/a&gt;&amp;nbsp;has been way ahead of the crowd when it comes to &lt;a href="http://silverlight.net/Default.aspx" target="_blank"&gt;Silverlight&lt;/a&gt; and has just created two more &lt;a href="http://adoguy.com/2007/08/10/Two_new_Silverlight_Videos!.aspx" target="_blank"&gt;Silverlight Videos&lt;/a&gt;.&amp;nbsp; His &lt;a href="http://www.adoguy.com" target="_blank"&gt;ADO Guy site&lt;/a&gt;&amp;nbsp;has an entire &lt;a href="http://adoguy.com/silverlight/" target="_blank"&gt;Section dedicated to Silverlight&lt;/a&gt;&amp;nbsp;and well, Shawn is gifted in many areas but when it comes to teaching, no one does it better.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;On a similar note, my company recently sponsored an internal Silverlight contest where our different offices are competing to build the best game written in Silverlight.&amp;nbsp; They put there money where their mouth is so the first place prize is pretty impressive.&amp;nbsp; I&amp;#39;ve had my nose in the keyboard for the past few weeks trying to help my team win.&amp;nbsp; If you&amp;#39;re interested in learning &lt;a href="http://silverlight.net/" target="_blank"&gt;Silverlight&lt;/a&gt;, one great place to get started is &lt;a href="http://silverlight.net/GetStarted/" target="_blank"&gt;Here&lt;/a&gt;.&amp;nbsp; Microsoft really did the right thing with &lt;a href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx" target="_blank"&gt;Orcas (VS 2008)&lt;/a&gt; and even provides ready to run (almost anyway) &lt;a href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx" target="_blank"&gt;VPC images&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Hopefully when I get some time I can start doing some more in depth &lt;a href="http://www.silverlight.net/" target="_blank"&gt;Silverlight&lt;/a&gt; blogging but let me make a few recommendations.&amp;nbsp; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;Use the VPC images for Orcas.&amp;nbsp; The reasons are the same for any other alpha or beta product you&amp;#39;d want to install but outside of isolation and reducing risk, the time factor is huge.&amp;nbsp; Using the VPC images, you can be up and running in under 5 minutes once you have them downloaded.&amp;nbsp;Benefits like this are really hard to quantify but I can tell you personally that at times, getting my environment set up without VPC images was frustrating to say the least.&lt;/li&gt; &lt;li&gt;Although it&amp;#39;s often prudent to learn to code things without all the crutches that a powerful IDE provide, creating Silverlight with Intellisense and a designer is probably not a very effective way to start things.&amp;nbsp; Unless you are really familiar with WPF already, the syntax takes a little getting used to and there&amp;#39;s a lot of room to mess things up with typos.&lt;/li&gt; &lt;li&gt;In addition to &lt;a href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx" target="_blank"&gt;Orcas&lt;/a&gt;, make sure you pull down &lt;a href="http://www.microsoft.com/Expression/products/download.aspx?key=blend2preview" target="_blank"&gt;Expression Blend and Design&lt;/a&gt;.&amp;nbsp; Blend allows you to create Graphics with &lt;a href="http://www.xaml.net/" target="_blank"&gt;XAML&lt;/a&gt;.&amp;nbsp; I&amp;#39;ve already had a few &lt;a href="http://www.getpaint.net/" target="_blank"&gt;Paint.NET&lt;/a&gt; and &lt;a href="http://www.adobe.com/products/photoshop/index.html" target="_blank"&gt;Photoshop&lt;/a&gt; fanatics get all over me for plugging Blend, but I think they are off base. I&amp;#39;m not advocating replacing Photoshop or Paint.NET with Blend. Blend however, allows one to create images with XAML.&amp;nbsp; You in turn can look at the XAML that is generated and use it to help understand and learn XAML.&amp;nbsp; If you did much Office automation, you more than likely &amp;#39;cheated&amp;#39; in the sense that you just ran a macro and saw the code that was generated and used this as a mechanism to learn VBA and get past sticking points.&amp;nbsp; Blend allows you to do the same thing.&amp;nbsp; Sure, hardcore &amp;#39;real&amp;#39; developers do everything in Notepad but if you want to get up to speed, using a tool to help you draw the effects you want and then being able to disassemble the XAML that was generated will get you where you want to be a LOT faster.&lt;/li&gt; &lt;li&gt;Pull down each of the items in the &lt;a href="http://silverlight.net/community/communitygallery.aspx" target="_blank"&gt;Gallery&lt;/a&gt;&amp;nbsp;and work through the &lt;a href="http://silverlight.net/quickstarts/" target="_blank"&gt;QuickStarts&lt;/a&gt;.&amp;nbsp; These encompass many common kick a55 effects and you can reverse engineer them to see learn how to do quite a bit.&lt;/li&gt; &lt;li&gt;I have some pretty strong opinions on the books out there but even if a book doesn&amp;#39;t address Silverlight specifically (most of them however have updated versions which do include Silverlight), you can still learn quite a bit because you are ultimately going to need to really understand WPF and XAML.&amp;nbsp; I really want to gather my thoughts a little better before making any more book recommendations because although all of the WPF books out there are pretty good, some are a lot more helpful than others when it comes to learning Silverlight&lt;/li&gt; &lt;li&gt;Read Shawn Wildermuth&amp;#39;s &lt;a href="http://www.adoguy.com/silverlight" target="_blank"&gt;Silverlight posts&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Personally, since I&amp;#39;m not&amp;nbsp; a designer and very challenged when it comes to graphics, I had a pretty rough time at the beginning of my learning curve. Little by little though, I&amp;#39;m getting through it and hopefully I&amp;#39;ll have some blogworthy material to post soon. As always, if you have any specific questions, please let me know and I&amp;#39;ll be glad to answer what I can.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1111448" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Life+in+General/default.aspx">Life in General</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+Basics/default.aspx">.NET Basics</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Me/default.aspx">Me</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+General/default.aspx">.NET General</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Coding+Techniques/default.aspx">Coding Techniques</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Misc+Technology/default.aspx">Misc Technology</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WPF/default.aspx">WPF</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+3.0+Framework/default.aspx">.NET 3.0 Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WPF_2F00_E/default.aspx">WPF/E</category></item><item><title>Pro WCF: Practical Microsoft SOA Implementation</title><link>http://msmvps.com/blogs/williamryan/archive/2007/02/18/pro-wcf-practical-microsoft-soa-implementation.aspx</link><pubDate>Sun, 18 Feb 2007 23:41:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:595155</guid><dc:creator>William</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=595155</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=595155</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2007/02/18/pro-wcf-practical-microsoft-soa-implementation.aspx#comments</comments><description>&lt;P&gt;I went on&amp;nbsp; a book binge this week and have had my nose buried in WCF all week.&amp;nbsp; There's a lot of really good stuff out there, but without a doubt, &lt;A href="http://www.amazon.com/Pro-WCF-Practical-Microsoft-Implementation/dp/1590597028/sr=8-1/qid=1171842173/ref=pd_bbs_sr_1/102-7496017-5356110?ie=UTF8&amp;amp;s=books"&gt;Pro WCF: Practical Microsoft SOA Implementation&lt;/A&gt;&amp;nbsp;by &lt;A href="http://www.chrispeiris.com/"&gt;Chris Peiris&lt;/A&gt;&amp;nbsp;is probably my favorite.&lt;/P&gt;
&lt;P&gt;Overall, the book is just over 400 pages but the author says quite a bit in those 400 pages.&amp;nbsp; The coolest part is that they go over just about every topic that the MSDN Documentation is short on.&amp;nbsp; I found that a lot of things that I stumbled my way through were covered there as well.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I can't find the link, but a while ago, &lt;A href="http://www.brains-n-brawn.com/"&gt;KC&lt;/A&gt; had a post where his server program uploaded&amp;nbsp;itself&amp;nbsp;his web server and ran itself. His comment was something to the effect about "What did the first Blacksmith use".&amp;nbsp; I was always really impressed with that program. And not just b/c &lt;A href="http://www.brains-n-brawn.com/"&gt;of the lower cased one&lt;/A&gt;'s coding skill. The idea itself was really cool.&amp;nbsp; So when&amp;nbsp;&amp;nbsp;&lt;A href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx"&gt;WSE 3.0&lt;/A&gt; came out and &lt;A href="http://en.wikipedia.org/wiki/MTOM"&gt;MTOM&lt;/A&gt;&amp;nbsp; was implemented, I tried to bite his style and accomplish the same thing with MTOM. It's an easy port so it didn't take much skill on my part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Anyway, I've been trying to figure out how to port most of the WSE 3.0 code from&amp;nbsp; my 70-529 book over to WCF. I've been able to do most of it, however it's been frustrating at times.&amp;nbsp; I'm make a lot of typos and copy/paste errors and neither play well with .config files.&amp;nbsp; After wasting about 3 hours trying to get the MTOM port to work, I read through this book and Viola'. I was kinda mad at myself for overcomplicating things that much.&amp;nbsp; So I guess I really like the book in large part b/c I've had quite a few similar experiences with it.&lt;/P&gt;
&lt;P&gt;My favorite chapters are discussed below:&lt;/P&gt;
&lt;P&gt;Chapter 4 - It discusses installation and configuration.&amp;nbsp; This is the single most frustrating area when learning WCF.&amp;nbsp; Writing code instead of using .config files is lame so I try to avoid it. But getting some help in avoiding common mistakes is priceless..&lt;/P&gt;
&lt;P&gt;Chatper 6 discusses managing WCF Services. Not a glamorous subject but being able to monitor and troubleshoot your programs is critical.&amp;nbsp; Moreover, when you're first learning how to do things, it's easy to ignore performance. It's easy to overlook things that can kill performance.&amp;nbsp; After reading this chapter, I am in a lot better shape to find problems&lt;/P&gt;
&lt;P&gt;Chaper 7 discusses security. Obviously a pretty big issue when you're building services.&amp;nbsp; Just for good measure there's some CardSpace stuff at the end which was a nice touch.&lt;/P&gt;
&lt;P&gt;Chapter 9 discusses transactions. For obvious reasons, this is a subject you need to learn well and although I thought I was pretty familiar with them, I learned more than a few things from this chapter.&lt;/P&gt;
&lt;P&gt;-------------------&lt;/P&gt;
&lt;P&gt;All in all, this book was pretty impressive.&amp;nbsp; They do mostly real world stuff and while they certainly talk theory, they stick to stuff that you'll encounter in your day to day development.&amp;nbsp; You can only take so much theory and I've found that the documentation on MSDN is really heavy on theory and not enough implementation.&amp;nbsp; This book will bridge that gap. &lt;A href="http://www.amazon.com/Professional-WCF-Programming-Development-Communication/dp/0470089849/sr=1-1/qid=1171843376/ref=sr_1_1/102-7496017-5356110?ie=UTF8&amp;amp;s=books"&gt;Scott Klein's WCF book&lt;/A&gt;&amp;nbsp;will help quite a bit too but won't be out for another month or two. &lt;/P&gt;
&lt;P&gt;I also picked up &lt;A href="http://www.amazon.com/Microsoft-Windows-Communication-Foundation-Developer/dp/0735623368/sr=1-1/qid=1171843548/ref=sr_1_1/102-7496017-5356110?ie=UTF8&amp;amp;s=books"&gt;John Sharp's Microsoft Windows Communication Foundation &lt;EM&gt;Step by Step&lt;/EM&gt;&lt;/A&gt;.&amp;nbsp; So far, my impressions are quite favorable although I haven't went through it in quite the detail I did with this one.&amp;nbsp; I worked through each of the examples and found them pretty cool.&amp;nbsp; Should have a review of it up shortly.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=595155" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Books/default.aspx">Books</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+General/default.aspx">.NET General</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Visual+Studio+.NET+2005/default.aspx">Visual Studio .NET 2005</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WCF/default.aspx">WCF</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WIndows+Communication+Foundation/default.aspx">WIndows Communication Foundation</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+3.0+Framework/default.aspx">.NET 3.0 Framework</category></item><item><title>Is my Windows Communication Foundaton Service configured correctly?</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/27/is-my-windows-communication-foundaton-service-configured-correctly.aspx</link><pubDate>Sat, 27 Jan 2007 23:55:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:524288</guid><dc:creator>William</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=524288</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=524288</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2007/01/27/is-my-windows-communication-foundaton-service-configured-correctly.aspx#comments</comments><description>&lt;P&gt;One of the really sucky things about doing presentations is that you have to learn what you're talking about first.&amp;nbsp; Actually, there's nothing sucky about learning things, it's just that at until you hit your learning curve, it can be frustrating.&amp;nbsp; It's after that point though that things become sucky.&amp;nbsp; Why?&amp;nbsp; Because all too often you start going "Wow, is this cool, I wonder if I can_____________" and then you give it a try. Some stuff works on the first pass, some stuff doesn't.&amp;nbsp; Then you start debugging and searching around, figure out how to make it work and you in my case, it usually takes something like the dog pooping on the floor to make me realize how long I've been zoned out on the computer.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;If you're familiar with Windows Communication Foundation (WCF) then you realize that it's so configurable its almost hard to fathom (I really woulnd't be surprised if the next version negates the need for code altogether and you simply flip around config file settings to do what you want).&amp;nbsp; Configuration is as cool as hard coding stuff is lame, but one problem with it is that it's fussy.&amp;nbsp; If you screw something up in a XAML file (which is similar in form to config files) for instance, the compiler jumps in and lends you a hand telling you rather precisely what you did wrong. If you screw something up in a configuration file for WCF, you get the same behavior you did with .NET Remoting (for the uninitiated, that means it just sits there and laughs at you as you try to figure out which word you incorrectly spelled).&lt;/P&gt;
&lt;P&gt;So I'm trudging through a bunch of samples I was thinking about and then realized most of what I've done entails hosting the service in a Console application.&amp;nbsp; Time to take off the training wheels and host it in IIS right?&amp;nbsp; I ask myself "Hell, how hard can that be?"&lt;/P&gt;
&lt;P&gt;I created my virtual director and started copying stuff over.&amp;nbsp; Carefully, I changed my configuration file settings.&amp;nbsp; Just to be safe I left out all the fancy stuff I was doing with CustomBindings and just left in the simple stuff.&amp;nbsp; "This should be a breeze" I'm thinking the whole time.&amp;nbsp; So far so good.&amp;nbsp; Normally, as I progress along each step of the way I test that part to make sure I got it right up until then, just so it's easier to isolate problems down the road should they arise.&amp;nbsp; My ego got ahead of my brain and off I went.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&lt;CODE&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;configuration&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;xmlns&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;http://schemas.microsoft.com/.NetConfiguration/v2.0&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;system.serviceModel&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;services&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;service&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;MarkBrownService&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;behaviorConfiguration&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;returnFaults&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;endpoint&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;contract&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;IKnightEmailHelper&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;binding&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;wsHttpBinding&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt; &lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;service&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;service&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;BlueCuckooService&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;behaviorConfiguration&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;returnFaults&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;endpoint&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;contract&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;IPeck &lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;binding&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;wsHttpBinding&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt; &lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;service&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;service&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;SausageDogService&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;behaviorConfiguration&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;returnFaults&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;endpoint&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;contract&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ITakeADump&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;binding&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;wsHttpBinding&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;service&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;service&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DigitalStripperService&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;behaviorConfiguration&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;returnFaults&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;endpoint&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;contract&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;IStrip&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;binding&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;wsHttpBinding&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;service&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;Now, the first of these is really lame but the other three do quite a bit of stuff.&amp;nbsp; I do a second glance to make sure everything looks ok and it does.&amp;nbsp; I hand coded the client classes and was pretty sure they were good. So I fire everyting up and I see this:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;The contract name 'IPeck ' could not be found in the list of contracts implemented by the service 'BlueCuckooService'.&lt;/EM&gt; &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;The contract name 'ITakeADump ' could not be found in the list of contracts implemented by the service 'SausageDogService'.&lt;/EM&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;The contract name 'IStrip ' could not be found in the list of contracts implemented by the service 'DigitalStripperService'.&lt;/EM&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Wheewwwy, I screwed up every single one of them.&amp;nbsp; So I tried to eliminate them one at a time, same problem.&amp;nbsp; I check the name, check the interface name.&amp;nbsp; Both look good.&amp;nbsp; So what have I done differently?&amp;nbsp; I put the interfaces into a shared assembly, that must be it.&amp;nbsp; So I removed the project reference and copied the classes back into the project.&amp;nbsp; Double checked the namespaces and figured, this has to be it. But it wasn't.&amp;nbsp; I went through everything I could think of and nothing.&amp;nbsp; Fortunately, Nikki the sausage dog got that look in his eye that he usually does right before chewing up one of my shoes or taking a dump on the floor and sharing it with me.&amp;nbsp; Upon getting up I realized I had&amp;nbsp;went wayy tooo far down WindowsCommuncationFoundation express today and needed to do other things like walk the dog.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;When I arrived back, I saw what the problem was by the time I got comfortably seating.&amp;nbsp; A lot of times things just work like that.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;So, take one last look at the problem and see if you can figure it out - it's totally glaring if you're careful. (If you've been a reader of my blog for a while, it's&amp;nbsp; a well known thing that I due and have done the same thing many times before.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I tend to type fairly quickly and while I use both thumps to space with, I frequently double this the space bar.&amp;nbsp; In T-SQL and C#, it seldom matters. MS Word and Excel both just fix it for me.&amp;nbsp; So I don't even realize I"m doing it. But configuration files - well, I think that they were made by a bunch of German guys who though it'd be a great goof to give guys like me a hard time "So uuwwe really sink dat Lexus have betta quality control den der BMW, You fool, we'll teach you a lesson!"&lt;/P&gt;
&lt;P&gt;So I looked around and looked around and realized I put an extra space in after an interface name. Ok, that's fixed. All is good. But each new service I added suffered from the same problem. This time I knew exactly what it was, but it was easy to mess up b/c of muscle memory in my fingers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;A quick way to know if you're service is configured correctly is as simple as one like in a browers:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://localhost:2361/CuckooService/EvilBlueCuckooService.svc?wsdl"&gt;&lt;CODE&gt;http://localhost:2361/CuckooService/EvilBlueCuckooService.svc?wsdl&lt;/CODE&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Substitute the name and location of your service(s) and use the good old ?wsdl method to make sure it works. If everything is in place, a browser window with a bunch of nested funky looking&amp;nbsp;xml should appear that looks like your service definition.&amp;nbsp; If not, well you gotta problem.&amp;nbsp; So simple to use, it's worth it's price in gold.&lt;/P&gt;
&lt;P&gt;So far, I got the images of the Cuckoo coming out of his clock, the SausageDog making "pinchy loaf loaf" all wired into to a client UI.&amp;nbsp; If any of my reliable friends like &lt;A href="http://www.brains-n-brawn.com/"&gt;KC&lt;/A&gt;&amp;nbsp;, &lt;A href="http://msmvps.com/blogs/brianmadsen/"&gt;Brian Madsen&lt;/A&gt;&amp;nbsp;, &lt;A href="http://blah.winsmarts.com/"&gt;Sahil&lt;/A&gt;&amp;nbsp;or &lt;A href="http://community.strongcoders.com/blogs/default.aspx"&gt;Ryan&lt;/A&gt;&amp;nbsp;wanna help me with the UI for the last one, I got the back end stuff worked out ;-)&lt;/P&gt;
&lt;P&gt;And hopefully none of the &lt;A href="http://www.charlescarroll.com/"&gt;Usual&lt;/A&gt; and &lt;A href="mailto:knightsofasproundtable@yahoogroups.com" target=_blank&gt;BrainWashedGrievance Brigade&lt;/A&gt;&lt;BR&gt;&amp;nbsp;will try to pee on our parade.&amp;nbsp; I have a lot of fun WCF samles which are pretty cool.&lt;/P&gt;
&lt;P&gt;My next WCF post will be on "Doing things with Behaviors most people can only dream about..."&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=524288" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WCF/default.aspx">WCF</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Service/default.aspx">Service</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/_2E00_config/default.aspx">.config</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/EndPoint/default.aspx">EndPoint</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WIndows+Communication+Foundation/default.aspx">WIndows Communication Foundation</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+3.0+Framework/default.aspx">.NET 3.0 Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/ConfigurationFile/default.aspx">ConfigurationFile</category></item></channel></rss>