<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Praburaj Thiagarajan</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/praburaj/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/praburaj/feed.xml</link>
    <description>Windows Communication Foundation. Check out what&amp;#039;s new with WCF 4.5 : https://msdn.microsoft.com/en-us/library/dd456789.aspx</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:24:15 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>XmlSerializer compat switch</title>
      <link>https://docs.microsoft.com/archive/blogs/praburaj/xmlserializer-compat-switch</link>
      <pubDate>Fri, 06 Dec 2013 15:10:00 GMT</pubDate>
      <dc:creator><![CDATA[Praburaj Thiagarajan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/praburaj/2013/12/06/xmlserializer-compat-switch/</guid>
      <description><![CDATA[XmlSerializer class in .NET 4.5 uses reflection emit to improve the cold startup time of your...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: Calibri; font-size: small;">XmlSerializer class in .NET 4.5 uses reflection emit to improve the cold startup time of your application. If you happen to run into any compatibility issues on running your existing .NET 40 applications running on a machine with .NET runtime &gt;= 4.5, then you might use the below compat switch in your config file to get the old behavior. </span></p>
<pre class="csharpcode"><span class="kwrd">&lt;?</span><span class="html">xml</span> <span class="attr">version</span><span class="kwrd">="1.0"</span> <span class="attr">encoding</span><span class="kwrd">="utf-8"</span> ?<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">configuration</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">startup</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">supportedRuntime</span> <span class="attr">version</span><span class="kwrd">="v4.0"</span> <span class="attr">sku</span><span class="kwrd">=".NETFramework,Version=v4.5"</span> <span class="kwrd">/&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">startup</span><span class="kwrd">&gt;</span>

</pre>
<p><span style="background-color: #ffff00;"><span class="kwrd">&nbsp; &nbsp; &lt;</span><span class="html">appSettings</span><span class="kwrd">&gt;</span> </span></p>
<p><span style="background-color: #ffff00;"><span class="kwrd">&lt;</span><span class="html">add</span> <span class="attr">key</span><span class="kwrd">="System:Xml:Serialization:UseLegacySerializerGeneration"</span> <span class="attr">value</span><span class="kwrd">="true"</span> <span class="kwrd">/&gt;</span></span></p>
<p><span style="background-color: #ffff00;"><span class="kwrd">&nbsp; &nbsp; &lt;/</span><span class="html">appSettings</span><span class="kwrd">&gt;</span></span></p>
<pre class="csharpcode"><span class="kwrd">&lt;/</span><span class="html">configuration</span><span class="kwrd">&gt;</span>&nbsp;</pre>
<p><code><span style="font-family: Calibri; font-size: small;">This is equivalent to the compat switch described in this <a href="https://support.microsoft.com/kb/2748720/en-us" target="_blank">KB article</a>. </span><span style="font-family: Calibri; font-size: small;">However the above appSetting based switch is recommended. The compat switch described in this <a href="https://support.microsoft.com/kb/2748720/en-us" target="_blank">KB article</a> is not compatible on a machine </span></code><code><span style="font-family: Calibri; font-size: small;">with .NET 4.0 runtime. As application will fail to load due to a configuration exception. The above appSetting based switch is compatible on both runtimes. </span></code></p>]]></content:encoded>
    </item>
    <item>
      <title>OWIN Startup class not detected</title>
      <link>https://docs.microsoft.com/archive/blogs/praburaj/owin-startup-class-not-detected</link>
      <pubDate>Mon, 02 Dec 2013 13:13:00 GMT</pubDate>
      <dc:creator><![CDATA[Praburaj Thiagarajan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/praburaj/2013/12/02/owin-startup-class-not-detected/</guid>
      <description><![CDATA[I've seen quite a lot of people running into the issue where their OWIN startup class is not...]]></description>
      <content:encoded><![CDATA[<p>I've seen quite a lot of people running into the issue where their OWIN startup class is not detected. Here are some of the more common reasons why the OWIN startup class is not detected.</p>
<ul>
<li><span style="font-size: 12px;">Check if your IIS application pool is in Integrated mode. Note: Running of an OWIN middleware is supported only on IIS Integrated pipeline. Classic pool is not supported.&nbsp;</span></li>
<li><span style="font-size: 12px;">Check if you have Microsoft.Owin.Host.SystemWeb Nuget package installed. This package is required for the OWIN startup class detection.</span></li>
<li><span style="font-size: 12px;">[Learnt from comments - Thanks @Eric]: If your Startup class is still not detected in IIS, try it again by clearing the ASP.net temporary files.&nbsp;</span></li>
</ul>
<div><span style="font-size: 12px;">Here is a detailed article on </span><a style="font-size: 12px;" href="https://www.asp.net/aspnet/overview/owin-and-katana/owin-startup-class-detection">OWIN startup class detection</a>&nbsp;for reference.&nbsp;</div>]]></content:encoded>
    </item>
    <item>
      <title>FileLoadException on Microsoft.Owin when running on worker role</title>
      <link>https://docs.microsoft.com/archive/blogs/praburaj/fileloadexception-on-microsoft-owin-when-running-on-worker-role</link>
      <pubDate>Wed, 20 Nov 2013 11:29:00 GMT</pubDate>
      <dc:creator><![CDATA[Praburaj Thiagarajan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/praburaj/2013/11/20/fileloadexception-on-microsoft-owin-when-running-on-worker-role/</guid>
      <description><![CDATA[Do you happen to see FileLoadException when you try to run a OWIN application (SignalR or WebAPI) on...]]></description>
      <content:encoded><![CDATA[<p>Do you happen to see FileLoadException when you try to run a <a href="https://www.owin.org">OWIN</a> application (SignalR or WebAPI) on a worker role project with the below message?</p>
<p><span style="text-decoration: underline; background-color: #ffff00;">System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Owin, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)</span></p>
<p><span style="text-decoration: underline;"><strong>Reason for the failure</strong></span>:</p>
<p>This is a known issue with Nuget client: Refer&nbsp;<a href="https://nuget.codeplex.com/workitem/3827" rel="nofollow">this</a>&nbsp;bug. Binding redirects not getting added automatically for worker role projects. The reason for this failure is SignalR/WebAPI binaries are built with a dependency over Microsoft.Owin version 2.0.0. But the latest available version of Microsoft.Owin in the public feed is &gt; 2.0.0. To fix this assembly binding issue when you install the same SignalR/WebAPI packages on a console application or a web application you will see assembly binding redirects being automatically added for you in the app.config by Nuget client. Due to an issue with Nuget client this is not happening in case of worker role projects.</p>
<p><span style="text-decoration: underline;"><strong>Fix for this issue</strong></span><strong>:</strong></p>
<p>To fix this issue add this to your worker role project's app.config (Alternatively try adding your signalR package to a console app and copy paste the binding redirects from its app.config):</p>
<pre class="scroll"><code class="csharp">&lt;configuration&gt;<br /> &lt;runtime&gt;<br /> &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;<br /> &lt;dependentAssembly&gt;<br /> &lt;assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;<br /> &lt;bindingRedirect oldVersion="0.0.0.0-2.0.2.0" newVersion="2.0.2.0" /&gt;<br /> &lt;/dependentAssembly&gt;<br /> &lt;dependentAssembly&gt;<br /> &lt;assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;<br /> &lt;bindingRedirect oldVersion="0.0.0.0-2.0.2.0" newVersion="2.0.2.0" /&gt;<br /> &lt;/dependentAssembly&gt;<br /> &lt;/assemblyBinding&gt;<br /> &lt;/runtime&gt;<br /> &lt;/configuration&gt;</code></pre>
<pre class="scroll" style="padding-left: 30px;">&nbsp;</pre>
<pre class="lang-ml prettyprint prettyprinted">&nbsp;</pre>]]></content:encoded>
    </item>
    <item>
      <title>NetTcpBinding &amp; mexTcpBinding sharing same port throws AddressAlreadyInUseException on upgrade to .net 4.5?</title>
      <link>https://docs.microsoft.com/archive/blogs/praburaj/nettcpbinding-mextcpbinding-sharing-same-port-throws-addressalreadyinuseexception-on-upgrade-to-net-4-5</link>
      <pubDate>Tue, 16 Oct 2012 16:39:36 GMT</pubDate>
      <dc:creator><![CDATA[Praburaj Thiagarajan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/praburaj/2012/10/16/nettcpbinding-mextcpbinding-sharing-same-port-throws-addressalreadyinuseexception-on-upgrade-to-net-4-5/</guid>
      <description><![CDATA[&#160;  Do you notice that your WCF NetTcp endpoint sharing port with a mexTcp endpoint fails to...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p><font size="3">Do you notice that your WCF NetTcp endpoint sharing port with a mexTcp endpoint fails to activate with a AddressAlreadyInUseException on upgrade to .Net 4.5? </font></p>  <blockquote>   <p align="justify"><font size="3"><em><strong>System.ServiceModel.AddressAlreadyInUseException</strong>: <strong>There is already a listener on IP endpoint 0.0.0.0<font size="3">:[Port#]</font></strong>. This could happen if there is another application already listening on this endpoint or if you have multiple service endpoints in your service host with the same IP endpoint but with incompatible binding configurations. ---&gt; </em></font></p>    <p align="justify"><font size="3"><em>System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) at</em></font></p>    <p align="justify"><font size="3"><em>…</em></font></p> </blockquote>  <p><font size="3">Here are some pointers for you to get it fixed. </font></p>  <ul>   <li><font size="3">Check if you have explicitly configured listenBackLog or maxConnections property of the NetTcp binding to a .Net 4.0 default of 10 like this: </font></li> </ul>  <blockquote>   <p align="left"><font size="3">&lt;netTcpBinding&gt;&lt;binding <strong>listenBacklog=&quot;10&quot; maxConnections=&quot;10&quot;</strong>&gt;…</font></p> </blockquote>  <ul>   <li><font size="3">If so delete these explicitly defined settings on the NetTcp binding and restart the service. </font></li> </ul>  <p>&#160;</p>  <p><font size="3">Does that resolve your problem? Here is a little bit background about the problem. There are some limitations when it comes to port sharing for TCP endpoints which are documented <a href="https://msdn.microsoft.com/en-us/library/aa702636.aspx">here</a> under the section <em>&quot;Sharing a port between a service endpoint and a mex endpoint using the NetTcpBinding&quot;.</em> If you are sharing port between two TCP endpoints these listenBackLog &amp; maxConnections parameters used by both the endpoints should be the same. If they are different you will run into this issue. </font></p>  <p><font size="3"></font></p>  <p><font size="3"><strong><em>Now, why does that work on .Net 4.0 but not on .Net 4.5? </em></strong></font></p>  <p><font size="3">In .Net 4.0 defaults for these properties are <strong>10</strong>. Since the configured values match with the mexTcpEndpoint’s default values it works fine on .Net 4.0</font></p>  <p><font size="3">On the other hand, in .Net 4.5 the revised defaults for these properties = <strong>12 * ProcessorCount. </strong>Since the configured values (10) does not match with the mexTcpEndpoint’s default values of 12 * ProcessorCount it throws this exception. </font></p>  <p><strong><font size="3"></font></strong></p>  <p><font size="3">If you notice, the 4.5 defaults for these values are definitely higher than 4.0 defaults. So by removing the explicitly configured properties your service will start working fine. Alternatively you can expose the mex endpoint on a different port as described in this <a href="https://msdn.microsoft.com/en-us/library/aa702636.aspx">post</a>. </font></p>]]></content:encoded>
    </item>
    <item>
      <title>HttpContext.Current.Request.InputStream property throws exception “This method or property is not supported after HttpRequest.GetBufferlessInputStream has been invoked.” or HttpContext.Current.Request.Forms parameters empty</title>
      <link>https://docs.microsoft.com/archive/blogs/praburaj/httpcontext-current-request-inputstream-property-throws-exception-this-method-or-property-is-not-supported-after-httprequest-getbufferlessinputstream-has-been-invoked-or-httpcontext-cur</link>
      <pubDate>Thu, 13 Sep 2012 16:16:00 GMT</pubDate>
      <dc:creator><![CDATA[Praburaj Thiagarajan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/praburaj/2012/09/13/httpcontext-current-request-inputstream-property-throws-exception-this-method-or-property-is-not-supported-after-httprequest-getbufferlessinputstream-has-been-invoked-or-httpcontext-cur/</guid>
      <description><![CDATA[In .net 4.5 WCF leveraged the buffer less input stream for scalability benefits. As a result when...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: trebuchet ms,geneva; font-size: medium;">In .net 4.5 WCF leveraged the buffer less input stream for scalability benefits. As a result when you try to access the HttpContext.Current.Request.InputStream property you may end up with the below exception, as the InputStream property tries to get you handle to the Classic stream as they both are incompatible. You may also see the other side effect of HttpContext.Current.Request.Form parameters becoming empty. </span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: medium; background-color: #ffff00;"><em><strong>&ldquo;</strong></em><em><strong>This method or property is not supported after HttpRequest.GetBufferlessInputStream has been invoked.&rdquo;</strong></em></span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: medium;">If you had a WCF 4.0 app which worked perfectly but on upgrading your .net framework to 4.5 you notice the service failing on accessing this property, here is the way to work-around the issue:</span></p>
<ol>
<li><span style="font-family: trebuchet ms,geneva; font-size: medium;">Add a simple HttpModule in the same WCF project which will access the InputStream property for each request before WCF reads it&nbsp;so that it will enforce the HttpContext.Request.ReadEntityBody to be "Classic" and will ensure compatibility.&nbsp;</span></li>
</ol>
<p style="padding-left: 30px;"><strong><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">public class WcfReadEntityBodyModeWorkaroundModule&nbsp;: IHttpModule</span></em></strong></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp; {</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void Dispose()</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void Init(HttpApplication context)</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; context.BeginRequest += context_BeginRequest;</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void context_BeginRequest(object sender, EventArgs e)</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; //This will force the HttpContext.Request.ReadEntityBody to be "Classic" and will ensure compatibility..</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Stream stream = (sender as HttpApplication).Request.InputStream;</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;}&nbsp;</span></em></p>
<p><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">2. </span></em><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">Register this module in your web.config by adding these lines in &lt;configuration&gt;&lt;modules&gt; setting.</span></em></p>
<p style="padding-left: 30px;"><span style="font-family: trebuchet ms,geneva; font-size: medium;"><em>&nbsp;&lt;system.webServer&gt;</em></span></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp; &lt;modules ...&gt;</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- Register the managed module --&gt;</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add name="WcfReadEntityBodyModeWorkaroundModule" type="MyAssembly.WcfReadEntityBodyModeWorkaroundModule, MyAssembly" /&gt;</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp; &lt;/modules&gt;</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&hellip;</span></em></p>
<p style="padding-left: 30px;"><em><span style="font-family: trebuchet ms,geneva; font-size: medium;">&lt;&hellip;</span></em><em></em></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: medium;"><em>If your project cannot be modified, then you can write this Http module in a separate assembly, GAC it separately and register this module in the web.config. </em></span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: medium;"><em>Now try accessing the service it should succeed for you!</em></span></p>
<p>&nbsp;</p>
<p><span style="font-family: trebuchet ms,geneva; font-size: medium;"><em><strong>Note: This issue has been fixed with .net 4.5.1 update.</strong> To get the old behavior (4.0 behavior) back please apply the below compat switch in your web.config:</em></span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: medium;"><em>&lt;configuration&gt;&nbsp;&nbsp; <br />&nbsp; &lt;appSettings&gt;<br />&nbsp;&nbsp;&nbsp; <span style="background-color: #ffff00;">&lt;add key="wcf:serviceHostingEnvironment:useClassicReadEntityBodyMode" value="true" /&gt;</span><br />&nbsp; &lt;/appSettings&gt;<br />&lt;/configuration&gt;</em></span></p>]]></content:encoded>
    </item>
    <item>
      <title>WCF 4.5 transport and XmlDictionaryReaderQuotas values not honored on a machine with .net framework 4.0</title>
      <link>https://docs.microsoft.com/archive/blogs/praburaj/wcf-4-5-transport-and-xmldictionaryreaderquotas-values-not-honored-on-a-machine-with-net-framework-4-0</link>
      <pubDate>Thu, 06 Sep 2012 11:18:00 GMT</pubDate>
      <dc:creator><![CDATA[Praburaj Thiagarajan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/praburaj/2012/09/06/wcf-4-5-transport-and-xmldictionaryreaderquotas-values-not-honored-on-a-machine-with-net-framework-4-0/</guid>
      <description><![CDATA[In order to simply configuration a number of transport property defaults and...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: trebuchet ms,geneva; font-size: medium;">In order to simply configuration a number of transport property defaults and XmlDictionaryReaderQuotas values were changed in WCF 4.5. For exact details about changes refer <a href="https://msdn.microsoft.com/en-us/library/hh309266.aspx">this link</a>&nbsp;under topics &ldquo;<strong>New Transport Default Values</strong>&rdquo; and &ldquo;<strong>XmlDictionaryReaderQuotas</strong>&rdquo;.</span></p>
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top">
<p><span style="font-family: trebuchet ms,geneva; font-size: medium; background-color: #ffff00;"><b>Note:</b></span></p>
</td>
</tr>
<tr>
<td valign="top">
<p><span style="font-family: trebuchet ms,geneva; font-size: medium; background-color: #ffff00;">These new defaults will be considered only if&nbsp;you deploy the WCF service on a machine with .net framework 4.5. If you&nbsp;deploy the same service on a machine with .net 4.0, then 4.0 defaults only&nbsp;will be considered. In such cases, it is recommended to configure these&nbsp;settings explicitly.</span></p>
</td>
</tr>
</tbody>
</table>
<p><strong><span style="font-family: trebuchet ms,geneva; font-size: medium;">What does that mean?</span></strong></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: medium;">If you develop a WCF service (target framework 4.0 or 4.5) on a machine with .net framework 4.5 assuming these default values and deploy the same service:</span></p>
<ul>
<li><span style="font-family: trebuchet ms,geneva; font-size: medium;"><strong>On a machine with .net framework 4.0 runtime:</strong>&nbsp;</span><span style="font-family: trebuchet ms,geneva; font-size: medium;">The service will get only .net framework 4.0 defaults which is lesser than 4.5 defaults. So scalability of the service will be reduced to what was supported in&nbsp;WCF 4.0. </span></li>
<li><span style="font-family: trebuchet ms,geneva; font-size: medium;"><strong>On a machine with .net framework 4.5 runtime:</strong> you should see no issues.</span></li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>WCF service with aspNetCompabitilityEnabled=”true” fails to activate on a machine with .net framework 4.0 runtime but works fine on .net framework 4.5?</title>
      <link>https://docs.microsoft.com/archive/blogs/praburaj/wcf-service-with-aspnetcompabitilityenabledtrue-fails-to-activate-on-a-machine-with-net-framework-4-0-runtime-but-works-fine-on-net-framework-4-5</link>
      <pubDate>Wed, 29 Aug 2012 15:33:00 GMT</pubDate>
      <dc:creator><![CDATA[Praburaj Thiagarajan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/praburaj/2012/08/29/wcf-service-with-aspnetcompabitilityenabledtrue-fails-to-activate-on-a-machine-with-net-framework-4-0-runtime-but-works-fine-on-net-framework-4-5/</guid>
      <description><![CDATA[Do you see that a WCF service with aspNetCompabitilityEnabled=&rdquo;true&rdquo; works fine on a...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;"><span style="font-size: medium;">Do you see that a WCF service with aspNetCompabitilityEnabled=&rdquo;true&rdquo; works fine on a machine with .net framework runtime 4.5, but the same service fails to activate with the below exception on a machine with v4.0 runtime. Here is how you can solve this issue:</span></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium; background-color: #ffff00;"><i>The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the AspNetCompatibilityRequirements attribute to the service type with RequirementsMode setting as 'Allowed' or 'Required'.</i></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif;"><span style="font-size: medium;">Check if your service definition explicitly overriddes the default value of AspNetCompatibilityRequirements() attribute. If not e</span><span style="font-size: medium;">xplicitly annotate your service definition with </span><span style="font-size: medium;">[AspNetCompatibilityRequirements(RequirementsMode = </span><span style="font-size: medium;">AspNetCompatibilityRequirementsMode.Allowed)] attribute like in v4.0. </span></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif;"><span style="font-size: medium;">The </span><span style="font-size: medium;">reason for this kind of a failure is due to defaults change of <a href="https://msdn.microsoft.com/en-us/library/dd456789.aspx">ASP.NET compatibility mode value</a>&nbsp;in 4.5. When you set the aspNetCompabitilityEnabled=&rdquo;true&rdquo; </span><span style="font-size: medium;">in your web.config and without setting any compatibility setting on service</span></span><br /><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">definition, then:</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;"><strong>On machine with v4.5 runtime:</strong> Individual service definitions automatically gets <em><strong>RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed</strong></em> as the default. So your service will activate successfully.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif;"><strong><span style="font-size: medium;">On </span></strong><span style="font-size: medium;"><strong>machine with v4.0 runtime:</strong> Individual service definitions automatically gets <em><strong>RequirementsMode </strong></em></span><span style="font-size: medium;"><em><strong>= AspNetCompatibilityRequirementsMode.NotAllowed</strong></em> as the default. So your </span><span style="font-size: medium;">service will fail to activate with the above error.</span></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif;"><span style="font-size: medium;">As I </span><span style="font-size: medium;">mentioned before, you can solve this issue by explicitly overriding default </span><span style="font-size: medium;">value of AspNetCompatibilityRequirements attribute on individual service </span><span style="font-size: medium;">definitions to avoid v4.0 defaults to kick in.</span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Add service reference adding empty reference.cs in MVC 4 projects of VS 2012</title>
      <link>https://docs.microsoft.com/archive/blogs/praburaj/add-service-reference-adding-empty-reference-cs-in-mvc-4-projects-of-vs-2012</link>
      <pubDate>Thu, 23 Aug 2012 15:17:00 GMT</pubDate>
      <dc:creator><![CDATA[Praburaj Thiagarajan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/praburaj/2012/08/23/add-service-reference-adding-empty-reference-cs-in-mvc-4-projects-of-vs-2012/</guid>
      <description><![CDATA[In VS 2012 MVC 4 projects, do you find an empty reference.cs file while adding a service reference...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: trebuchet ms,geneva;">In VS 2012 MVC 4 projects, do you find an empty reference.cs file while adding a service reference to a WCF service using 'Add service reference' dialog?</span></p>
<p><span style="font-family: trebuchet ms,geneva;">Here is what you can do about it: </span></p>
<p><span style="font-family: trebuchet ms,geneva;">Check if your error tab shows some error like...</span></p>
<p><span style="font-family: trebuchet ms,geneva;"><em><strong>Warning&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Custom tool warning: Cannot import wsdl:portType</strong></em></span></p>
<p><span style="font-family: trebuchet ms,geneva;"><em><strong>Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter </strong></em></span></p>
<p><span style="font-family: trebuchet ms,geneva; background-color: #ffff00;"><em><strong>Error: Type 'Newtonsoft.Json.Linq.JToken' is a recursive collection data contract which is not supported. Consider modifying the definition of collection 'Newtonsoft.Json.Linq.JToken' to remove references to itself.</strong></em></span></p>
<p><span style="font-family: trebuchet ms,geneva;"><em><strong>XPath to Error Source: //wsdl:definitions[@targetNamespace='https://tempuri.org/']/wsdl:portType[@name='IService1']</strong></em></span></p>
<p><span style="font-family: trebuchet ms,geneva;">If so, you can use the following work around(s): </span></p>
<p><span style="font-family: trebuchet ms,geneva;">1. In add service reference dialog -&gt; [Advanced ... ] -&gt; Reuse types in referenced assemblies (Checked by default) -&gt; Choose the non default 'Reuse types in specified referenced assemblies' radio -&gt;&nbsp;Make sure you exclude&nbsp;Newtonsoft.Json.dll from the list. Try adding service reference now and see it succeeds. </span></p>
<p><span style="font-family: trebuchet ms,geneva;">2. Alternatively you can remove reference of this Newtonsoft.Json.dll while generating proxy and add that back after proxy generation is complete.</span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Configuration binding extension 'system.serviceModel/bindings/*' could not be found error on upgrade to .Net 4.5 RTM</title>
      <link>https://docs.microsoft.com/archive/blogs/praburaj/configuration-binding-extension-system-servicemodelbindings-could-not-be-found-error-on-upgrade-to-net-4-5-rtm</link>
      <pubDate>Tue, 21 Aug 2012 12:28:00 GMT</pubDate>
      <dc:creator><![CDATA[Praburaj Thiagarajan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/praburaj/2012/08/21/configuration-binding-extension-system-servicemodelbindings-could-not-be-found-error-on-upgrade-to-net-4-5-rtm/</guid>
      <description><![CDATA[If you have a&nbsp;WCF service with netHttpBinding/basicHttpsBinding/udpBinding endpoint using the...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: trebuchet ms,geneva; font-size: medium;">If you have a&nbsp;WCF service with netHttpBinding/basicHttpsBinding/udpBinding endpoint using the .net 4.5 RC bits and your service fails to activate with this error message on upgrading to .net 4.5 RTM bits, here is what you need to do.&nbsp;&nbsp;</span></p>
<p><span style="font-size: medium; background-color: #ffff00;"><i><span style="font-family: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;">Configuration binding extension 'system.serviceModel/bindings/netHttpBinding' could not be found. Verify that this binding extension is properly registered in system.serviceModel/extensions/bindingExtensions and that it is spelled correctly. </span></i></span></p>
<p><span style="font-size: medium; background-color: #ffff00;"><i><span style="font-family: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;">OR</span></i></span></p>
<p><span style="font-size: medium; background-color: #ffff00;"><i><span style="font-family: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"><i>Configuration binding extension 'system.serviceModel/bindings/basicHttpsBinding' could not be found. Verify that this binding extension is properly registered in system.serviceModel/extensions/bindingExtensions and that it is spelled correctly. </i></span></i></span></p>
<p><span style="font-size: medium; background-color: #ffff00;"><i><span style="font-family: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"><i>OR</i></span></i></span></p>
<p><span style="font-size: medium; background-color: #ffff00;"><i><span style="font-family: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"><i><i><i>Configuration binding extension 'system.serviceModel/bindings/udpBinding' could not be found. Verify that this binding extension is properly registered in system.serviceModel/extensions/bindingExtensions and that it is spelled correctly.</i></i></i></span></i></span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: medium;">If its web hosted, add this setting &lt;httpRuntime targetFramework="4.5" /&gt; to your web.config to solve the issue. </span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: medium;">&lt;<span style="color: #a31515;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515;" face="Consolas" color="#a31515" size="2">system.web</span></span></span><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2">&gt;</span></span></span></span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp; &lt;<span style="color: #a31515;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515;" face="Consolas" color="#a31515" size="2">compilation</span></span></span><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"> </span></span></span><span style="color: #ff0000;" face="Consolas" color="#ff0000" size="2"><span style="color: #ff0000;" face="Consolas" color="#ff0000" size="2"><span style="color: #ff0000;" face="Consolas" color="#ff0000" size="2">debug</span></span></span><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2">=</span></span></span><span face="Consolas" size="2"><span face="Consolas" size="2">"</span></span><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2">true</span></span></span><span face="Consolas" size="2"><span face="Consolas" size="2">"</span></span><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"> </span></span></span><span style="color: #ff0000;" face="Consolas" color="#ff0000" size="2"><span style="color: #ff0000;" face="Consolas" color="#ff0000" size="2"><span style="color: #ff0000;" face="Consolas" color="#ff0000" size="2">targetFramework</span></span></span><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2">=</span></span></span><span face="Consolas" size="2"><span face="Consolas" size="2">"</span></span><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2">4.5</span></span></span><span face="Consolas" size="2"><span face="Consolas" size="2">"</span></span><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"> /&gt;</span></span></span></span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp;&nbsp;&nbsp; &lt;<span style="color: #a31515;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515;" face="Consolas" color="#a31515" size="2">httpRuntime</span></span></span><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"> </span></span></span><span style="color: #ff0000;" face="Consolas" color="#ff0000" size="2"><span style="color: #ff0000;" face="Consolas" color="#ff0000" size="2"><span style="color: #ff0000;" face="Consolas" color="#ff0000" size="2">targetFramework</span></span></span><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2">=</span></span></span><span face="Consolas" size="2"><span face="Consolas" size="2">"</span></span><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2">4.5</span></span></span><span face="Consolas" size="2"><span face="Consolas" size="2">"</span></span><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2">/&gt;</span></span></span></span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: medium;">&nbsp; &lt;/<span style="color: #a31515;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515;" face="Consolas" color="#a31515" size="2"><span style="color: #a31515;" face="Consolas" color="#a31515" size="2">system.web</span></span></span><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2">&gt;</span></span></span></span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: medium;"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"><span style="color: #0000ff;" face="Consolas" color="#0000ff" size="2"></span></span></span>&nbsp;If your app is self hosted, make sure you compile your project with targetFramework v4.5. </span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: medium;">netHttpBinding, basicHttpsBinding and udpBinding work only in binaries built with target framework v4.5. Adding a httpRuntime setting to web.config will make sure that the IIS application pool created for your app has a version v4.5.</span></p>]]></content:encoded>
    </item>
  </channel>
</rss>