<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Rolling Out a Custom WCF Software Updater for Win Forms / WPF</title>
	<atom:link href="http://goneale.com/2009/09/22/rolling-out-a-custom-software-updater-for-win-forms-wpf/feed/" rel="self" type="application/rss+xml" />
	<link>http://goneale.com/2009/09/22/rolling-out-a-custom-software-updater-for-win-forms-wpf/</link>
	<description>Graham O&#039;Neale – Deep In .NET Development: ASP.NET, MVC, jQuery, WPF, WCF, Silverlight</description>
	<lastBuildDate>Wed, 28 Sep 2011 23:00:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Steve Jensen</title>
		<link>http://goneale.com/2009/09/22/rolling-out-a-custom-software-updater-for-win-forms-wpf/comment-page-1/#comment-33292</link>
		<dc:creator>Steve Jensen</dc:creator>
		<pubDate>Tue, 05 Jul 2011 23:25:22 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.com/?p=855#comment-33292</guid>
		<description>Hi, Graham
Thanks for getting back to me on this.  What happens when I include the 5 projects into an existing solution is the My namespace is ambiguous.  This particular project is an Outlook addin, also, so the versioning information has to come from the My namespace, otherwise it shows the version of Outlook.

I&#039;ve tried changing the root namespace of the updater projects but this does not resolve the problem.

Also, changing the framework to 4.0 causes the service to fail - is this a schema issue?</description>
		<content:encoded><![CDATA[<p>Hi, Graham<br />
Thanks for getting back to me on this.  What happens when I include the 5 projects into an existing solution is the My namespace is ambiguous.  This particular project is an Outlook addin, also, so the versioning information has to come from the My namespace, otherwise it shows the version of Outlook.</p>
<p>I&#8217;ve tried changing the root namespace of the updater projects but this does not resolve the problem.</p>
<p>Also, changing the framework to 4.0 causes the service to fail &#8211; is this a schema issue?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham O'Neale</title>
		<link>http://goneale.com/2009/09/22/rolling-out-a-custom-software-updater-for-win-forms-wpf/comment-page-1/#comment-33290</link>
		<dc:creator>Graham O'Neale</dc:creator>
		<pubDate>Tue, 05 Jul 2011 23:14:37 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.com/?p=855#comment-33290</guid>
		<description>Hi Steve,

Sorry for the delays in posting back to you, if you haven&#039;t figured it out yet, &#039;var&#039; denotes the type will be inferred by Visual Studio and resolve based on whatever is assigned to it (implicitly typed, I think!) so to convert that piece of code you wanted you would most likely be looking at:

For Each destinationProperty As PropertyInfo In destination.GetType().GetProperties()

I think. You don&#039;t need the brackets, and I&#039;m not sure how you do var in VB.NET, so just cast it as PropertyInfo, what it should be (we know this as we look at the returning type of GetProperties())

For a helpful guide on translation between c# and VB.NET see here http://www.harding.edu/fmccown/vbnet_csharp_comparison.html


As for your updater not working, hmmm :( sad to hear you are having problems incorporating it! Are you receiving errors? What namespace problems are you having? Do you use ReSharper (http://www.jetbrains.com/resharper) that might give you more insight into problematic or mismatching namespaces.

You should just be able to test the Version of the current running assembly. Sample updater app, or your own app. Good luck!

Graham</description>
		<content:encoded><![CDATA[<p>Hi Steve,</p>
<p>Sorry for the delays in posting back to you, if you haven&#8217;t figured it out yet, &#8216;var&#8217; denotes the type will be inferred by Visual Studio and resolve based on whatever is assigned to it (implicitly typed, I think!) so to convert that piece of code you wanted you would most likely be looking at:</p>
<p>For Each destinationProperty As PropertyInfo In destination.GetType().GetProperties()</p>
<p>I think. You don&#8217;t need the brackets, and I&#8217;m not sure how you do var in VB.NET, so just cast it as PropertyInfo, what it should be (we know this as we look at the returning type of GetProperties())</p>
<p>For a helpful guide on translation between c# and VB.NET see here <a href="http://www.harding.edu/fmccown/vbnet_csharp_comparison.html" rel="nofollow">http://www.harding.edu/fmccown/vbnet_csharp_comparison.html</a></p>
<p>As for your updater not working, hmmm <img src='http://goneale.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  sad to hear you are having problems incorporating it! Are you receiving errors? What namespace problems are you having? Do you use ReSharper (<a href="http://www.jetbrains.com/resharper" rel="nofollow">http://www.jetbrains.com/resharper</a>) that might give you more insight into problematic or mismatching namespaces.</p>
<p>You should just be able to test the Version of the current running assembly. Sample updater app, or your own app. Good luck!</p>
<p>Graham</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Jensen</title>
		<link>http://goneale.com/2009/09/22/rolling-out-a-custom-software-updater-for-win-forms-wpf/comment-page-1/#comment-33235</link>
		<dc:creator>Steve Jensen</dc:creator>
		<pubDate>Tue, 05 Jul 2011 04:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.com/?p=855#comment-33235</guid>
		<description>:cry: OK, I have the updater working as a stand-alone project but if I try to incorporate it into an existing solution, I end up in namespace hell. I&#039;ve tried everyting I can think of, to no avail. Do you have some notes on how to incorporate the updater into an existing application (ie, check the version of the application, not the updater)?
Thanks,
Steve</description>
		<content:encoded><![CDATA[<p> <img src='http://goneale.com/wp-includes/images/smilies/icon_cry.gif' alt=':cry:' class='wp-smiley' />  OK, I have the updater working as a stand-alone project but if I try to incorporate it into an existing solution, I end up in namespace hell. I&#8217;ve tried everyting I can think of, to no avail. Do you have some notes on how to incorporate the updater into an existing application (ie, check the version of the application, not the updater)?<br />
Thanks,<br />
Steve</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Jensen</title>
		<link>http://goneale.com/2009/09/22/rolling-out-a-custom-software-updater-for-win-forms-wpf/comment-page-1/#comment-33144</link>
		<dc:creator>Steve Jensen</dc:creator>
		<pubDate>Sun, 03 Jul 2011 05:33:31 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.com/?p=855#comment-33144</guid>
		<description>OK, got it working.  I posted the code on the Cloning Object Properties post, but here it is again:

 Public Module ReflectionExtensions
		&#039;&#039;&#039; 
		&#039;&#039;&#039; Clone properties from an original object to a destination object.
		&#039;&#039;&#039; See for more info: http://goneale.com/2009/02/16/cloning-object-properties-via-reflection/
		&#039;&#039;&#039; NOTE: Does not currently handle list&#039;s.
		&#039;&#039;&#039; 
		&#039;&#039;&#039; 
		&#039;&#039;&#039; 
		&#039;&#039;&#039; 
		&#039;&#039;&#039; 
         _
        Public Sub CloneProperties(Of T1, T2)(ByVal origin As T1, ByVal destination As T2)
            &#039; Instantiate if necessary
            If destination Is Nothing Then
                Throw New ArgumentNullException(&quot;destination&quot;, &quot;Destination object must first be instantiated.&quot;)
            End If
            &#039; Loop through each property in the destination
            For Each destinationProperty As Reflection.PropertyInfo In destination.[GetType]().GetProperties()
                &#039; find and set val if we can find a matching property name and matching type in the origin with the origin&#039;s value               
                If origin IsNot Nothing AndAlso destinationProperty.CanWrite Then
                    For Each originProperty As Reflection.PropertyInfo In origin.[GetType]().GetProperties()
                        If destinationProperty.CanWrite AndAlso originProperty.CanRead AndAlso (originProperty.Name = destinationProperty.Name AndAlso originProperty.PropertyType Is destinationProperty.PropertyType) Then
                            destinationProperty.SetValue(destination, originProperty.GetValue(origin, Nothing), Nothing)
                        End If
                    Next
                End If
            Next

        End Sub
	End Module

The C# to VB converters are pretty good but not perfect...</description>
		<content:encoded><![CDATA[<p>OK, got it working.  I posted the code on the Cloning Object Properties post, but here it is again:</p>
<p> Public Module ReflectionExtensions<br />
		&#8221;&#8217;<br />
		&#8221;&#8217; Clone properties from an original object to a destination object.<br />
		&#8221;&#8217; See for more info: <a href="http://goneale.com/2009/02/16/cloning-object-properties-via-reflection/" rel="nofollow">http://goneale.com/2009/02/16/cloning-object-properties-via-reflection/</a><br />
		&#8221;&#8217; NOTE: Does not currently handle list&#8217;s.<br />
		&#8221;&#8217;<br />
		&#8221;&#8217;<br />
		&#8221;&#8217;<br />
		&#8221;&#8217;<br />
		&#8221;&#8217;<br />
         _<br />
        Public Sub CloneProperties(Of T1, T2)(ByVal origin As T1, ByVal destination As T2)<br />
            &#8216; Instantiate if necessary<br />
            If destination Is Nothing Then<br />
                Throw New ArgumentNullException(&#8220;destination&#8221;, &#8220;Destination object must first be instantiated.&#8221;)<br />
            End If<br />
            &#8216; Loop through each property in the destination<br />
            For Each destinationProperty As Reflection.PropertyInfo In destination.[GetType]().GetProperties()<br />
                &#8216; find and set val if we can find a matching property name and matching type in the origin with the origin&#8217;s value<br />
                If origin IsNot Nothing AndAlso destinationProperty.CanWrite Then<br />
                    For Each originProperty As Reflection.PropertyInfo In origin.[GetType]().GetProperties()<br />
                        If destinationProperty.CanWrite AndAlso originProperty.CanRead AndAlso (originProperty.Name = destinationProperty.Name AndAlso originProperty.PropertyType Is destinationProperty.PropertyType) Then<br />
                            destinationProperty.SetValue(destination, originProperty.GetValue(origin, Nothing), Nothing)<br />
                        End If<br />
                    Next<br />
                End If<br />
            Next</p>
<p>        End Sub<br />
	End Module</p>
<p>The C# to VB converters are pretty good but not perfect&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Jensen</title>
		<link>http://goneale.com/2009/09/22/rolling-out-a-custom-software-updater-for-win-forms-wpf/comment-page-1/#comment-33138</link>
		<dc:creator>Steve Jensen</dc:creator>
		<pubDate>Sun, 03 Jul 2011 02:25:28 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.com/?p=855#comment-33138</guid>
		<description>Hi, Graham
Your CustomSoftwareUpdater is excellent and tells me I&#039;ll never be a programmer...

I&#039;ve just finished upgrading it to VS 2010 and converting it to VB (I&#039;m an old dog, C# wasn&#039;t even dreamed of when I started programming...). 

Anyway, the CloneProperties doesn&#039;t seem to translate to VB - 
For Each destinationProperty As var In destination.[GetType]().GetProperties()

breaks on &#039;var&#039;.  What type is is supposed to be?  If I get this fixed, the project runs.

Thanks,
Steve J
Portland, OR, US</description>
		<content:encoded><![CDATA[<p>Hi, Graham<br />
Your CustomSoftwareUpdater is excellent and tells me I&#8217;ll never be a programmer&#8230;</p>
<p>I&#8217;ve just finished upgrading it to VS 2010 and converting it to VB (I&#8217;m an old dog, C# wasn&#8217;t even dreamed of when I started programming&#8230;). </p>
<p>Anyway, the CloneProperties doesn&#8217;t seem to translate to VB &#8211;<br />
For Each destinationProperty As var In destination.[GetType]().GetProperties()</p>
<p>breaks on &#8216;var&#8217;.  What type is is supposed to be?  If I get this fixed, the project runs.</p>
<p>Thanks,<br />
Steve J<br />
Portland, OR, US</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham O'Neale</title>
		<link>http://goneale.com/2009/09/22/rolling-out-a-custom-software-updater-for-win-forms-wpf/comment-page-1/#comment-6606</link>
		<dc:creator>Graham O'Neale</dc:creator>
		<pubDate>Fri, 19 Feb 2010 05:00:30 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.com/?p=855#comment-6606</guid>
		<description>No problem!</description>
		<content:encoded><![CDATA[<p>No problem!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Serge</title>
		<link>http://goneale.com/2009/09/22/rolling-out-a-custom-software-updater-for-win-forms-wpf/comment-page-1/#comment-4923</link>
		<dc:creator>Serge</dc:creator>
		<pubDate>Tue, 22 Dec 2009 05:37:14 +0000</pubDate>
		<guid isPermaLink="false">http://goneale.com/?p=855#comment-4923</guid>
		<description>Neat post. Thanks for sharing!</description>
		<content:encoded><![CDATA[<p>Neat post. Thanks for sharing!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

