<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
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/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>Jan Jonas&#039; blog</title> <atom:link href="http://blog.janjonas.net/feed" rel="self" type="application/rss+xml" /><link>http://blog.janjonas.net</link> <description>Howtos &#38; Tutorials</description> <lastBuildDate>Sun, 28 Apr 2013 20:31:47 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.5.1</generator> <item><title>Windows: Command line utility to get a list of all users in an active directory group</title><link>http://blog.janjonas.net/2013-04-28/windows-command-line-list-users-active-directory-group</link> <comments>http://blog.janjonas.net/2013-04-28/windows-command-line-list-users-active-directory-group#comments</comments> <pubDate>Sun, 28 Apr 2013 20:31:47 +0000</pubDate> <dc:creator>Jan Jonas</dc:creator> <category><![CDATA[Howto]]></category> <category><![CDATA[System administration]]></category> <category><![CDATA[Windows]]></category> <guid
isPermaLink="false">http://blog.janjonas.net/?p=1840</guid> <description><![CDATA[You can easily get a list of all users that are member of a specific active directory group with the following command: net group /domain [GROUP-NAME] Hope this helps somebody&#8230;<div
class='yarpp-related-rss'> Related posts:<ol><li><a
href='http://blog.janjonas.net/2011-10-23/asp_net-mvc_3-strongly-typed-authorize-attribute-multiple-users-roles' rel='bookmark' title='ASP.NET MVC 3: Strongly typed Authorize Attribute with multiple users and roles'>ASP.NET MVC 3: Strongly typed Authorize Attribute with multiple users and roles</a></li><li><a
href='http://blog.janjonas.net/2011-02-26/windows-search-strings-files-recursively' rel='bookmark' title='Windows: Search for strings in files recursively'>Windows: Search for strings in files recursively</a></li><li><a
href='http://blog.janjonas.net/2012-02-02/iis_7_5-windows_7-how-to-http-error-401_3-unauthorized' rel='bookmark' title='IIS 7.5 on Windows 7: How to fix &#8220;HTTP Error 401.3 &#8211; Unauthorized&#8221;'>IIS 7.5 on Windows 7: How to fix &#8220;HTTP Error 401.3 &#8211; Unauthorized&#8221;</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<p>You can easily get a list of all users that are member of a specific active directory group with the following command:</p><div
class="wp_syntax"><table><tr><td
class="code"><pre class="dos" style="font-family:monospace;">net group /domain [GROUP-NAME]</pre></td></tr></table></div><p>Hope this helps somebody&#8230;</p><div
class='yarpp-related-rss'><p>Related posts:<ol><li><a
href='http://blog.janjonas.net/2011-10-23/asp_net-mvc_3-strongly-typed-authorize-attribute-multiple-users-roles' rel='bookmark' title='ASP.NET MVC 3: Strongly typed Authorize Attribute with multiple users and roles'>ASP.NET MVC 3: Strongly typed Authorize Attribute with multiple users and roles</a></li><li><a
href='http://blog.janjonas.net/2011-02-26/windows-search-strings-files-recursively' rel='bookmark' title='Windows: Search for strings in files recursively'>Windows: Search for strings in files recursively</a></li><li><a
href='http://blog.janjonas.net/2012-02-02/iis_7_5-windows_7-how-to-http-error-401_3-unauthorized' rel='bookmark' title='IIS 7.5 on Windows 7: How to fix &#8220;HTTP Error 401.3 &#8211; Unauthorized&#8221;'>IIS 7.5 on Windows 7: How to fix &#8220;HTTP Error 401.3 &#8211; Unauthorized&#8221;</a></li></ol></p></div> ]]></content:encoded> <wfw:commentRss>http://blog.janjonas.net/2013-04-28/windows-command-line-list-users-active-directory-group/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>XenServer 5.6: Add /var/log/btmp to logrotate</title><link>http://blog.janjonas.net/2013-04-27/xenserver_5_6-add-var_log_btmp-logrotate</link> <comments>http://blog.janjonas.net/2013-04-27/xenserver_5_6-add-var_log_btmp-logrotate#comments</comments> <pubDate>Sat, 27 Apr 2013 14:43:25 +0000</pubDate> <dc:creator>Jan Jonas</dc:creator> <category><![CDATA[Howto]]></category> <category><![CDATA[System administration]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[SSH]]></category> <category><![CDATA[XenServer]]></category> <guid
isPermaLink="false">http://blog.janjonas.net/?p=1843</guid> <description><![CDATA[Warning: Since a large /var/log/btmp could indicate that somebody runs brute force attacks against your system, you may should at least think about changing the ssh port or setting up tools like DenyHosts or Fail2Ban (see here for more information about preventing ssh brute force attacks). By default logrotate seems not be configured for the [...]<div
class='yarpp-related-rss'> Related posts:<ol><li><a
href='http://blog.janjonas.net/2010-10-19/xenserver_5_6-debian-lenny-apt_get-aptitude-gpg-error' rel='bookmark' title='XenServer 5.6 &amp; Debian Lenny: Fix apt-get/aptitude GPG error'>XenServer 5.6 &#038; Debian Lenny: Fix apt-get/aptitude GPG error</a></li><li><a
href='http://blog.janjonas.net/2010-08-10/xenserver-5_6-network-problems-r8169-kernel-module' rel='bookmark' title='XenServer 5.6: Network problems with r8169 kernel module'>XenServer 5.6: Network problems with r8169 kernel module</a></li><li><a
href='http://blog.janjonas.net/2011-07-11/fit-pc2-ubuntu-configure-wifi-wpa2-wlan' rel='bookmark' title='fit-PC2 &amp; Ubuntu 9.10: Configure Wi-Fi access for WPA2 protected WLAN'>fit-PC2 &#038; Ubuntu 9.10: Configure Wi-Fi access for WPA2 protected WLAN</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<p><strong>Warning</strong>: Since a large <em>/var/log/btmp</em> could indicate that somebody runs brute force attacks against your system, you may should at least think about changing the ssh port or setting up tools like <a
href="http://denyhosts.sourceforge.net/" target="_blank">DenyHosts</a> or <a
href="http://www.fail2ban.org" target="_blank">Fail2Ban</a> (see <a
href="http://serverfault.com/questions/4188/preventing-brute-force-attacks-against-ssh" target="_blank">here</a> for more information about preventing ssh brute force attacks).</p><p>By default <a
href="https://fedorahosted.org/logrotate/" target="_blank">logrotate</a> seems not be configured for the <em>/var/log/btmp</em> file on a XenServer 5.6 system. Since every failed login in is logged in this file, the file can become very large and your system could run out of free disk space.</p><p>To add this file to the logrotate config, add the following lines to <em>/etc/logrotate.conf</em>:</p><div
class="wp_syntax"><table><tr><td
class="code"><pre class="config" style="font-family:monospace;">/var/log/btmp {
  monthly
  minsize 1M
  create 0600 root utmp
  rotate 1
}</pre></td></tr></table></div><p>After editing the config it could be reasonable to run logrotate manually to clean up the log files with the following command:</p><div
class="wp_syntax"><table><tr><td
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;"># </span>logrotate <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>logrotate.conf</pre></td></tr></table></div><p>If you are unsure about the result, you can add the &#8220;-d&#8221; switch for a &#8220;dry run&#8221; to see what logrotate would do:</p><div
class="wp_syntax"><table><tr><td
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;"># </span>logrotate <span style="color: #660033;">-d</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>logrotate.conf</pre></td></tr></table></div><div
class='yarpp-related-rss'><p>Related posts:<ol><li><a
href='http://blog.janjonas.net/2010-10-19/xenserver_5_6-debian-lenny-apt_get-aptitude-gpg-error' rel='bookmark' title='XenServer 5.6 &amp; Debian Lenny: Fix apt-get/aptitude GPG error'>XenServer 5.6 &#038; Debian Lenny: Fix apt-get/aptitude GPG error</a></li><li><a
href='http://blog.janjonas.net/2010-08-10/xenserver-5_6-network-problems-r8169-kernel-module' rel='bookmark' title='XenServer 5.6: Network problems with r8169 kernel module'>XenServer 5.6: Network problems with r8169 kernel module</a></li><li><a
href='http://blog.janjonas.net/2011-07-11/fit-pc2-ubuntu-configure-wifi-wpa2-wlan' rel='bookmark' title='fit-PC2 &amp; Ubuntu 9.10: Configure Wi-Fi access for WPA2 protected WLAN'>fit-PC2 &#038; Ubuntu 9.10: Configure Wi-Fi access for WPA2 protected WLAN</a></li></ol></p></div> ]]></content:encoded> <wfw:commentRss>http://blog.janjonas.net/2013-04-27/xenserver_5_6-add-var_log_btmp-logrotate/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Hosting WCF services in IIS: Fix URLs of WSDL files that include internal domain or machine names</title><link>http://blog.janjonas.net/2013-04-20/wcf-service-iis-fix-url-wsdl-internal-domain-machine-name</link> <comments>http://blog.janjonas.net/2013-04-20/wcf-service-iis-fix-url-wsdl-internal-domain-machine-name#comments</comments> <pubDate>Sat, 20 Apr 2013 21:24:55 +0000</pubDate> <dc:creator>Jan Jonas</dc:creator> <category><![CDATA[Howto]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[.NET]]></category> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[IIS]]></category> <category><![CDATA[WCF]]></category> <guid
isPermaLink="false">http://blog.janjonas.net/?p=1818</guid> <description><![CDATA[If you host your WCF service in the IIS web server and have the problem, that the URLs of the WSDL files contain internal domain names (or your machine names) that cannot be resolved by the clients when trying to consume the service you will find three possible options to resolve this issue in this [...]<div
class='yarpp-related-rss'> Related posts:<ol><li><a
href='http://blog.janjonas.net/2011-01-19/asp_net-add-script-tags-include-javascript-master-pages-head-tag' rel='bookmark' title='ASP.NET: Programmatically adding &lt;script&gt; tags to include JavaScript files in the master page&#8217;s &lt;head&gt; tag'>ASP.NET: Programmatically adding &lt;script&gt; tags to include JavaScript files in the master page&#8217;s &lt;head&gt; tag</a></li><li><a
href='http://blog.janjonas.net/2012-09-05/asp_net-mvc_4_rc-web-api-return-http-status-code-4xx-invalidoperationexception-no-mediatypeformatter-available-read-object-type-content-media-type' rel='bookmark' title='ASP.NET MVC 4 RC &amp; ASP.NET Web API: Return &#8220;HTTP Status code 4xx&#8221; instead of throwing InvalidOperationException &#8220;No MediaTypeFormatter is available to read an object of type &#8216;[...]&#8216; from content with media type &#8216;[...]&#8216;&#8221;'>ASP.NET MVC 4 RC &#038; ASP.NET Web API: Return &#8220;HTTP Status code 4xx&#8221; instead of throwing InvalidOperationException &#8220;No MediaTypeFormatter is available to read an object of type &#8216;[...]&#8216; from content with media type &#8216;[...]&#8216;&#8221;</a></li><li><a
href='http://blog.janjonas.net/2012-04-06/asp_net-howto-user-control-library-compile-dll-file' rel='bookmark' title='ASP.NET How-To: Create User Control library by compiling User Controls into .dll files'>ASP.NET How-To: Create User Control library by compiling User Controls into .dll files</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<p>If you host your WCF service in the IIS web server and have the problem, that the URLs of the WSDL files contain internal domain names (or your machine names) that cannot be resolved by the clients when trying to consume the service you will find  three possible options to resolve this issue in this blog post:</p><ol><li>Use the IIS manager to add a hostname to the binding of the site that hosts the WCF service.</li><li>Set to <em>multipleSiteBindingsEnabled</em> attribute (see <a
href="http://msdn.microsoft.com/en-us/library/system.servicemodel.configuration.servicehostingenvironmentsection.multiplesitebindingsenabled.aspx" target="_blank">MSDN documentation</a> for more information) that was introduced in .NET 4 to true in the Web.config:<div
class="wp_syntax"><table><tr><td
class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;system.serviceModel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  [...]
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;serviceHostingEnvironment</span> <span style="color: #66cc66;">&#91;</span>...<span style="color: #66cc66;">&#93;</span> <span style="color: #000066;">multipleSiteBindingsEnabled</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/system.serviceModel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div></li><li>Include the <em>WcfWsdlUrlFixHttpModule</em> (see source code below) in your project and activate the HTTP module in the <em>Web.config</em> as follows:<div
class="wp_syntax"><table><tr><td
class="code"><pre class="xml" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;system.web<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  [...]
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;httpModules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    [...]
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;WcfWsdlUrlFixHttpModule&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;YourNamespace.WcfWsdlUrlFixHttpModule, YourAssembly&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/httpModules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/system.web<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;system.webServer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  [...]
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;modules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    [...]
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;WcfWsdlUrlFixHttpModule&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;YourNamespace.WcfWsdlUrlFixHttpModule, YourAssembly&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/modules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/system.serviceModel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div><p> The <em>WcfWsdlUrlFixHttpModule</em> is defined as follows:</p><div
class="wp_syntax"><table><tr><td
class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">namespace</span> YourNamespace
<span style="color: #008000;">&#123;</span>
  <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> WcfWsdlUrlFixHttpModule<span style="color: #008000;">:</span> IHttpModule
  <span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> Dispose<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #6666cc; font-weight: bold;">void</span> IHttpModule<span style="color: #008000;">.</span><span style="color: #0000FF;">Init</span><span style="color: #008000;">&#40;</span>HttpApplication context<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
      context<span style="color: #008000;">.</span><span style="color: #0000FF;">BeginRequest</span> <span style="color: #008000;">+=</span> ContextBeginRequest<span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> ContextBeginRequest<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
      <span style="color: #0600FF; font-weight: bold;">var</span> app <span style="color: #008000;">=</span> sender <span style="color: #0600FF; font-weight: bold;">as</span> HttpApplication<span style="color: #008000;">;</span>
      <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>app <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;&amp;</span> app<span style="color: #008000;">.</span><span style="color: #0000FF;">Request</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Url</span><span style="color: #008000;">.</span><span style="color: #0000FF;">LocalPath</span><span style="color: #008000;">.</span><span style="color: #0000FF;">EndsWith</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;.svc&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
      <span style="color: #008000;">&#123;</span>
        app<span style="color: #008000;">.</span><span style="color: #0000FF;">Response</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Filter</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> WcfWsdlUrlFixFilter<span style="color: #008000;">&#40;</span>app<span style="color: #008000;">.</span><span style="color: #0000FF;">Response</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Filter</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
      <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
  <span style="color: #008000;">&#125;</span>
&nbsp;
  <span style="color: #0600FF; font-weight: bold;">internal</span> <span style="color: #6666cc; font-weight: bold;">class</span> WcfWsdlUrlFixFilter <span style="color: #008000;">:</span> Stream
  <span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> Regex Regex <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Regex<span style="color: #008000;">&#40;</span><span style="color: #666666;">@&quot;(http)[^\s^\&gt;^\'^\&quot;</span><span style="color: #666666;">&quot;]*?(<span style="color: #008080; font-weight: bold;">\.</span>svc)&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> Stream _responseStream<span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> WcfWsdlUrlFixFilter<span style="color: #008000;">&#40;</span>Stream responseStream<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
      _responseStream <span style="color: #008000;">=</span> responseStream<span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">bool</span> CanRead
    <span style="color: #008000;">&#123;</span>
      <span style="color: #0600FF; font-weight: bold;">get</span> <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> _responseStream<span style="color: #008000;">.</span><span style="color: #0000FF;">CanRead</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">bool</span> CanSeek
    <span style="color: #008000;">&#123;</span>
      <span style="color: #0600FF; font-weight: bold;">get</span> <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> _responseStream<span style="color: #008000;">.</span><span style="color: #0000FF;">CanSeek</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">bool</span> CanWrite
    <span style="color: #008000;">&#123;</span>
      <span style="color: #0600FF; font-weight: bold;">get</span> <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> _responseStream<span style="color: #008000;">.</span><span style="color: #0000FF;">CanWrite</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> Flush<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
      _responseStream<span style="color: #008000;">.</span><span style="color: #0000FF;">Flush</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">long</span> Length
    <span style="color: #008000;">&#123;</span>
      <span style="color: #0600FF; font-weight: bold;">get</span> <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> _responseStream<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">long</span> Position
    <span style="color: #008000;">&#123;</span>
      <span style="color: #0600FF; font-weight: bold;">get</span> <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> _responseStream<span style="color: #008000;">.</span><span style="color: #0000FF;">Position</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
      <span style="color: #0600FF; font-weight: bold;">set</span> <span style="color: #008000;">&#123;</span> _responseStream<span style="color: #008000;">.</span><span style="color: #0000FF;">Position</span> <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">value</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">int</span> Read<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">byte</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> buffer, <span style="color: #6666cc; font-weight: bold;">int</span> offset, <span style="color: #6666cc; font-weight: bold;">int</span> count<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
      <span style="color: #0600FF; font-weight: bold;">return</span> _responseStream<span style="color: #008000;">.</span><span style="color: #0000FF;">Read</span><span style="color: #008000;">&#40;</span>buffer, offset, count<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">long</span> Seek<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">long</span> offset, SeekOrigin origin<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
      <span style="color: #0600FF; font-weight: bold;">return</span> _responseStream<span style="color: #008000;">.</span><span style="color: #0000FF;">Seek</span><span style="color: #008000;">&#40;</span>offset, origin<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> SetLength<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">long</span> <span style="color: #0600FF; font-weight: bold;">value</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
      _responseStream<span style="color: #008000;">.</span><span style="color: #0000FF;">SetLength</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">value</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> Write<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">byte</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> buffer, <span style="color: #6666cc; font-weight: bold;">int</span> offset, <span style="color: #6666cc; font-weight: bold;">int</span> count<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
      <span style="color: #0600FF; font-weight: bold;">var</span> content <span style="color: #008000;">=</span> <span style="color: #000000;">System.<span style="color: #0000FF;">Text</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">Encoding</span><span style="color: #008000;">.</span><span style="color: #0000FF;">UTF8</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetString</span><span style="color: #008000;">&#40;</span>buffer<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
      <span style="color: #008080; font-style: italic;">// Create URL to .svc &quot;file&quot; based on the current request's RawUrl</span>
      <span style="color: #0600FF; font-weight: bold;">var</span> request <span style="color: #008000;">=</span> HttpContext<span style="color: #008000;">.</span><span style="color: #0000FF;">Current</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Request</span><span style="color: #008000;">;</span>
      <span style="color: #0600FF; font-weight: bold;">var</span> url <span style="color: #008000;">=</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span>
        <span style="color: #666666;">&quot;{0}://{1}{2}{3}&quot;</span>,
        request<span style="color: #008000;">.</span><span style="color: #0000FF;">Url</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Scheme</span>,
        request<span style="color: #008000;">.</span><span style="color: #0000FF;">Url</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Host</span>,
        <span style="color: #008000;">&#40;</span>request<span style="color: #008000;">.</span><span style="color: #0000FF;">Url</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Port</span> <span style="color: #008000;">!=</span> <span style="color: #FF0000;">80</span> <span style="color: #008000;">?</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;:{0}&quot;</span>, request<span style="color: #008000;">.</span><span style="color: #0000FF;">Url</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Port</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span>CultureInfo<span style="color: #008000;">.</span><span style="color: #0000FF;">InvariantCulture</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">:</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Empty</span><span style="color: #008000;">&#41;</span>,
        request<span style="color: #008000;">.</span><span style="color: #0000FF;">RawUrl</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Split</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">'?'</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">First</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
      <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
      content <span style="color: #008000;">=</span> Regex<span style="color: #008000;">.</span><span style="color: #0000FF;">Replace</span><span style="color: #008000;">&#40;</span>content, url<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
      buffer <span style="color: #008000;">=</span> <span style="color: #000000;">System.<span style="color: #0000FF;">Text</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">Encoding</span><span style="color: #008000;">.</span><span style="color: #0000FF;">UTF8</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetBytes</span><span style="color: #008000;">&#40;</span>content<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
      _responseStream<span style="color: #008000;">.</span><span style="color: #0000FF;">Write</span><span style="color: #008000;">&#40;</span>buffer, <span style="color: #FF0000;">0</span>, buffer<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
  <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div><p>In detail, the <em>WcfWsdlUrlFixHttpModule</em> uses a regular expression (thanks to my colleague Sascha for the support) to modify all URLs in the service description that point to WSDL files according to the schema, hostname and path the client uses in its request before the response is send to the client. This solution may seems to be a dirty hack, but it works and in contrast to the other options it takes rewrite rules into consideration that hide the real location of the <em>.svc</em> file.</p><p>For example the following configuration for the <a
href="http://www.iis.net/downloads/microsoft/url-rewrite" target="_blank">IIS &#8220;URL Rewrite&#8221; extension</a> could be used to host a WCF service under the URL http://your-domain.com/wcf/Service.svc instead of its real location http://your-domain.com/path/to/wcfservice/Service.svc:</p><div
class="wp_syntax"><table><tr><td
class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;system.webServer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  [...]
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rule</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Wcf Rewrite&quot;</span> <span style="color: #000066;">stopProcessing</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;wcf/(.*)&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Rewrite&quot;</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;/path/to/wcfservice/{R:1}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/system.webServer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div><p>By default, when the client requests the URL http://your-domain.com/wcf/Service.svc the URL to the WSDL files will be http://your-domain.com/path/to/wcfservice/Service.svc?wsdl, but when using the <em>WcfWsdlUrlFixHttpModule</em> as described above the URLs to the WSDL file will point to the &#8220;/wcf/&#8221; path (e.g. http://your-domain.com/wcf/Service.svc?wsdl) and completely hides the real directory structure.</li></ol><div
class='yarpp-related-rss'><p>Related posts:<ol><li><a
href='http://blog.janjonas.net/2011-01-19/asp_net-add-script-tags-include-javascript-master-pages-head-tag' rel='bookmark' title='ASP.NET: Programmatically adding &lt;script&gt; tags to include JavaScript files in the master page&#8217;s &lt;head&gt; tag'>ASP.NET: Programmatically adding &lt;script&gt; tags to include JavaScript files in the master page&#8217;s &lt;head&gt; tag</a></li><li><a
href='http://blog.janjonas.net/2012-09-05/asp_net-mvc_4_rc-web-api-return-http-status-code-4xx-invalidoperationexception-no-mediatypeformatter-available-read-object-type-content-media-type' rel='bookmark' title='ASP.NET MVC 4 RC &amp; ASP.NET Web API: Return &#8220;HTTP Status code 4xx&#8221; instead of throwing InvalidOperationException &#8220;No MediaTypeFormatter is available to read an object of type &#8216;[...]&#8216; from content with media type &#8216;[...]&#8216;&#8221;'>ASP.NET MVC 4 RC &#038; ASP.NET Web API: Return &#8220;HTTP Status code 4xx&#8221; instead of throwing InvalidOperationException &#8220;No MediaTypeFormatter is available to read an object of type &#8216;[...]&#8216; from content with media type &#8216;[...]&#8216;&#8221;</a></li><li><a
href='http://blog.janjonas.net/2012-04-06/asp_net-howto-user-control-library-compile-dll-file' rel='bookmark' title='ASP.NET How-To: Create User Control library by compiling User Controls into .dll files'>ASP.NET How-To: Create User Control library by compiling User Controls into .dll files</a></li></ol></p></div> ]]></content:encoded> <wfw:commentRss>http://blog.janjonas.net/2013-04-20/wcf-service-iis-fix-url-wsdl-internal-domain-machine-name/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>My daily DotNetNuke: Workaround for “Validation of viewstate MAC failed” exception when using the DNN 7 login form in multiple tabs</title><link>http://blog.janjonas.net/2013-04-18/dotnetnuke-workaround-validation-viewstate-failed-exception-dnn_7-login-form</link> <comments>http://blog.janjonas.net/2013-04-18/dotnetnuke-workaround-validation-viewstate-failed-exception-dnn_7-login-form#comments</comments> <pubDate>Thu, 18 Apr 2013 20:03:01 +0000</pubDate> <dc:creator>Jan Jonas</dc:creator> <category><![CDATA[Howto]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[.NET]]></category> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[DotNetNuke]]></category> <category><![CDATA[MyDailyDNN]]></category> <guid
isPermaLink="false">http://blog.janjonas.net/?p=1807</guid> <description><![CDATA[As I&#8217;ve written in one of my previous posts, I found out that one gets a “Validation of viewstate MAC failed” exception when submitting a DNN login form and the login status has changed from &#8220;not logged in&#8221; to &#8220;logged in&#8221; after the login form initially was loaded (e.g. by using an addition browser tab [...]<div
class='yarpp-related-rss'> Related posts:<ol><li><a
href='http://blog.janjonas.net/2013-03-27/dotnetnuke-validation-viewstate-failed-exception-dnn_7-login-form-multiple-tab' rel='bookmark' title='My daily DotNetNuke: &#8220;Validation of viewstate MAC failed&#8221; exception when using the DNN 7 login form in multiple tabs'>My daily DotNetNuke: &#8220;Validation of viewstate MAC failed&#8221; exception when using the DNN 7 login form in multiple tabs</a></li><li><a
href='http://blog.janjonas.net/2011-07-24/asp_net-mvc_3-ajax-form-jquery-validate-supporting-unobtrusive-client-side-validation-and-server-side-validation' rel='bookmark' title='ASP.NET MVC 3: Ajax Form with jQuery validate supporting (unobtrusive) Client Side Validation and Server Side Validation'>ASP.NET MVC 3: Ajax Form with jQuery validate supporting (unobtrusive) Client Side Validation and Server Side Validation</a></li><li><a
href='http://blog.janjonas.net/2011-08-07/asp_net-mvc_3-jquery-ajax-submit-ajax-form-supporting-unobtrusive-client-side-validation-and-server-side-validation' rel='bookmark' title='ASP.NET MVC 3: Using jQuery .ajax() function to submit Ajax Form supporting (unobtrusive) Client Side Validation and Server Side Validation'>ASP.NET MVC 3: Using jQuery .ajax() function to submit Ajax Form supporting (unobtrusive) Client Side Validation and Server Side Validation</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<p>As I&#8217;ve written in <a
href="http://blog.janjonas.net/2013-03-27/dotnetnuke-validation-viewstate-failed-exception-dnn_7-login-form-multiple-tab">one of my previous posts</a>, I found out that one gets a “Validation of viewstate MAC failed” exception when submitting a DNN login form and the login status has changed from &#8220;not logged in&#8221; to &#8220;logged in&#8221; after the login form initially was loaded (e.g. by using an addition browser tab to log in).<br
/> After contacting the DNN support team it turned out, that this is not a bug, but a security feature in DNN. In detail, DNN adds the username of the current session to the APS.NET <em>ViewStateUserKey</em> (see &#8220;<a
href="http://msdn.microsoft.com/en-us/library/ms972969.aspx#securitybarriers_topic2" target="_blank">Take Advantage of ASP.NET Built-in Features to Fend Off Web Attacks</a>&#8221; on MSDN for more information).<br
/> In DNN profession knowledge base, two resolutions are described which both have their drawbacks:</p><ul><li>One could edit the <em>Default.aspx.cs</em> and remove the username from the <em>ViewStateUserKey</em> which has to be done after each DNN update because <em>Default.aspx.cs</em> will be overwritten when updating the framework.</li><li>One could disable &#8220;ViewState MAC validation&#8221; entirely by setting <em>enableViewStateMac</em> to false in <em>Web.config</em> file which is not recommended due to security problems.</li></ul><p>I finally came up with the following code snippet that I&#8217;ve added to the code behind file of the skin:</p><div
class="wp_syntax"><table><tr><td
class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> OnInit<span style="color: #008000;">&#40;</span>EventArgs e<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  <span style="color: #008080; font-style: italic;">// Catch &quot;Validation of viewstate MAC failed&quot; exceptions and redirect the user </span>
  <span style="color: #008080; font-style: italic;">// to the current page (i.e. force a redirect on the client)</span>
  Page<span style="color: #008000;">.</span><span style="color: #0000FF;">Error</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">&#40;</span>sender, args<span style="color: #008000;">&#41;</span> <span style="color: #008000;">=&gt;</span>
  <span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">!</span><span style="color: #008000;">&#40;</span>HttpContext<span style="color: #008000;">.</span><span style="color: #0000FF;">Current</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Error</span> <span style="color: #008000;">is</span> HttpException<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> <span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">!</span><span style="color: #008000;">&#40;</span>HttpContext<span style="color: #008000;">.</span><span style="color: #0000FF;">Current</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Error</span><span style="color: #008000;">.</span><span style="color: #0000FF;">InnerException</span> <span style="color: #008000;">is</span> ViewStateException<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> <span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span>
&nbsp;
    HttpContext<span style="color: #008000;">.</span><span style="color: #0000FF;">Current</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Response</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Clear</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    Response<span style="color: #008000;">.</span><span style="color: #0000FF;">Redirect</span><span style="color: #008000;">&#40;</span>Request<span style="color: #008000;">.</span><span style="color: #0000FF;">UrlReferrer</span> <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">?</span> Request<span style="color: #008000;">.</span><span style="color: #0000FF;">Url</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">:</span> Request<span style="color: #008000;">.</span><span style="color: #0000FF;">UrlReferrer</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
  <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
  <span style="color: #0600FF; font-weight: bold;">base</span><span style="color: #008000;">.</span><span style="color: #0000FF;">OnInit</span><span style="color: #008000;">&#40;</span>e<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div><p>In detail the code above adds an error handler that catches “Validation of viewstate MAC failed” exceptions and forces the client to reload the current page in case of such an excpetion (which updates the <em>ViewStateUserKey</em> according to the current session state). Since this error handler needs to be added on every page, the skin is the perfect place to put the code into.</p><div
class='yarpp-related-rss'><p>Related posts:<ol><li><a
href='http://blog.janjonas.net/2013-03-27/dotnetnuke-validation-viewstate-failed-exception-dnn_7-login-form-multiple-tab' rel='bookmark' title='My daily DotNetNuke: &#8220;Validation of viewstate MAC failed&#8221; exception when using the DNN 7 login form in multiple tabs'>My daily DotNetNuke: &#8220;Validation of viewstate MAC failed&#8221; exception when using the DNN 7 login form in multiple tabs</a></li><li><a
href='http://blog.janjonas.net/2011-07-24/asp_net-mvc_3-ajax-form-jquery-validate-supporting-unobtrusive-client-side-validation-and-server-side-validation' rel='bookmark' title='ASP.NET MVC 3: Ajax Form with jQuery validate supporting (unobtrusive) Client Side Validation and Server Side Validation'>ASP.NET MVC 3: Ajax Form with jQuery validate supporting (unobtrusive) Client Side Validation and Server Side Validation</a></li><li><a
href='http://blog.janjonas.net/2011-08-07/asp_net-mvc_3-jquery-ajax-submit-ajax-form-supporting-unobtrusive-client-side-validation-and-server-side-validation' rel='bookmark' title='ASP.NET MVC 3: Using jQuery .ajax() function to submit Ajax Form supporting (unobtrusive) Client Side Validation and Server Side Validation'>ASP.NET MVC 3: Using jQuery .ajax() function to submit Ajax Form supporting (unobtrusive) Client Side Validation and Server Side Validation</a></li></ol></p></div> ]]></content:encoded> <wfw:commentRss>http://blog.janjonas.net/2013-04-18/dotnetnuke-workaround-validation-viewstate-failed-exception-dnn_7-login-form/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>My daily DotNetNuke: ModuleController.UpdateTabModuleSetting() truncates setting names to 50 characters</title><link>http://blog.janjonas.net/2013-04-02/dotnetnuke-modulecontroller-updatetabmodulesetting-truncate-setting-name</link> <comments>http://blog.janjonas.net/2013-04-02/dotnetnuke-modulecontroller-updatetabmodulesetting-truncate-setting-name#comments</comments> <pubDate>Tue, 02 Apr 2013 16:31:03 +0000</pubDate> <dc:creator>Jan Jonas</dc:creator> <category><![CDATA[Programming]]></category> <category><![CDATA[.NET]]></category> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[DotNetNuke]]></category> <category><![CDATA[MyDailyDNN]]></category> <guid
isPermaLink="false">http://blog.janjonas.net/?p=1784</guid> <description><![CDATA[This is the second blog post in my new &#8220;My daily DotNetNuke&#8221; blog series and it&#8217;s about a problem I found out when saving TabModuleSettings in my custom module. Generally, saving ModuleSettings and TabModuleSettings in DotNetNuke is very straightforward: The DotNetNuke.Entities.Modules.ModuleController offers two simple update methods: UpdateModuleSetting(int ModuleId, string SettingName, string SettingValue) for updating ModuleSettings [...]<div
class='yarpp-related-rss'> Related posts:<ol><li><a
href='http://blog.janjonas.net/2013-03-27/dotnetnuke-validation-viewstate-failed-exception-dnn_7-login-form-multiple-tab' rel='bookmark' title='My daily DotNetNuke: &#8220;Validation of viewstate MAC failed&#8221; exception when using the DNN 7 login form in multiple tabs'>My daily DotNetNuke: &#8220;Validation of viewstate MAC failed&#8221; exception when using the DNN 7 login form in multiple tabs</a></li><li><a
href='http://blog.janjonas.net/2011-11-26/asp_net-mvc_3-remix-library-add-controller-actions-mixins' rel='bookmark' title='ASP.NET MVC 3: Use re-mix library to add controller actions with mixins'>ASP.NET MVC 3: Use re-mix library to add controller actions with mixins</a></li><li><a
href='http://blog.janjonas.net/2011-05-27/asp-net-mvc-how-to-add-elmah-error-logging-modules-handlers' rel='bookmark' title='ASP.NET MVC: How to add ELMAH (Error Logging Modules and Handlers for ASP.NET)'>ASP.NET MVC: How to add ELMAH (Error Logging Modules and Handlers for ASP.NET)</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<p>This is the second blog post in my new <a
href="http://blog.janjonas.net/tag/mydailydnn">&#8220;My daily DotNetNuke&#8221;</a> blog series and it&#8217;s about a problem I found out when saving <em>TabModuleSettings</em> in my custom module.</p><p>Generally, saving <em>ModuleSettings</em> and <em>TabModuleSettings</em> in DotNetNuke is very straightforward: The <em>DotNetNuke.Entities.Modules.ModuleController</em> offers two simple update methods:</p><ul><li><em>UpdateModuleSetting(int ModuleId, string SettingName, string SettingValue)</em> for updating <em>ModuleSettings</em> and</li><li><em>UpdateTabModuleSetting(int tabModuleId, string settingName, string settingValue)</em> for updating <em>TabModuleSettings</em>.</li></ul><p>My code to update <em>TabModuleSettings</em> looks as follows:</p><div
class="wp_syntax"><table><tr><td
class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">var</span> settingName <span style="color: #008000;">=</span> <span style="color: #008000;">typeof</span><span style="color: #008000;">&#40;</span>MyType<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">// Create unique setting name</span>
<span style="color: #0600FF; font-weight: bold;">var</span> moduleController <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ModuleController<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
moduleController<span style="color: #008000;">.</span><span style="color: #0000FF;">UpdateTabModuleSetting</span><span style="color: #008000;">&#40;</span>module<span style="color: #008000;">.</span><span style="color: #0000FF;">TabModuleId</span>, settingName, settingValue<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div><p>This code seems to works fine, but I was not able to get the the settings back from the module&#8217;s <em>TabModuleSettings</em> Hashtable. After some research I found out, that DotNetNuke truncates setting names to 50 characters (I used the full qualified name of my class which exceeds the 50 characters limit to create a unique setting name). As far as I understand the framework, the reason is that the columns <em>[SettingName]</em> in the tables <em>[TabModuleSettings]</em> and <em>[ModuleSettings]</em> are defined as <em>[nvarchar](50)</em>.</p><p>IMHO, the DotNetNuke should throw an <em>ArgumentException</em> if one uses an invalid setting name. As long as this is not the case, keep this limitation in mind when creating setting names&#8230;</p><div
class='yarpp-related-rss'><p>Related posts:<ol><li><a
href='http://blog.janjonas.net/2013-03-27/dotnetnuke-validation-viewstate-failed-exception-dnn_7-login-form-multiple-tab' rel='bookmark' title='My daily DotNetNuke: &#8220;Validation of viewstate MAC failed&#8221; exception when using the DNN 7 login form in multiple tabs'>My daily DotNetNuke: &#8220;Validation of viewstate MAC failed&#8221; exception when using the DNN 7 login form in multiple tabs</a></li><li><a
href='http://blog.janjonas.net/2011-11-26/asp_net-mvc_3-remix-library-add-controller-actions-mixins' rel='bookmark' title='ASP.NET MVC 3: Use re-mix library to add controller actions with mixins'>ASP.NET MVC 3: Use re-mix library to add controller actions with mixins</a></li><li><a
href='http://blog.janjonas.net/2011-05-27/asp-net-mvc-how-to-add-elmah-error-logging-modules-handlers' rel='bookmark' title='ASP.NET MVC: How to add ELMAH (Error Logging Modules and Handlers for ASP.NET)'>ASP.NET MVC: How to add ELMAH (Error Logging Modules and Handlers for ASP.NET)</a></li></ol></p></div> ]]></content:encoded> <wfw:commentRss>http://blog.janjonas.net/2013-04-02/dotnetnuke-modulecontroller-updatetabmodulesetting-truncate-setting-name/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>SubsonicTools: Export all playlists from Subsonic Music Streamer to .m3u playlist files</title><link>http://blog.janjonas.net/2013-03-29/subsonictools-export-playlists-subsonic-music-streamer-m3u-playlist-files</link> <comments>http://blog.janjonas.net/2013-03-29/subsonictools-export-playlists-subsonic-music-streamer-m3u-playlist-files#comments</comments> <pubDate>Fri, 29 Mar 2013 17:25:22 +0000</pubDate> <dc:creator>Jan Jonas</dc:creator> <category><![CDATA[Howto]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[System administration]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[Subsonic]]></category> <category><![CDATA[SubsonicTools]]></category> <guid
isPermaLink="false">http://blog.janjonas.net/?p=1770</guid> <description><![CDATA[Starting with version 4.7 (changelog), the Subsonic Music Streamer no longer saves playlists as .m3u files but stores the playlist information in its internal database to offer a more sophisticated playlist management (like shared and private playlists). Before version 4.7 it was very easy to share the Subsonic playlists with other media servers that also [...]<div
class='yarpp-related-rss'> Related posts:<ol><li><a
href='http://blog.janjonas.net/2011-07-13/windows-batch-file-delete-old-files-remove-empty-directories-recursively' rel='bookmark' title='Windows batch file to delete old files and remove empty directories recursively'>Windows batch file to delete old files and remove empty directories recursively</a></li><li><a
href='http://blog.janjonas.net/2012-04-06/asp_net-howto-user-control-library-compile-dll-file' rel='bookmark' title='ASP.NET How-To: Create User Control library by compiling User Controls into .dll files'>ASP.NET How-To: Create User Control library by compiling User Controls into .dll files</a></li><li><a
href='http://blog.janjonas.net/2010-02-25/ubuntu-reset-debian-sys-maint-mysql-password' rel='bookmark' title='Ubuntu: Reset debian-sys-maint&#8217;s mysql password'>Ubuntu: Reset debian-sys-maint&#8217;s mysql password</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<p>Starting with version 4.7 (<a
href="http://www.subsonic.org/pages/changelog.jsp" target="_blank">changelog</a>), the <a
href="http://www.subsonic.org/" target="_blank">Subsonic Music Streamer</a> no longer saves playlists as <em>.m3u</em> files but stores the playlist information in its internal database to offer a more sophisticated playlist management (like shared and private playlists).</p><p>Before version 4.7 it was very easy to share the Subsonic playlists with other media servers that also use a directory containing <em>.m3u</em> files as data source (like the <a
href="http://www.mysqueezebox.com/download" target="_blank">Logitech Media Server</a>): Sharing a folder containing the <em>.m3u</em> files automatically synchronizes the playlists between the media servers.</p><p>Fortunately, the Subsonic media server offers a very well documented <a
href="http://www.subsonic.org/pages/api.jsp" target="_blank">REST API</a> that can be used to export playlist information amongst a lot of other functionalities.</p><p>To easily export all playlists from the Subsonic media server and save them as <em>.m3u</em> files in a specific destination directory I&#8217;ve written the SubsonicTools project which is available <a
href="https://github.com/janjonas/SubsonicTools" target="_blank">here (GitHub)</a>.</p><p>To export all playlist with SubsonicTools use the following command:</p><div
class="wp_syntax"><table><tr><td
class="code"><pre class="shell" style="font-family:monospace;">python SubsonicTools.py ExportPlaylists --url=[SUBSONIC-URL] --user=[YOUR-SUBSONIC-USER] --password=[YOUR-SUBSONIC-PASSWORD] --out=[PATH-TO-DESTINATION-DIRECTORY] --prefix=[FILE-PREFIX]</pre></td></tr></table></div><p>To run SubsonicTools 0.1 you need to install the Python library <a
href="http://python-requests.org" target="_blank">Requests</a> >= 0.8.8 (follow the install instructions <a
href="http://docs.python-requests.org/en/latest/user/install/#install" target="_blank">here</a>).</p><p>Please note: The SubsonicTools project is in a prototype state; it was only tested with Python 2.7 and a Subsonic media server 4.7. If you find any errors, miss a feature or have any suggestions please don&#8217;t hesitate to leave a comment or to <a
href="http://blog.janjonas.net/contact" target="_blank">send me a private message</a>.</p><div
class='yarpp-related-rss'><p>Related posts:<ol><li><a
href='http://blog.janjonas.net/2011-07-13/windows-batch-file-delete-old-files-remove-empty-directories-recursively' rel='bookmark' title='Windows batch file to delete old files and remove empty directories recursively'>Windows batch file to delete old files and remove empty directories recursively</a></li><li><a
href='http://blog.janjonas.net/2012-04-06/asp_net-howto-user-control-library-compile-dll-file' rel='bookmark' title='ASP.NET How-To: Create User Control library by compiling User Controls into .dll files'>ASP.NET How-To: Create User Control library by compiling User Controls into .dll files</a></li><li><a
href='http://blog.janjonas.net/2010-02-25/ubuntu-reset-debian-sys-maint-mysql-password' rel='bookmark' title='Ubuntu: Reset debian-sys-maint&#8217;s mysql password'>Ubuntu: Reset debian-sys-maint&#8217;s mysql password</a></li></ol></p></div> ]]></content:encoded> <wfw:commentRss>http://blog.janjonas.net/2013-03-29/subsonictools-export-playlists-subsonic-music-streamer-m3u-playlist-files/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>My daily DotNetNuke: &#8220;Validation of viewstate MAC failed&#8221; exception when using the DNN 7 login form in multiple tabs</title><link>http://blog.janjonas.net/2013-03-27/dotnetnuke-validation-viewstate-failed-exception-dnn_7-login-form-multiple-tab</link> <comments>http://blog.janjonas.net/2013-03-27/dotnetnuke-validation-viewstate-failed-exception-dnn_7-login-form-multiple-tab#comments</comments> <pubDate>Wed, 27 Mar 2013 22:00:28 +0000</pubDate> <dc:creator>Jan Jonas</dc:creator> <category><![CDATA[Programming]]></category> <category><![CDATA[.NET]]></category> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[DotNetNuke]]></category> <category><![CDATA[MyDailyDNN]]></category> <guid
isPermaLink="false">http://blog.janjonas.net/?p=1763</guid> <description><![CDATA[Update 2013-04-18 It turned out, that this is not a bug, but a security feature in DNN. I written an new blog post that describes a possible workaround. This is the first blog post in my new &#8220;My daily DotNetNuke&#8221; blog series. For a while now, I&#8217;m developing custom DotNetNuke modules and skins and I [...]<div
class='yarpp-related-rss'> Related posts:<ol><li><a
href='http://blog.janjonas.net/2013-04-18/dotnetnuke-workaround-validation-viewstate-failed-exception-dnn_7-login-form' rel='bookmark' title='My daily DotNetNuke: Workaround for “Validation of viewstate MAC failed” exception when using the DNN 7 login form in multiple tabs'>My daily DotNetNuke: Workaround for “Validation of viewstate MAC failed” exception when using the DNN 7 login form in multiple tabs</a></li><li><a
href='http://blog.janjonas.net/2013-04-02/dotnetnuke-modulecontroller-updatetabmodulesetting-truncate-setting-name' rel='bookmark' title='My daily DotNetNuke: ModuleController.UpdateTabModuleSetting() truncates setting names to 50 characters'>My daily DotNetNuke: ModuleController.UpdateTabModuleSetting() truncates setting names to 50 characters</a></li><li><a
href='http://blog.janjonas.net/2011-07-24/asp_net-mvc_3-ajax-form-jquery-validate-supporting-unobtrusive-client-side-validation-and-server-side-validation' rel='bookmark' title='ASP.NET MVC 3: Ajax Form with jQuery validate supporting (unobtrusive) Client Side Validation and Server Side Validation'>ASP.NET MVC 3: Ajax Form with jQuery validate supporting (unobtrusive) Client Side Validation and Server Side Validation</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<p><strong>Update 2013-04-18</strong> It turned out, that this is not a bug, but a security feature in DNN. I written an <a
href="http://blog.janjonas.net/2013-04-18/dotnetnuke-workaround-validation-viewstate-failed-exception-dnn_7-login-form">new blog post</a> that describes a possible workaround.</p><p>This is the first blog post in my new &#8220;My daily DotNetNuke&#8221; blog series. For a while now, I&#8217;m developing custom DotNetNuke modules and skins and I would like to share my experiences, problems and best practices, hoping that other users, developers or administrators can benefit from them when working with the DotNetNuke CMS. I&#8217;m using the Professional edition of DotNetNuke but most of the topics discussed in my blog posts are also related to the <a
href="http://www.dotnetnuke.com/Products/Compare-Platform-Editions.aspx" target="_blank">other editions</a> (Community, Professional or Enterprise).</p><p>My first post is about a bug that I discovered in DotNetNuke login form. It can be easily reproduced in a blank DotNetNuke 7.0.3 environment with the following the step by step instruction:</p><ol><li>Make sure that you are logged out.</li><li>Load the DNN portal&#8217;s start page in two browser tabs.</li><li>Click the &#8220;Login&#8221; button in both tabs to open the login popup.</li><li>Enter your credentials on the first tab and submit the form to log in.</li><li>Switch to the second tab and try to log in on the second tab (using the same credentials).</li></ol><p>Instead of being logged in in the second tab the login form is replaced by a DotNetNuke error page and the following <em>System.Web.HttpException</em> is logged:</p><div
class="wp_syntax"><table><tr><td
class="code"><pre class="log" style="font-family:monospace;">[Thread:62][FATAL] DotNetNuke.Framework.PageBase - An error has occurred while loading page.
System.Web.HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that &lt;machineKey&gt; configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. ---&gt; System.Web.UI.ViewStateException: Invalid viewstate.
Client IP: ::1
Port: 64119
Referer: http://localhost:7003/login.aspx?ReturnUrl=/&amp;popUp=true
Path: /Default.aspx
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0
ViewState: 9NdsurNkQPp8U5spr0WuHQ8Al51OwxOWHeOuUi83Vf2fbOnYOCYKtoC0du2pECVvwnIM9JKMW/pHyJUixctMCehGWTDZPg8Yk3byUd4LQjnH5m+VDA/w0oXK9iUqYeAxPWa2QVzqDeuLgDtwv8jJulHu0UfEp+1AOGNev48AB/JHynG/9ZjNPG6wMR7RInTI+1B5dRwhpSOsZhmoUnOiw4qjRZDMwTSYxGs/34e+7Bv4qCjOTDEpwQBC6D7iiEprJeo9VLPFR1iw/9cYFdmRsPRFKgU+RKFHBYCX9mAtkyX1HX6DyiNA70ERlh4NttwiOeKN+FytmsOZoidwmt3LXxyAbTHsqH+NgTr65HDt4EWAWOAmGiyx91wej3DP8vhde9RGKlJNipCOrGtybiybeCbg7LfSvQ3jsv3vUALCwgKUfNTSS4L2aPQpPvVmJWb2QEar1fkRvQuCm84If2YZU4l0oKoUdK/dy/8bCGGow0/idGCfejX4ZqIIORCzvoextYCBc0e9uNSurgNFE0kD91fs7X3ilqaImk+j78M+x/39kzD3zBiA6v8YI/X9fW7ljSZLzmdsUKiZIXV6aiQDE4moULxD5zsbgvbunfjyrp46skVCaMgXEcrLrUQmDBmNy9xS2jNmrqYNOYmLIabHG8Z7V6VA5wHVr0HmY5Tdpgr5AVUYFdHobW3EiFkuckNecpOhwpJ8IAqsb5RUN5xpyUjnEyAQpJVmt1/UOkQSH69z/B0x9tFzB01SiUjFJ7IPHpiEEQzfEzM4h1QIyy0kcsjyM/goGOq4...
at System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString, Purpose purpose)
at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter2 formatter, String serializedState, Purpose purpose)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
at System.Web.UI.Page.LoadAllState()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
[ERROR] DotNetNuke.Services.Exceptions.Exceptions - DotNetNuke.Services.Exceptions.PageLoadException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that &lt;machineKey&gt; configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. ---&gt; System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that &lt;machineKey&gt; configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. ---&gt; System.Web.UI.ViewStateException: Invalid viewstate.
Client IP: ::1
Port: 64119
Referer: http://localhost:7003/login.aspx?ReturnUrl=/&amp;popUp=true
Path: /Default.aspx
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0
ViewState: 9NdsurNkQPp8U5spr0WuHQ8Al51OwxOWHeOuUi83Vf2fbOnYOCYKtoC0du2pECVvwnIM9JKMW/pHyJUixctMCehGWTDZPg8Yk3byUd4LQjnH5m+VDA/w0oXK9iUqYeAxPWa2QVzqDeuLgDtwv8jJulHu0UfEp+1AOGNev48AB/JHynG/9ZjNPG6wMR7RInTI+1B5dRwhpSOsZhmoUnOiw4qjRZDMwTSYxGs/34e+7Bv4qCjOTDEpwQBC6D7iiEprJeo9VLPFR1iw/9cYFdmRsPRFKgU+RKFHBYCX9mAtkyX1HX6DyiNA70ERlh4NttwiOeKN+FytmsOZoidwmt3LXxyAbTHsqH+NgTr65HDt4EWAWOAmGiyx91wej3DP8vhde9RGKlJNipCOrGtybiybeCbg7LfSvQ3jsv3vUALCwgKUfNTSS4L2aPQpPvVmJWb2QEar1fkRvQuCm84If2YZU4l0oKoUdK/dy/8bCGGow0/idGCfejX4ZqIIORCzvoextYCBc0e9uNSurgNFE0kD91fs7X3ilqaImk+j78M+x/39kzD3zBiA6v8YI/X9fW7ljSZLzmdsUKiZIXV6aiQDE4moULxD5zsbgvbunfjyrp46skVCaMgXEcrLrUQmDBmNy9xS2jNmrqYNOYmLIabHG8Z7V6VA5wHVr0HmY5Tdpgr5AVUYFdHobW3EiFkuckNecpOhwpJ8IAqsb5RUN5xpyUjnEyAQpJVmt1/UOkQSH69z/B0x9tFzB01SiUjFJ7IPHpiEEQzfEzM4h1QIyy0kcsjyM/goGOq4...
--- End of inner exception stack trace ---
at System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString, Purpose purpose)
at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter2 formatter, String serializedState, Purpose purpose)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
at System.Web.UI.Page.LoadAllState()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---</pre></td></tr></table></div><p>I hope that this bug is being fixed in a future release&#8230;</p><div
class='yarpp-related-rss'><p>Related posts:<ol><li><a
href='http://blog.janjonas.net/2013-04-18/dotnetnuke-workaround-validation-viewstate-failed-exception-dnn_7-login-form' rel='bookmark' title='My daily DotNetNuke: Workaround for “Validation of viewstate MAC failed” exception when using the DNN 7 login form in multiple tabs'>My daily DotNetNuke: Workaround for “Validation of viewstate MAC failed” exception when using the DNN 7 login form in multiple tabs</a></li><li><a
href='http://blog.janjonas.net/2013-04-02/dotnetnuke-modulecontroller-updatetabmodulesetting-truncate-setting-name' rel='bookmark' title='My daily DotNetNuke: ModuleController.UpdateTabModuleSetting() truncates setting names to 50 characters'>My daily DotNetNuke: ModuleController.UpdateTabModuleSetting() truncates setting names to 50 characters</a></li><li><a
href='http://blog.janjonas.net/2011-07-24/asp_net-mvc_3-ajax-form-jquery-validate-supporting-unobtrusive-client-side-validation-and-server-side-validation' rel='bookmark' title='ASP.NET MVC 3: Ajax Form with jQuery validate supporting (unobtrusive) Client Side Validation and Server Side Validation'>ASP.NET MVC 3: Ajax Form with jQuery validate supporting (unobtrusive) Client Side Validation and Server Side Validation</a></li></ol></p></div> ]]></content:encoded> <wfw:commentRss>http://blog.janjonas.net/2013-03-27/dotnetnuke-validation-viewstate-failed-exception-dnn_7-login-form-multiple-tab/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Eclipse &amp; Windows 64-Bit: Resolve &#8220;Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available&#8230;&#8221; and &#8220;Java was started but returned exit code= 13&#8230;&#8221;</title><link>http://blog.janjonas.net/2013-02-09/eclipse-windows-64bit-java-runtime-environment-java-development-kit-must-be-available-java-returned-exit-code-13</link> <comments>http://blog.janjonas.net/2013-02-09/eclipse-windows-64bit-java-runtime-environment-java-development-kit-must-be-available-java-returned-exit-code-13#comments</comments> <pubDate>Sat, 09 Feb 2013 12:26:29 +0000</pubDate> <dc:creator>Jan Jonas</dc:creator> <category><![CDATA[Howto]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[System administration]]></category> <category><![CDATA[Eclipse]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[Windows]]></category> <guid
isPermaLink="false">http://blog.janjonas.net/?p=1743</guid> <description><![CDATA[It&#8217;s been a while I&#8217;ve set up Eclipse the last time and today I tried to run Eclipse (&#8220;Eclipse Classic 4.2.1 / 64 Bit&#8221; downloaded from here to be precise) on my fresh installed Windows 8. After extracting the zip folder and starting eclipse.exe I got the error message: Java Runtime Environment (JRE) or Java [...]<div
class='yarpp-related-rss'> Related posts:<ol><li><a
href='http://blog.janjonas.net/2011-01-14/windows-android-sdk-installer-does-not-find-java-development-kit-jdk' rel='bookmark' title='Windows: Android SDK installer does not find Java SE Development Kit (JDK)'>Windows: Android SDK installer does not find Java SE Development Kit (JDK)</a></li><li><a
href='http://blog.janjonas.net/2011-01-10/eclipse-helios-subversive-installing-svn-connector-failed' rel='bookmark' title='Eclipse 3.6.1 (Helios) &amp; Subversive: Installing SVN connector failed'>Eclipse 3.6.1 (Helios) &#038; Subversive: Installing SVN connector failed</a></li><li><a
href='http://blog.janjonas.net/2012-11-04/ubuntu_12_04-ant-unable-locate-tools_jar' rel='bookmark' title='Ubuntu 12.04.1 LTS &amp; ant: Resolve &#8220;Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar&#8221;'>Ubuntu 12.04.1 LTS &#038; ant: Resolve &#8220;Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar&#8221;</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<p>It&#8217;s been a while I&#8217;ve set up Eclipse the last time and today I tried to run Eclipse (&#8220;Eclipse Classic 4.2.1 / 64 Bit&#8221; downloaded from <a
href="http://www.eclipse.org/downloads/" target="_blank">here</a> to be precise) on my fresh installed Windows 8. After extracting the zip folder and starting <em>eclipse.exe</em> I got the error message:</p><blockquote><p>Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse&hellip;</p></blockquote><p>I haven&#8217;t had installed Java yet, so I googled for &#8220;Java download&#8221;, downloaded and installed Java from <a
href="http://www.java.com/de/download/" target="_blank">http://www.java.com/de/download/</a>. I tried starting Eclipse again, but surprisingly I got the same &#8220;Java not found&#8221; error.</p><p>My next step was to edit the <em>eclipse.ini</em> file as described in the <a
href="http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F#eclipse.ini" target="_blank">Eclipse FAQ</a> and added (just before the &#8220;<em>-vmargs</em>&#8221; line):</p><div
class="wp_syntax"><table><tr><td
class="code"><pre class="ini" style="font-family:monospace;">-vm
c:\Program Files <span style="">&#40;</span>x86<span style="">&#41;</span>\Java\jre7\bin\javaw.exe</pre></td></tr></table></div><p>After restarting Eclipse with the modified <em>eclispe.ini</em> I got a new error message saying:</p><blockquote><p>Java was started but returned exit code= 13&hellip;</p></blockquote><p>Finally I found out, that the Java download page <a
href="http://www.java.com/de/download/" target="_blank">http://www.java.com/de/download/</a> redirected my Chrome browser to a 32-Bit Java download but a 64-Bit version of Java is needed in order to run the 64-Bit version of Eclipse.</p><p>So finally I was able to run Eclipse 64-Bit by:</p><ol><li>Downloading the 64-Bit Java version form here <a
href="http://www.java.com/download/manual.jsp" target="_blank">http://www.java.com/download/manual.jsp</a></li><li>Adding the following two lines to my <em>eclipse.ini</em> file (just before the &#8220;<em>-vmargs</em>&#8221; line):<div
class="wp_syntax"><table><tr><td
class="code"><pre class="ini" style="font-family:monospace;">-vm
c:\Program Files\Java\jre7\bin\javaw.exe</pre></td></tr></table></div></li></ol><p>Hope this helps somebody when trying to launch Eclipse 64-Bit. Happy programming&hellip;</p><div
class='yarpp-related-rss'><p>Related posts:<ol><li><a
href='http://blog.janjonas.net/2011-01-14/windows-android-sdk-installer-does-not-find-java-development-kit-jdk' rel='bookmark' title='Windows: Android SDK installer does not find Java SE Development Kit (JDK)'>Windows: Android SDK installer does not find Java SE Development Kit (JDK)</a></li><li><a
href='http://blog.janjonas.net/2011-01-10/eclipse-helios-subversive-installing-svn-connector-failed' rel='bookmark' title='Eclipse 3.6.1 (Helios) &amp; Subversive: Installing SVN connector failed'>Eclipse 3.6.1 (Helios) &#038; Subversive: Installing SVN connector failed</a></li><li><a
href='http://blog.janjonas.net/2012-11-04/ubuntu_12_04-ant-unable-locate-tools_jar' rel='bookmark' title='Ubuntu 12.04.1 LTS &amp; ant: Resolve &#8220;Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar&#8221;'>Ubuntu 12.04.1 LTS &#038; ant: Resolve &#8220;Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar&#8221;</a></li></ol></p></div> ]]></content:encoded> <wfw:commentRss>http://blog.janjonas.net/2013-02-09/eclipse-windows-64bit-java-runtime-environment-java-development-kit-must-be-available-java-returned-exit-code-13/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Ubuntu 12.04.1 LTS &amp; ant: Resolve &#8220;Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar&#8221;</title><link>http://blog.janjonas.net/2012-11-04/ubuntu_12_04-ant-unable-locate-tools_jar</link> <comments>http://blog.janjonas.net/2012-11-04/ubuntu_12_04-ant-unable-locate-tools_jar#comments</comments> <pubDate>Sun, 04 Nov 2012 12:31:50 +0000</pubDate> <dc:creator>Jan Jonas</dc:creator> <category><![CDATA[Howto]]></category> <category><![CDATA[System administration]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[Ubuntu]]></category> <guid
isPermaLink="false">http://blog.janjonas.net/?p=1734</guid> <description><![CDATA[I recently got the following error when I tried to run ant on a fresh installed Ubuntu 12.04.1 LTS machine: Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar The solution was to install the openjdk-6-jdk package as follows: #sudo apt-get install openjdk-6-jdk Hope this helps somebody&#8230;<div
class='yarpp-related-rss'> Related posts:<ol><li><a
href='http://blog.janjonas.net/2010-06-12/ubuntu_10_04-java-setup-sun-jdk' rel='bookmark' title='Ubuntu 10.04 &amp; Java: Setup Sun JDK'>Ubuntu 10.04 &#038; Java: Setup Sun JDK</a></li><li><a
href='http://blog.janjonas.net/2011-01-14/windows-android-sdk-installer-does-not-find-java-development-kit-jdk' rel='bookmark' title='Windows: Android SDK installer does not find Java SE Development Kit (JDK)'>Windows: Android SDK installer does not find Java SE Development Kit (JDK)</a></li><li><a
href='http://blog.janjonas.net/2010-09-25/ubuntu-10_04-setup-apc-php_5_3-apache2' rel='bookmark' title='Ubuntu 10.04: Setup APC for PHP 5.3 and Apache2'>Ubuntu 10.04: Setup APC for PHP 5.3 and Apache2</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<p>I recently got the following error when I tried to run <em>ant</em> on a fresh installed Ubuntu 12.04.1 LTS machine:</p><blockquote><p> Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar</p></blockquote><p>The solution was to install the <em>openjdk-6-jdk</em> package as follows:</p><div
class="wp_syntax"><table><tr><td
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;">#</span><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> openjdk-<span style="color: #000000;">6</span>-jdk</pre></td></tr></table></div><p>Hope this helps somebody&hellip;</p><div
class='yarpp-related-rss'><p>Related posts:<ol><li><a
href='http://blog.janjonas.net/2010-06-12/ubuntu_10_04-java-setup-sun-jdk' rel='bookmark' title='Ubuntu 10.04 &amp; Java: Setup Sun JDK'>Ubuntu 10.04 &#038; Java: Setup Sun JDK</a></li><li><a
href='http://blog.janjonas.net/2011-01-14/windows-android-sdk-installer-does-not-find-java-development-kit-jdk' rel='bookmark' title='Windows: Android SDK installer does not find Java SE Development Kit (JDK)'>Windows: Android SDK installer does not find Java SE Development Kit (JDK)</a></li><li><a
href='http://blog.janjonas.net/2010-09-25/ubuntu-10_04-setup-apc-php_5_3-apache2' rel='bookmark' title='Ubuntu 10.04: Setup APC for PHP 5.3 and Apache2'>Ubuntu 10.04: Setup APC for PHP 5.3 and Apache2</a></li></ol></p></div> ]]></content:encoded> <wfw:commentRss>http://blog.janjonas.net/2012-11-04/ubuntu_12_04-ant-unable-locate-tools_jar/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>ASP.NET MVC 4 RC: Get current controller name from HttpContext</title><link>http://blog.janjonas.net/2012-09-07/asp_net-mvc_4_rc-current-controller-name-from-httpcontext</link> <comments>http://blog.janjonas.net/2012-09-07/asp_net-mvc_4_rc-current-controller-name-from-httpcontext#comments</comments> <pubDate>Fri, 07 Sep 2012 12:14:59 +0000</pubDate> <dc:creator>Jan Jonas</dc:creator> <category><![CDATA[Howto]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[MVC]]></category> <category><![CDATA[MVC 4]]></category> <guid
isPermaLink="false">http://blog.janjonas.net/?p=1672</guid> <description><![CDATA[To find out the name of the current controller from a HTTP context, you can use the following code snippet: var controllerName = RouteTable.Routes.GetRouteData&#40; new HttpContextWrapper&#40;HttpContext.Current&#41; &#41;.Values&#91;&#34;controller&#34;&#93;.ToString&#40;&#41;;<div
class='yarpp-related-rss'> Related posts:<ol><li><a
href='http://blog.janjonas.net/2011-02-15/aspnet-mvc_3-get-controller-action-razor-view' rel='bookmark' title='ASP.NET MVC 3: How to get the current controller and action in a Razor view'>ASP.NET MVC 3: How to get the current controller and action in a Razor view</a></li><li><a
href='http://blog.janjonas.net/2012-01-15/asp_net-mvc_3-remix-library-add-controller-actions-mixins-part2' rel='bookmark' title='ASP.NET MVC 3: Use re-mix library to add controller actions with mixins &#8211; Part 2'>ASP.NET MVC 3: Use re-mix library to add controller actions with mixins &#8211; Part 2</a></li><li><a
href='http://blog.janjonas.net/2011-11-26/asp_net-mvc_3-remix-library-add-controller-actions-mixins' rel='bookmark' title='ASP.NET MVC 3: Use re-mix library to add controller actions with mixins'>ASP.NET MVC 3: Use re-mix library to add controller actions with mixins</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<p>To find out the name of the current controller from a HTTP context, you can use the following code snippet:</p><div
class="wp_syntax"><table><tr><td
class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">var</span> controllerName <span style="color: #008000;">=</span> RouteTable<span style="color: #008000;">.</span><span style="color: #0000FF;">Routes</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetRouteData</span><span style="color: #008000;">&#40;</span>
  <span style="color: #008000;">new</span> HttpContextWrapper<span style="color: #008000;">&#40;</span>HttpContext<span style="color: #008000;">.</span><span style="color: #0000FF;">Current</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Values</span><span style="color: #008000;">&#91;</span><span style="color: #666666;">&quot;controller&quot;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div><div
class='yarpp-related-rss'><p>Related posts:<ol><li><a
href='http://blog.janjonas.net/2011-02-15/aspnet-mvc_3-get-controller-action-razor-view' rel='bookmark' title='ASP.NET MVC 3: How to get the current controller and action in a Razor view'>ASP.NET MVC 3: How to get the current controller and action in a Razor view</a></li><li><a
href='http://blog.janjonas.net/2012-01-15/asp_net-mvc_3-remix-library-add-controller-actions-mixins-part2' rel='bookmark' title='ASP.NET MVC 3: Use re-mix library to add controller actions with mixins &#8211; Part 2'>ASP.NET MVC 3: Use re-mix library to add controller actions with mixins &#8211; Part 2</a></li><li><a
href='http://blog.janjonas.net/2011-11-26/asp_net-mvc_3-remix-library-add-controller-actions-mixins' rel='bookmark' title='ASP.NET MVC 3: Use re-mix library to add controller actions with mixins'>ASP.NET MVC 3: Use re-mix library to add controller actions with mixins</a></li></ol></p></div> ]]></content:encoded> <wfw:commentRss>http://blog.janjonas.net/2012-09-07/asp_net-mvc_4_rc-current-controller-name-from-httpcontext/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Dynamic page generated in 1.151 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-06-20 08:59:59 -->
