<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>.NET on Remko's Blog</title><link>https://remkoweijnen.nl/blog/tags/.net/</link><description>Recent content in .NET on Remko's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 30 May 2013 16:18:23 +0000</lastBuildDate><atom:link href="https://remkoweijnen.nl/blog/tags/.net/index.xml" rel="self" type="application/rss+xml"/><item><title>Redirect Registry by Modifying .NET Executable</title><link>https://remkoweijnen.nl/blog/2013/05/30/redirect-registry-by-modifying-net-executable/</link><pubDate>Thu, 30 May 2013 16:18:23 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2013/05/30/redirect-registry-by-modifying-net-executable/</guid><description>&lt;p&gt;Yesterday I was troubleshooting an application that was migrated to Citrix XenApp. &lt;/p&gt; &lt;p&gt;The application is able to use a high precision scale which is attached to the client pc's com port. This com port is redirected to XenApp.&lt;/p&gt; &lt;p&gt;While testing users reported several issues, let's have a look at them.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Error configuring COM Port&lt;/u&gt;&lt;/strong&gt; &lt;br /&gt;Within the application the comport to which the scale is connected must be configured:&lt;/p&gt; &lt;p&gt;&lt;a class="glightbox thickbox" href="https://remkoweijnen.nl/blog/wp-content/uploads/2013/05/image3.webp" data-type="image" data-gallery="post-3284"&gt;&lt;img loading="lazy" decoding="async" style="display: inline" title="Compoort instellen" alt="De compoort lezer staat uit" src="https://remkoweijnen.nl/blog/wp-content/uploads/2013/05/image_thumb3.webp" width="240" height="95" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;After pressing &amp;quot;Registreer&amp;quot; to register the new com port the following error message was shown&lt;/p&gt; &lt;p&gt;&lt;a class="glightbox thickbox" href="https://remkoweijnen.nl/blog/wp-content/uploads/2013/05/image4.webp" data-type="image" data-gallery="post-3284"&gt;&lt;img loading="lazy" decoding="async" style="display: inline" title="Fout" alt="Er staat geen compoort in het register. Registreer eerste de juiste compoort" src="https://remkoweijnen.nl/blog/wp-content/uploads/2013/05/image_thumb4.webp" width="240" height="58" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Convert an IP Address to an Integer in C# in host byte ordering</title><link>https://remkoweijnen.nl/blog/2012/10/13/convert-an-ip-address-to-an-integer-in-c-in-host-byte-ordering/</link><pubDate>Sat, 13 Oct 2012 15:18:26 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/10/13/convert-an-ip-address-to-an-integer-in-c-in-host-byte-ordering/</guid><description>&lt;p&gt;Yesterday I wrote about &lt;a href="https://remkoweijnen.nl/blog/2012/10/12/warning-cs0618-system-net-ipaddress-address-is-obsolete/"&gt;converting an IP Address to an Integer in C#&lt;/a&gt;. But both methods I presented return the IP Address in network byte order.&lt;/p&gt;
&lt;p&gt;However in some cases, especially when calling WinApi functions, you will need to convert the Integer to host byte order which is &lt;em&gt;little-endian&lt;/em&gt; on Intel processors.&lt;/p&gt;</description></item><item><title>warning CS0618: 'System.Net.IPAddress.Address' is obsolete</title><link>https://remkoweijnen.nl/blog/2012/10/12/warning-cs0618-system-net-ipaddress-address-is-obsolete/</link><pubDate>Fri, 12 Oct 2012 13:43:21 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/10/12/warning-cs0618-system-net-ipaddress-address-is-obsolete/</guid><description>&lt;p&gt;For a call to a WinApi function I needed to convert an IP Address to an Integer in C#.&lt;/p&gt; &lt;p&gt;This can be done using the &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.ipaddress.aspx"&gt;System.Net.IPAddress&lt;/a&gt; class:&lt;/p&gt;
&lt;div class="codecard"&gt;
 &lt;div class="codehead"&gt;
 &lt;span class="codefile"&gt;&lt;/span&gt;
 &lt;span class="codetools" data-pagefind-ignore&gt;
 &lt;span class="codelang"&gt;text&lt;/span&gt;
 &lt;button class="codebtn" type="button" data-copy&gt;Copy&lt;/button&gt;
 &lt;a class="codebtn" download=".txt" href="data:text/plain;charset=utf-8;base64,dXNpbmcgU3lzdGVtLk5ldDsKCklQQWRkcmVzcyBpcGEgPSBJUEFkZHJlc3MuUGFyc2UoIjEwLjQuMi45MSIpOwp1aW50IGlwID0gKHVpbnQpaXBhLkFkZHJlc3M7"&gt;Download&lt;/a&gt;
 &lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="codebody"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;using System.Net;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;IPAddress ipa = IPAddress.Parse(&amp;#34;10.4.2.91&amp;#34;);
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;uint ip = (uint)ipa.Address;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Although this works, the compiler issues a warning:&amp;#160; &lt;/p&gt;</description></item><item><title>Could not load file or assembly 'System.Configuration'</title><link>https://remkoweijnen.nl/blog/2012/07/18/could-not-load-file-or-assembly-system-configuration/</link><pubDate>Wed, 18 Jul 2012 13:43:06 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/07/18/could-not-load-file-or-assembly-system-configuration/</guid><description>&lt;p&gt;Today I was asked to troubleshoot an executable that didn't work correctly on Windows XP Embedded.&lt;/p&gt; &lt;p&gt;On startup it displayed the following message:&lt;/p&gt; 
&lt;div class="codecard"&gt;
 &lt;div class="codehead"&gt;
 &lt;span class="codefile"&gt;&lt;/span&gt;
 &lt;span class="codetools" data-pagefind-ignore&gt;
 &lt;span class="codelang"&gt;text&lt;/span&gt;
 &lt;button class="codebtn" type="button" data-copy&gt;Copy&lt;/button&gt;
 &lt;a class="codebtn" download=".txt" href="data:text/plain;charset=utf-8;base64,VW5oYW5kbGVkIEV4Y2VwdGlvbjogU3lzdGVtLklPLkZpbGVOb3RGb3VuZEV4Y2VwdGlvbjogQ291bGQgbm90IGxvYWQgZmlsZSBvciBhc3MKZW1ibHkgJ1N5c3RlbS5Db25maWd1cmF0aW9uLCBWZXJzaW9uPTIuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49YjAKM2Y1ZjdmMTFkNTBhM2EnIG9yIG9uZSBvZiBpdHMgZGVwZW5kZW5jaWVzLiBUaGUgc3lzdGVtIGNhbm5vdCBmaW5kIHRoZSBwYXRoIHNwZWMKaWZpZWQuCkZpbGUgbmFtZTogJ1N5c3RlbS5Db25maWd1cmF0aW9uLCBWZXJzaW9uPTIuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rCmVuPWIwM2Y1ZjdmMTFkNTBhM2EnIC0tLT4gU3lzdGVtLklPLkRpcmVjdG9yeU5vdEZvdW5kRXhjZXB0aW9uOiBUaGUgc3lzdGVtIGNhbm5vCnQgZmluZCB0aGUgcGF0aCBzcGVjaWZpZWQuIChFeGNlcHRpb24gZnJvbSBIUkVTVUxUOiAweDgwMDcwMDAzKQ=="&gt;Download&lt;/a&gt;
 &lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="codebody"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Unhandled Exception: System.IO.FileNotFoundException: Could not load file or ass
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;embly &amp;#39;System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;3f5f7f11d50a3a&amp;#39; or one of its dependencies. The system cannot find the path spec
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ified.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;File name: &amp;#39;System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyTok
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;en=b03f5f7f11d50a3a&amp;#39; ---&amp;gt; System.IO.DirectoryNotFoundException: The system canno
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;t find the path specified. (Exception from HRESULT: 0x80070003)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I verified that System.Configuration.dll was present (in C:\Windows\Microsoft.NET\Framework\v2.0.50727).&lt;/p&gt;</description></item></channel></rss>