<?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 for Nathan Jones</title>
	<atom:link href="http://www.nathanpjones.com/wp/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nathanpjones.com/wp</link>
	<description>Programming, tips, reviews, etc.</description>
	<lastBuildDate>Sun, 20 Nov 2011 23:38:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Comment on Obfuscating a ClickOnce Publish by Nathan</title>
		<link>http://www.nathanpjones.com/wp/2010/04/obfuscating-a-clickonce-publish/comment-page-1/#comment-3231</link>
		<dc:creator>Nathan</dc:creator>
		<pubDate>Sun, 20 Nov 2011 23:38:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.nathanpjones.com/wp/?p=172#comment-3231</guid>
		<description>@Stefan. The borrowing from the common targets comment means that I had to override the built-in _CopyFilesMarkedCopyLocal and so copied/pasted its original contents to preserve it&#039;s original functionality. That first section in my version is from the common targets and the second section I created to copy the mapping file.

I took a look in my framework folder and it looks like the 4.0 framework has a different _CopyFilesMarkedCopyLocal. Try this modified version and let me know if it works for you (diff from orig highlighted): 

[sourcecode language=&quot;xml&quot; highlight=&quot;19,26,27,28,29&quot; toolbar=&quot;true&quot;]

&lt;Target
    Name=&quot;_CopyFilesMarkedCopyLocal&quot;
    Condition=&quot;&#039;@(ReferenceCopyLocalPaths)&#039; != &#039;&#039;&quot;
    &gt;

    &lt;PropertyGroup&gt;
        &lt;!-- By default we&#039;re not using Hard Links to copy to the output directory, and never when building in VS --&gt;
        &lt;CreateHardLinksForCopyLocalIfPossible Condition=&quot;&#039;$(BuildingInsideVisualStudio)&#039; == &#039;true&#039; or &#039;$(CreateHardLinksForCopyLocalIfPossible)&#039; == &#039;&#039;&quot;&gt;false&lt;/CreateHardLinksForCopyLocalIfPossible&gt;
    &lt;/PropertyGroup&gt;

    &lt;Copy
        SourceFiles=&quot;@(ReferenceCopyLocalPaths)&quot;
        DestinationFiles=&quot;@(ReferenceCopyLocalPaths-&gt;&#039;$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)&#039;)&quot;
        SkipUnchangedFiles=&quot;$(SkipCopyUnchangedFiles)&quot;
        OverwriteReadOnlyFiles=&quot;$(OverwriteReadOnlyFiles)&quot;
        Retries=&quot;$(CopyRetryCount)&quot;
        RetryDelayMilliseconds=&quot;$(CopyRetryDelayMilliseconds)&quot;
        UseHardlinksIfPossible=&quot;$(CreateHardLinksForCopyLocalIfPossible)&quot;
        Condition=&quot;&#039;$(UseCommonOutputDirectory)&#039; != &#039;true&#039; And (&#039;$(Obfuscate)&#039;!=&#039;true&#039; Or &#039;$(ShouldMergeAssemblies)&#039;!=&#039;true&#039;)&quot;
        &gt;

        &lt;Output TaskParameter=&quot;DestinationFiles&quot; ItemName=&quot;FileWritesShareable&quot;/&gt;

    &lt;/Copy&gt;
    
     &lt;!-- Since this target is already overriden, let&#039;s use this to copy the mapping file. --&gt;
    &lt;Copy SourceFiles=&quot;@(ObfuscationMapFiles)&quot; DestinationFiles=&quot;@(ObfuscationMapFiles-&gt;&#039;$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)&#039;)&quot; SkipUnchangedFiles=&quot;true&quot; Condition=&quot;&#039;$(Obfuscate)&#039;==&#039;true&#039;&quot;&gt;
      &lt;Output TaskParameter=&quot;DestinationFiles&quot; ItemName=&quot;FileWrites&quot; /&gt;
    &lt;/Copy&gt;


&lt;/Target&gt;
[/sourcecode]</description>
		<content:encoded><![CDATA[<p>@Stefan. The borrowing from the common targets comment means that I had to override the built-in _CopyFilesMarkedCopyLocal and so copied/pasted its original contents to preserve it&#8217;s original functionality. That first section in my version is from the common targets and the second section I created to copy the mapping file.</p>
<p>I took a look in my framework folder and it looks like the 4.0 framework has a different _CopyFilesMarkedCopyLocal. Try this modified version and let me know if it works for you (diff from orig highlighted): </p>
<pre class="brush: xml; highlight: [19,26,27,28,29]; title: ; toolbar: true; notranslate">

&lt;Target
    Name=&quot;_CopyFilesMarkedCopyLocal&quot;
    Condition=&quot;'@(ReferenceCopyLocalPaths)' != ''&quot;
    &gt;

    &lt;PropertyGroup&gt;
        &lt;!-- By default we're not using Hard Links to copy to the output directory, and never when building in VS --&gt;
        &lt;CreateHardLinksForCopyLocalIfPossible Condition=&quot;'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateHardLinksForCopyLocalIfPossible)' == ''&quot;&gt;false&lt;/CreateHardLinksForCopyLocalIfPossible&gt;
    &lt;/PropertyGroup&gt;

    &lt;Copy
        SourceFiles=&quot;@(ReferenceCopyLocalPaths)&quot;
        DestinationFiles=&quot;@(ReferenceCopyLocalPaths-&gt;'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')&quot;
        SkipUnchangedFiles=&quot;$(SkipCopyUnchangedFiles)&quot;
        OverwriteReadOnlyFiles=&quot;$(OverwriteReadOnlyFiles)&quot;
        Retries=&quot;$(CopyRetryCount)&quot;
        RetryDelayMilliseconds=&quot;$(CopyRetryDelayMilliseconds)&quot;
        UseHardlinksIfPossible=&quot;$(CreateHardLinksForCopyLocalIfPossible)&quot;
        Condition=&quot;'$(UseCommonOutputDirectory)' != 'true' And ('$(Obfuscate)'!='true' Or '$(ShouldMergeAssemblies)'!='true')&quot;
        &gt;

        &lt;Output TaskParameter=&quot;DestinationFiles&quot; ItemName=&quot;FileWritesShareable&quot;/&gt;

    &lt;/Copy&gt;

     &lt;!-- Since this target is already overriden, let's use this to copy the mapping file. --&gt;
    &lt;Copy SourceFiles=&quot;@(ObfuscationMapFiles)&quot; DestinationFiles=&quot;@(ObfuscationMapFiles-&gt;'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')&quot; SkipUnchangedFiles=&quot;true&quot; Condition=&quot;'$(Obfuscate)'=='true'&quot;&gt;
      &lt;Output TaskParameter=&quot;DestinationFiles&quot; ItemName=&quot;FileWrites&quot; /&gt;
    &lt;/Copy&gt;

&lt;/Target&gt;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Obfuscating a ClickOnce Publish by Nathan</title>
		<link>http://www.nathanpjones.com/wp/2010/04/obfuscating-a-clickonce-publish/comment-page-1/#comment-3230</link>
		<dc:creator>Nathan</dc:creator>
		<pubDate>Sun, 20 Nov 2011 22:54:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.nathanpjones.com/wp/?p=172#comment-3230</guid>
		<description>@Baskar. Your question is a bit light on details, particularly any exception that is generated. If you&#039;re not getting any compile errors, my suspicion is that there is some bug in the obfuscator you&#039;re using. I&#039;m using .NET Reactor and there were several settings I had to tweak for some of my programs. I&#039;m not sure why they caused a problem only for those programs, but that&#039;s what it took to get them running.</description>
		<content:encoded><![CDATA[<p>@Baskar. Your question is a bit light on details, particularly any exception that is generated. If you&#8217;re not getting any compile errors, my suspicion is that there is some bug in the obfuscator you&#8217;re using. I&#8217;m using .NET Reactor and there were several settings I had to tweak for some of my programs. I&#8217;m not sure why they caused a problem only for those programs, but that&#8217;s what it took to get them running.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Obfuscating a ClickOnce Publish by Baskar</title>
		<link>http://www.nathanpjones.com/wp/2010/04/obfuscating-a-clickonce-publish/comment-page-1/#comment-3100</link>
		<dc:creator>Baskar</dc:creator>
		<pubDate>Fri, 11 Nov 2011 14:39:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.nathanpjones.com/wp/?p=172#comment-3100</guid>
		<description>Hi Nathan.

I was able to run my project but cookcomputing namespace not working, 
GetPages GetPageList = (GetPages)CookComputing.XmlRpc.XmlRpcProxyGen.Create(typeof(GetPages));

Create method not invoking the page, what should i do, anything i missed?</description>
		<content:encoded><![CDATA[<p>Hi Nathan.</p>
<p>I was able to run my project but cookcomputing namespace not working,<br />
GetPages GetPageList = (GetPages)CookComputing.XmlRpc.XmlRpcProxyGen.Create(typeof(GetPages));</p>
<p>Create method not invoking the page, what should i do, anything i missed?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Obfuscating a ClickOnce Publish by Stefan</title>
		<link>http://www.nathanpjones.com/wp/2010/04/obfuscating-a-clickonce-publish/comment-page-1/#comment-2497</link>
		<dc:creator>Stefan</dc:creator>
		<pubDate>Mon, 12 Sep 2011 20:03:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.nathanpjones.com/wp/?p=172#comment-2497</guid>
		<description>Sorry, looks like a part of my message was stripped out because it contained xml.

Third paragraph should read:
Line 2580 in Microsoft.Common.targets is inside the &quot;GenerateApplicationManifest&quot; target.</description>
		<content:encoded><![CDATA[<p>Sorry, looks like a part of my message was stripped out because it contained xml.</p>
<p>Third paragraph should read:<br />
Line 2580 in Microsoft.Common.targets is inside the &#8220;GenerateApplicationManifest&#8221; target.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Obfuscating a ClickOnce Publish by Stefan</title>
		<link>http://www.nathanpjones.com/wp/2010/04/obfuscating-a-clickonce-publish/comment-page-1/#comment-2496</link>
		<dc:creator>Stefan</dc:creator>
		<pubDate>Mon, 12 Sep 2011 19:59:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.nathanpjones.com/wp/?p=172#comment-2496</guid>
		<description>Hey Nathan,

This seems like a great solution but I can&#039;t seem to get it working, not sure if I&#039;m doing something wrong.

I get the following error message when builing my project:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2580,9): error MSB3171: Problem generating manifest. Could not load file or assembly &#039;C:\ProjectName\obj\Release\AppName.exe&#039; or one of its dependencies. An attempt was made to load a program with an incorrect format.

Line 2580 in Microsoft.Common.targets is inside the  section.

I&#039;ve noticed that when I remove the following from your .targets file, the project compiles but it is then obviously working with the original exe and not the obfuscated version:


I&#039;m also not quite sure what you mean with the following related to the _CopyFilesMarkedCopyLocal, GenerateManifests and DoubleCheckDependencies targets
&quot;Borrowed from target in &#039;Microsoft.Common.targets&#039; included with MSBuild 2.0. You may need to make sure it matches the targets file included with your version of MSBuild.&quot;

Does this mean that I have to overwrite the target in your .targets file with what&#039;s found in the Microsoft.Common.targets file (located in C:\Windows\Microsoft.NET\Framework\v4.0.30319)?

These are probably obvious questions but I&#039;m not at all familiar with the way .target files work.

Thanks in advance
Stefan</description>
		<content:encoded><![CDATA[<p>Hey Nathan,</p>
<p>This seems like a great solution but I can&#8217;t seem to get it working, not sure if I&#8217;m doing something wrong.</p>
<p>I get the following error message when builing my project:<br />
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2580,9): error MSB3171: Problem generating manifest. Could not load file or assembly &#8216;C:\ProjectName\obj\Release\AppName.exe&#8217; or one of its dependencies. An attempt was made to load a program with an incorrect format.</p>
<p>Line 2580 in Microsoft.Common.targets is inside the  section.</p>
<p>I&#8217;ve noticed that when I remove the following from your .targets file, the project compiles but it is then obviously working with the original exe and not the obfuscated version:</p>
<p>I&#8217;m also not quite sure what you mean with the following related to the _CopyFilesMarkedCopyLocal, GenerateManifests and DoubleCheckDependencies targets<br />
&#8220;Borrowed from target in &#8216;Microsoft.Common.targets&#8217; included with MSBuild 2.0. You may need to make sure it matches the targets file included with your version of MSBuild.&#8221;</p>
<p>Does this mean that I have to overwrite the target in your .targets file with what&#8217;s found in the Microsoft.Common.targets file (located in C:\Windows\Microsoft.NET\Framework\v4.0.30319)?</p>
<p>These are probably obvious questions but I&#8217;m not at all familiar with the way .target files work.</p>
<p>Thanks in advance<br />
Stefan</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Bulk Insert Using SqlClient.SqlBulkCopy by Nathan</title>
		<link>http://www.nathanpjones.com/wp/2011/05/bulk-insert-using-sqlclient-sqlbulkcopy/comment-page-1/#comment-2207</link>
		<dc:creator>Nathan</dc:creator>
		<pubDate>Thu, 28 Jul 2011 04:17:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.nathanpjones.com/wp/?p=317#comment-2207</guid>
		<description>Sorry, thought I double-checked it. I had uploaded it, but the web server doesn&#039;t allow &quot;.vb&quot; extension. I reuploaded as zip and all looks well.</description>
		<content:encoded><![CDATA[<p>Sorry, thought I double-checked it. I had uploaded it, but the web server doesn&#8217;t allow &#8220;.vb&#8221; extension. I reuploaded as zip and all looks well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Bulk Insert Using SqlClient.SqlBulkCopy by setiri</title>
		<link>http://www.nathanpjones.com/wp/2011/05/bulk-insert-using-sqlclient-sqlbulkcopy/comment-page-1/#comment-2088</link>
		<dc:creator>setiri</dc:creator>
		<pubDate>Mon, 18 Jul 2011 02:37:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.nathanpjones.com/wp/?p=317#comment-2088</guid>
		<description>Looks like this code is no longer there, is it possible to still get it?</description>
		<content:encoded><![CDATA[<p>Looks like this code is no longer there, is it possible to still get it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Obfuscating a ClickOnce Publish by Nathan</title>
		<link>http://www.nathanpjones.com/wp/2010/04/obfuscating-a-clickonce-publish/comment-page-1/#comment-1759</link>
		<dc:creator>Nathan</dc:creator>
		<pubDate>Sun, 05 Jun 2011 17:29:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.nathanpjones.com/wp/?p=172#comment-1759</guid>
		<description>@Assaf: It sounds like you have your source and outputs all mixed up. The source files to be obfuscated should come from the intermediate folder (not &quot;bin\Release&quot;) and the obfuscated files should be output to a temp folder. Then the source files should be overwritten with their obfuscated versions.

You see, when the compiler is invoked in a configuration called Release either by a build or a publish, it compiles and assembles all the necessary files in the &quot;obj\Release&quot; folder. This is called the &quot;intermediate output path&quot; which you&#039;ll see used in the Obfuscation.targets file.

If you&#039;re performing a publish, once the build is complete vs will build the publish using these intermediate files and generate and sign the publish manifest. We do the obfuscation in the intermediate folder because after the publish manifest is generated, the published files may not change.

Only after everything is completely built are things copied to the &quot;bin\Release&quot; folder or the publish destination.

By the way, are you using the community edition of Dotfuscator? Keep in mind that its obfuscations are extremely weak and probably won&#039;t do much to protect your program. Download .NET Reflector to see just how much of your program is still susceptible to disassembly.</description>
		<content:encoded><![CDATA[<p>@Assaf: It sounds like you have your source and outputs all mixed up. The source files to be obfuscated should come from the intermediate folder (not &#8220;bin\Release&#8221;) and the obfuscated files should be output to a temp folder. Then the source files should be overwritten with their obfuscated versions.</p>
<p>You see, when the compiler is invoked in a configuration called Release either by a build or a publish, it compiles and assembles all the necessary files in the &#8220;obj\Release&#8221; folder. This is called the &#8220;intermediate output path&#8221; which you&#8217;ll see used in the Obfuscation.targets file.</p>
<p>If you&#8217;re performing a publish, once the build is complete vs will build the publish using these intermediate files and generate and sign the publish manifest. We do the obfuscation in the intermediate folder because after the publish manifest is generated, the published files may not change.</p>
<p>Only after everything is completely built are things copied to the &#8220;bin\Release&#8221; folder or the publish destination.</p>
<p>By the way, are you using the community edition of Dotfuscator? Keep in mind that its obfuscations are extremely weak and probably won&#8217;t do much to protect your program. Download .NET Reflector to see just how much of your program is still susceptible to disassembly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Obfuscating a ClickOnce Publish by Assaf</title>
		<link>http://www.nathanpjones.com/wp/2010/04/obfuscating-a-clickonce-publish/comment-page-1/#comment-1744</link>
		<dc:creator>Assaf</dc:creator>
		<pubDate>Wed, 01 Jun 2011 23:37:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.nathanpjones.com/wp/?p=172#comment-1744</guid>
		<description>By the way, my app is signed with a certificate (unless you tell me how to avoid it) as well as, it is composed of exe and dlls.</description>
		<content:encoded><![CDATA[<p>By the way, my app is signed with a certificate (unless you tell me how to avoid it) as well as, it is composed of exe and dlls.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Obfuscating a ClickOnce Publish by Assaf</title>
		<link>http://www.nathanpjones.com/wp/2010/04/obfuscating-a-clickonce-publish/comment-page-1/#comment-1741</link>
		<dc:creator>Assaf</dc:creator>
		<pubDate>Wed, 01 Jun 2011 20:51:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.nathanpjones.com/wp/?p=172#comment-1741</guid>
		<description>I just noticed that if I do Clean before Build, then the dotfuscator complains that it has no files to obfuscate.  I looked into the bin\release folder and I noticed that it is empty.  Am I missing something?</description>
		<content:encoded><![CDATA[<p>I just noticed that if I do Clean before Build, then the dotfuscator complains that it has no files to obfuscate.  I looked into the bin\release folder and I noticed that it is empty.  Am I missing something?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

