<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://developers.de/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Damir Dobric Posts</title><subtitle type="html">My corner on advanced .NET</subtitle><id>http://developers.de/blogs/damir_dobric/atom.aspx</id><link rel="alternate" type="text/html" href="http://developers.de/blogs/damir_dobric/default.aspx" /><link rel="self" type="application/atom+xml" href="http://developers.de/blogs/damir_dobric/atom.aspx" /><generator uri="http://communityserver.org" version="4.0.30619.63">Community Server</generator><updated>2010-01-23T18:45:37Z</updated><entry><title>AppFabric Error: A base address with the uri scheme 'net.pipe' needs to be specified…</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/03/04/appfabric-error-a-base-address-with-the-uri-scheme-net-pipe-needs-to-be-specified.aspx" /><id>/blogs/damir_dobric/archive/2010/03/04/appfabric-error-a-base-address-with-the-uri-scheme-net-pipe-needs-to-be-specified.aspx</id><published>2010-03-04T22:38:01Z</published><updated>2010-03-04T22:38:01Z</updated><content type="html">&lt;p&gt;When setting up your service, you may figure out, that service has not been properly started. To make sure, that this statement is true open the &lt;strong&gt;AppFabric&lt;/strong&gt; event log and enable &lt;strong&gt;Operational&lt;/strong&gt; logging. Clear all log entries and start the service.    &lt;br /&gt;If the service is autstartable stop the pool before clearing of the event log. Now start the service and look for the error shown below:&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;System.ServiceModel.ServiceActivationException: The service &amp;#39;/Services/RoutingService/ServiceManagement.svc&amp;#39; cannot be activated due to an exception during compilation. The exception message is: A base address with the uri scheme &amp;#39;net.pipe&amp;#39; needs to be specified if using service management endpoint &amp;#39;ServiceManagementNetPipeEndpoint&amp;#39;. Verify a base address exists on the site and the protocol is enabled on the application.. ---&amp;gt; System.Configuration.ConfigurationErrorsException: &lt;strong&gt;&lt;font size="4"&gt;A base address with the uri scheme &amp;#39;net.pipe&amp;#39; needs to be specified&lt;/font&gt;&lt;/strong&gt; if using service management endpoint &amp;#39;ServiceManagementNetPipeEndpoint&amp;#39;. Verify a base address exists on the site and the protocol is enabled on the application. at Microsoft.ApplicationServer.Hosting.Configuration.ServiceManagementConfiguration.LoadAndVerifyEndpoints(HashSet`1 enabledUriSchemes, HashSet`1 configuredEndpoints) at Microsoft.ApplicationServer.Hosting.Configuration.ServiceManagementConfiguration.GetEnabledEndpoints(Uri[] baseAddresses) at Microsoft.ApplicationServer.Hosting.Management.ServiceManagementFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) --- End of inner exception stack trace --- at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath) at Microsoft.ApplicationServer.Hosting.AutoStart.ApplicationServerAutoStartProvider.ActivateService(String virtualPath)&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;The most important part of the messages is marked bold. To fix this you need to enable net.pipe protocol as shown at the next picture:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/damir_5F00_dobric/clip_5F00_image002_5F00_26EE81AB.jpg"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="clip_image002" border="0" alt="clip_image002" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/damir_5F00_dobric/clip_5F00_image002_5F00_thumb_5F00_3739D397.jpg" width="397" height="484" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Note that http is scoped as default protocol, but it also has to be explicitly specified. If after this the error still appears, be sure that net.pipe protocol is enabled at the site binding in IIS manager. I figured out that this binding is sometimes not automatically enabled for site after installation of AppFabric.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Hope this helps&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Damir&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/damir_5F00_dobric/image_5F00_2F423135.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/damir_5F00_dobric/image_5F00_thumb_5F00_15DA2DFB.png" width="244" height="57" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10592" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author></entry><entry><title>AppFabric BETA 2: The Platform for the Cloud Era</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/03/02/appfabric-beta-2-the-platform-for-the-cloud-era.aspx" /><id>/blogs/damir_dobric/archive/2010/03/02/appfabric-beta-2-the-platform-for-the-cloud-era.aspx</id><published>2010-03-02T22:34:30Z</published><updated>2010-03-02T22:34:30Z</updated><content type="html">&lt;p&gt;If you are still asking yourself, what is the &lt;strong&gt;AppFabric&lt;/strong&gt;, take a look on these few key features described below. After almost two years the Microsoft’s new product is getting to be released soon (Q3 2010). For now we are announcing the publicly available &lt;a href="http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx"&gt;BETA 2&lt;/a&gt; version, which is build on top of .NET 4.0. If you already have installed BETA 1 version please take a look on &lt;a href="http://developers.de/blogs/damir_dobric/archive/2010/02/19/uninstalling-of-appfabric-beta-1.aspx"&gt;this post&lt;/a&gt;.&lt;/p&gt;  &lt;h4&gt;Simplified Composite Apps (Built on top of .NET 4.0)&lt;/h4&gt;  &lt;p&gt;Developers can simplify the development of composite applications with the pre-built application services in Windows Server &lt;strong&gt;AppFabric&lt;/strong&gt;, used in conjunction with Visual Studio tools and .NET Framework capabilities (ASP.NET, WCF and WF). IT Pros can also simplify the deployment, monitoring, and management of composite applications with configuration and monitoring capabilities that are integrated with familiar tools (PowerShell, IIS Manager, and System Center).     &lt;br /&gt;&lt;/p&gt;  &lt;h4&gt;Faster Web Apps Made Easy (Known as Velocity)&lt;/h4&gt;  &lt;p&gt;Windows Server AppFabric helps developers improve the speed and availability of web applications through distributed in-memory caching and replication technology that works with current ASP.NET applications. &lt;/p&gt;  &lt;h4&gt;Enterprise Performance and Availability (Known as Dublin)&lt;/h4&gt;  &lt;p&gt;An enterprise’s most important and demanding applications can achieve elastic scale, performance, availability, and reliability (benefits often associated with the cloud) with the help of Windows Server AppFabric. These and countless other benefits from an unparalleled partner ecosystem utilize familiar skills from the .NET Framework and Windows Server.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/windowsserver2008/en/us/app-main.aspx"&gt;&lt;img border="0" alt="" align="right" src="http://www.microsoft.com/global/windowsserver2008/en/us/PublishingImages/WS-AppFab_h_rgb.png" width="271" height="60" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Additional Resources:&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Gartner Research Report: Microsoft AppFabric: A Platform for the Cloud Era is Under Construction&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.gartner.com/technology/media-products/reprints/microsoft/vol13/article6/article6.html"&gt;http://www.gartner.com/technology/media-products/reprints/microsoft/vol13/article6/article6.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Microsoft News Center feature story on Windows Server &amp;amp; Windows Azure platform AppFabric:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/presspass/features/2009/nov09/11-17pdcappfabric.mspx"&gt;http://www.microsoft.com/presspass/features/2009/nov09/11-17pdcappfabric.mspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Beta2 Blog Post on Windows Server Blog:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/windowsserver/"&gt;http://blogs.technet.com/windowsserver/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Additional information on Windows Server AppFabric:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/windowsserver2008/en/us/app-main.aspx"&gt;http://www.microsoft.com/windowsserver2008/en/us/app-main.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Information (including download link) for Windows Azure AppFabric:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/windowsazure/appfabric/"&gt;http://www.microsoft.com/windowsazure/appfabric/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10573" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author></entry><entry><title>The best of WCF 4.0 and WF 4.0</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/02/28/the-best-of-wcf-4-0-and-wf-4-0.aspx" /><id>/blogs/damir_dobric/archive/2010/02/28/the-best-of-wcf-4-0-and-wf-4-0.aspx</id><published>2010-02-28T16:49:37Z</published><updated>2010-02-28T16:49:37Z</updated><content type="html">&lt;p&gt;&lt;a href="http://images.google.de/imgres?imgurl=http://bloggingabout.net/cfs-filesystemfile.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/erwyn/NET-Logo.png&amp;amp;imgrefurl=http://bloggingabout.net/blogs/erwyn/&amp;amp;usg=__jwm52m2b5vm38Yy2tUJNKX39mqg=&amp;amp;h=81&amp;amp;w=328&amp;amp;sz=13&amp;amp;hl=en&amp;amp;start=27&amp;amp;sig2=Qms-JTnf4OJiaIviMrxfvA&amp;amp;itbs=1&amp;amp;tbnid=G9rfNwwumaZQZM:&amp;amp;tbnh=29&amp;amp;tbnw=118&amp;amp;prev=/images%3Fq%3D.net%2Blogo%26start%3D18%26hl%3Den%26sa%3DN%26gbv%3D2%26ndsp%3D18%26tbs%3Disch:1&amp;amp;ei=q5KNS5mMFZaN_Aat6tHqBg"&gt;&lt;img src="http://t3.gstatic.com/images?q=tbn:G9rfNwwumaZQZM:http://bloggingabout.net/cfs-filesystemfile.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/erwyn/NET-Logo.png" width="118" height="29" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;At March 18th 2010 at Microsoft in Bad Homburg (Frankfurt area) I will give an overview of most important new features of upcoming WCF 4.0 and WF 4.0. The talk will be covered in context of .NET User Group Frankfurt am Main.   &lt;br /&gt;Please feel invited all of you software architects and developers who leverage .NET technologies to build none trivial enterprise application for Windows platform.    &lt;br /&gt;The highly demo powered session (in German!) will take two hours of scheduled official part. After that we will step into a none official part in &lt;a href="http://maps.google.de/maps?q=Zeppelinstra%C3%9Fe+10+bad+homburg&amp;amp;um=1&amp;amp;ie=UTF-8&amp;amp;hq=&amp;amp;hnear=Zeppelinstra%C3%9Fe+10,+D-61352+Bad+Homburg+vor+der+H%C3%B6he&amp;amp;gl=de&amp;amp;ei=nZ2KS5fKHJOM_Ab-_ojqBg&amp;amp;sa=X&amp;amp;oi=geocode_result&amp;amp;ct=image&amp;amp;resnum=1&amp;amp;ved=0CAsQ8gEwAA"&gt;legendary Bravery&lt;/a&gt; few hundred meters away of Microsoft office. Please follow the official page of the .NET &lt;a href="http://www.dotnet-ug-frankfurt.de/"&gt;Group&lt;/a&gt; Frankfurt&amp;#160; for detailed schedule. I expect we will start at 6.30 p.m.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://images.google.de/imgres?imgurl=http://bloggingabout.net/cfs-filesystemfile.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/erwyn/NET-Logo.png&amp;amp;imgrefurl=http://bloggingabout.net/blogs/erwyn/&amp;amp;usg=__jwm52m2b5vm38Yy2tUJNKX39mqg=&amp;amp;h=81&amp;amp;w=328&amp;amp;sz=13&amp;amp;hl=en&amp;amp;start=27&amp;amp;sig2=Qms-JTnf4OJiaIviMrxfvA&amp;amp;itbs=1&amp;amp;tbnid=G9rfNwwumaZQZM:&amp;amp;tbnh=29&amp;amp;tbnw=118&amp;amp;prev=/images%3Fq%3D.net%2Blogo%26start%3D18%26hl%3Den%26sa%3DN%26gbv%3D2%26ndsp%3D18%26tbs%3Disch:1&amp;amp;ei=q5KNS5mMFZaN_Aat6tHqBg"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Here is the agenda.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;•Simplified Configuration&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;•File-Less Activation&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;•Multiple Site Bindings&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;•Standard Endpoints&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;•Service Discovery&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;•Routing Service&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;•Workflow Services     &lt;br /&gt;      &lt;br /&gt;Optional (depending on time)&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;•AppFabric&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;•REST Improvements&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If anybody thinks, there would be something important I missed above, please let me know.&lt;/p&gt;  &lt;p&gt;Hope to see you there.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://images.google.de/imgres?imgurl=http://i.zdnet.com/blogs/azure-logo.png&amp;amp;imgrefurl=http://www.pubsub.com/Google-Nexus-One-Said-To-Cost-%24530-Unlocked-topic-windows-kVwlAHvcqVrS&amp;amp;usg=__CLGOSKULTxjaJPl4PWODNWpe1a8=&amp;amp;h=165&amp;amp;w=175&amp;amp;sz=41&amp;amp;hl=en&amp;amp;start=3&amp;amp;um=1&amp;amp;itbs=1&amp;amp;tbnid=e4UGgjl-1JeR7M:&amp;amp;tbnh=94&amp;amp;tbnw=100&amp;amp;prev=/images%3Fq%3Dappfabric%2Blogo%26um%3D1%26hl%3Den%26sa%3DN%26tbs%3Disch:1"&gt;&lt;img src="http://t2.gstatic.com/images?q=tbn:e4UGgjl-1JeR7M:http://i.zdnet.com/blogs/azure-logo.png" width="100" height="94" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Damir&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10533" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author></entry><entry><title>How to enable multiple site bindings in WCF 4.0</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/02/28/how-to-enable-multiple-site-bindings-in-wcf-4-0.aspx" /><id>/blogs/damir_dobric/archive/2010/02/28/how-to-enable-multiple-site-bindings-in-wcf-4-0.aspx</id><published>2010-02-28T00:00:17Z</published><updated>2010-02-28T00:00:17Z</updated><content type="html">&lt;p&gt;This post describes shortly how to enable multiple site bindings in WCF 4.0. Open IIS 7 Manager and create new site. Add two bindings to the site like shown in the picture below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/damir_5F00_dobric/image_5F00_1732C4F7.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/damir_5F00_dobric/image_5F00_thumb_5F00_5CD74F15.png" width="644" height="217" /&gt;&lt;/a&gt;     &lt;br /&gt;After that either configure your DNS or change host file &lt;em&gt;&lt;strong&gt;%SYSTEM%\System32\drivers\etc\hosts &lt;/strong&gt;&lt;/em&gt;like:&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;&lt;strong&gt;127.0.0.1&amp;#160;&amp;#160;&amp;#160; sample1     &lt;br /&gt;127.0.0.1&amp;#160;&amp;#160;&amp;#160; sample2&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When you now browse now for the service page by &lt;a title="http://sample1/MyService.svc" href="http://sample1/MyService.svc"&gt;http://sample1/MyService.svc&lt;/a&gt; or &lt;a title="http://sample1/MyService.svc" href="http://sample2/MyService.svc"&gt;http://sample2/MyService.svc&lt;/a&gt; you should get following error:&lt;/p&gt;  &lt;h4&gt;&lt;i&gt;&lt;font color="#ff0000"&gt;This collection already contains an address with scheme http.&amp;#160; There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting &amp;#39;system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled&amp;#39; to true or specifying &amp;#39;system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters&amp;#39;.       &lt;br /&gt;Parameter name: item&lt;/font&gt;&lt;/i&gt;&lt;/h4&gt;  &lt;p&gt;To make this working open the service’s config file and add following in the serviceModel element:&lt;/p&gt;  &lt;p&gt;&lt;font color="#0000ff"&gt;&lt;strong&gt;&amp;lt;serviceHostingEnvironment multipleSiteBindingsEnabled=&amp;quot;true&amp;quot; /&amp;gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;That’s all…&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10528" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author><category term="WCF" scheme="http://developers.de/blogs/damir_dobric/archive/tags/WCF/default.aspx" /><category term="AppFabric" scheme="http://developers.de/blogs/damir_dobric/archive/tags/AppFabric/default.aspx" /></entry><entry><title>WCF 4.0 file-less activation error: ServiceHost only supports class service types.</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/02/25/wcf-4-0-file-less-activation-error-servicehost-only-supports-class-service-types.aspx" /><id>/blogs/damir_dobric/archive/2010/02/25/wcf-4-0-file-less-activation-error-servicehost-only-supports-class-service-types.aspx</id><published>2010-02-25T22:12:55Z</published><updated>2010-02-25T22:12:55Z</updated><content type="html">&lt;p&gt;&lt;/p&gt;  &lt;p&gt;When working with WCF 4.0 and File-Less Service Activation you may get following error:&lt;/p&gt;  &lt;p style="line-height:normal;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-outline-level:2;" class="MsoNormal"&gt;&lt;i&gt;&lt;span style="font-family:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;color:maroon;font-size:14pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;ServiceHost only supports class service types.&lt;/span&gt;&lt;/i&gt;&lt;span style="font-family:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;color:maroon;font-size:14pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:12pt;" class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;color:black;font-size:8.5pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-font-family:arial;"&gt;Description: &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;color:black;font-size:8.5pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.      &lt;br /&gt;      &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;color:black;font-size:8.5pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-font-family:arial;"&gt;Exception Details: &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;color:black;font-size:8.5pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;System.ArgumentException: ServiceHost only supports class service types.     &lt;br /&gt;      &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;color:black;font-size:8.5pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-font-family:arial;"&gt;Source Error:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;color:black;font-size:8.5pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;table style="width:100%;background:#ffffcc;mso-cellspacing:1.5pt;mso-yfti-tbllook:1184;" class="MsoNormalTable" cellpadding="0"&gt;     &lt;tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes;"&gt;       &lt;td style="padding-bottom:0.75pt;padding-left:0.75pt;padding-right:0.75pt;padding-top:0.75pt;"&gt;         &lt;p style="line-height:normal;margin-bottom:0pt;" class="MsoNormal"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:black;font-size:10pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.&lt;/span&gt;&lt;span style="font-family:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;color:black;font-size:8.5pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt; &lt;/span&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This scaring and possibly nothing saying error has very simple solution. I have following service:&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;public&lt;/span&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;MyService&lt;/span&gt; : &lt;span style="color:#2b91af;"&gt;IMyService       &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;I used following configuration, which tryies to activate the service contract.&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;serviceHostingEnvironment&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt; &lt;/span&gt;&lt;span style="font-family:consolas;color:red;font-size:9.5pt;"&gt;multipleSiteBindingsEnabled&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;=&lt;/span&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt;&amp;quot;&lt;span style="color:blue;"&gt;true&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;       &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;serviceActivations&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&amp;gt;     &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;add&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt; &lt;/span&gt;&lt;span style="font-family:consolas;color:red;font-size:9.5pt;"&gt;relativeAddress&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;=&lt;/span&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt;&amp;quot;&lt;span style="color:blue;"&gt;VirtualSvc.svc&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;        &lt;br /&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:red;"&gt;service&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;Daenet.NetFx40.RoutingHost.&lt;strong&gt;&lt;font size="4"&gt;IMyService&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; /&amp;gt;       &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;serviceActivations&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&amp;gt;     &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;serviceHostingEnvironment&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&amp;gt;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;File Less service activation however requires the service class name and NOT the contract name. Here is the solution:&lt;/p&gt; &lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;serviceHostingEnvironment&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt; &lt;/span&gt;&lt;span style="font-family:consolas;color:red;font-size:9.5pt;"&gt;multipleSiteBindingsEnabled&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;=&lt;/span&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt;&amp;quot;&lt;span style="color:blue;"&gt;true&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;     &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;serviceActivations&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&amp;gt;   &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;add&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt; &lt;/span&gt;&lt;span style="font-family:consolas;color:red;font-size:9.5pt;"&gt;relativeAddress&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;=&lt;/span&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt;&amp;quot;&lt;span style="color:blue;"&gt;VirtualSvc.svc&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;      &lt;br /&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:red;"&gt;service&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;Daenet.NetFx40.RoutingHost.&lt;strong&gt;&lt;font size="4"&gt;MyService&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; /&amp;gt;     &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;serviceActivations&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&amp;gt;   &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;serviceHostingEnvironment&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&amp;gt;   &lt;p&gt;&lt;/p&gt; &lt;/span&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10510" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author><category term="WCF" scheme="http://developers.de/blogs/damir_dobric/archive/tags/WCF/default.aspx" /><category term="AppFabric" scheme="http://developers.de/blogs/damir_dobric/archive/tags/AppFabric/default.aspx" /></entry><entry><title>Standard Endpoints and MexBindings</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/02/22/standard-endpoints-and-mexbindings.aspx" /><id>/blogs/damir_dobric/archive/2010/02/22/standard-endpoints-and-mexbindings.aspx</id><published>2010-02-22T21:12:50Z</published><updated>2010-02-22T21:12:50Z</updated><content type="html">&lt;p&gt;WCF 4.0 provides few so called standard endpoints: &lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.ServiceModel.Activities:4.0.0.0:31bf3856ad364e35/System.ServiceModel.Activities.Configuration.WorkflowControlEndpointElement"&gt;WorkflowControlEndpointElement&lt;/a&gt;&lt;/b&gt;&lt;b&gt;     &lt;br /&gt;&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.ServiceModel:4.0.0.0:b77a5c561934e089/System.ServiceModel.Configuration.ServiceMetadataEndpointElement"&gt;ServiceMetadataEndpointElement&lt;/a&gt;      &lt;br /&gt;&lt;b&gt;&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.ServiceModel.Discovery:4.0.0.0:31bf3856ad364e35/System.ServiceModel.Discovery.Configuration.AnnouncementEndpointElement"&gt;AnnouncementEndpointElement&lt;/a&gt;&lt;/b&gt;      &lt;br /&gt;&lt;b&gt;&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.ServiceModel.Discovery:4.0.0.0:31bf3856ad364e35/System.ServiceModel.Discovery.Configuration.UdpDiscoveryEndpointElement"&gt;UdpDiscoveryEndpointElement&lt;/a&gt;&lt;/b&gt;&lt;b&gt; : &lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.ServiceModel.Discovery:4.0.0.0:31bf3856ad364e35/System.ServiceModel.Discovery.Configuration.DiscoveryEndpointElement"&gt;DiscoveryEndpointElement&lt;/a&gt;        &lt;br /&gt;&lt;b&gt;&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.ServiceModel.Discovery:4.0.0.0:31bf3856ad364e35/System.ServiceModel.Discovery.Configuration.DynamicEndpointElement"&gt;DynamicEndpointElement&lt;/a&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;They can be used to add some specific features to service. For example &lt;span style="color:blue;"&gt;udpDiscoveryEndpoint&lt;/span&gt; enables add-hoc &lt;a href="http://developers.de/blogs/damir_dobric/archive/2008/10/19/ws-discovery-messaging-enhancements-in-net-4-0.aspx"&gt;discovery&lt;/a&gt; of the service. This endpoint according to specification provides discovery of the service address. Unfortunately, this does not provide information about the binding and other service policies. To make this happen, there is &lt;span style="color:blue;"&gt;mexEndpoint&lt;/span&gt; which enables metadata exchange. The &lt;span style="color:blue;"&gt;mexEndpoint&lt;/span&gt; provides following bindings:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.ServiceModel:4.0.0.0:b77a5c561934e089/System.ServiceModel.Configuration.MexHttpBindingElement"&gt;MexHttpBindingElement&lt;/a&gt;&lt;/b&gt;, &lt;b&gt;&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.ServiceModel:4.0.0.0:b77a5c561934e089/System.ServiceModel.Configuration.MexHttpsBindingElement"&gt;MexHttpsBindingElement&lt;/a&gt;&lt;/b&gt;, &lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.ServiceModel:4.0.0.0:b77a5c561934e089/System.ServiceModel.Configuration.MexNamedPipeBindingElement"&gt;MexNamedPipeBindingElement&lt;/a&gt; and &lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.ServiceModel:4.0.0.0:b77a5c561934e089/System.ServiceModel.Configuration.MexTcpBindingElement"&gt;MexTcpBindingElement&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Here is one example, which enables discovery of address (udpDiscovery) and whole binding with policies (mex):&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;services&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;service&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt; &lt;/span&gt;&lt;span style="font-family:consolas;color:red;font-size:9.5pt;"&gt;name&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;=&lt;/span&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt;&amp;quot;&lt;span style="color:blue;"&gt;Daenet.DNetfx40Discovery.SampleService&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;endpoint&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt; &lt;/span&gt;&lt;span style="font-family:consolas;color:red;font-size:9.5pt;"&gt;name&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;=&lt;/span&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt;&amp;quot;&lt;span style="color:blue;"&gt;Daenet.DNetfx40Discovery.ISampleService&lt;/span&gt;&amp;quot; &lt;/span&gt;&lt;span style="font-family:consolas;color:red;font-size:9.5pt;"&gt;binding&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;=&lt;/span&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt;&amp;quot;&lt;span style="color:blue;"&gt;wsHttpBinding&lt;/span&gt;&amp;quot; &lt;/span&gt;&lt;span style="font-family:consolas;color:red;font-size:9.5pt;"&gt;contract&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;=&lt;/span&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt;&amp;quot;&lt;span style="color:blue;"&gt;Daenet.DNetfx40Discovery.ISampleService&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; /&amp;gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt;     &lt;p&gt;&amp;#160;&lt;/p&gt;   &lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;endpoint&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt; &lt;/span&gt;&lt;span style="font-family:consolas;color:red;font-size:9.5pt;"&gt;kind&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;=&lt;/span&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt;&amp;quot;&lt;span style="color:blue;"&gt;udpDiscoveryEndpoint&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;/&amp;gt;&lt;/span&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt;     &lt;p&gt;&amp;#160;&lt;/p&gt;   &lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;endpoint&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt; &lt;/span&gt;&lt;span style="font-family:consolas;color:red;font-size:9.5pt;"&gt;kind&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt; = &lt;/span&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt;&amp;quot;&lt;span style="color:blue;"&gt;mexEndpoint&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;address&lt;/span&gt;&lt;span style="color:blue;"&gt; = &lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;MEX&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:red;"&gt;binding&lt;/span&gt;&lt;span style="color:blue;"&gt; = &lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;mexTcpBinding&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt; /&amp;gt;&lt;/span&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;service&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-family:consolas;font-size:9.5pt;"&gt;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family:consolas;color:#a31515;font-size:9.5pt;"&gt;services&lt;/span&gt;&lt;span style="font-family:consolas;color:blue;font-size:9.5pt;"&gt;&amp;gt;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10482" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author></entry><entry><title>Samples for WF 4.0 and WCF 4.0 Release Candidate</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/02/21/samples-for-wf-4-0-and-wcf-4-0-release-candidate.aspx" /><id>/blogs/damir_dobric/archive/2010/02/21/samples-for-wf-4-0-and-wcf-4-0-release-candidate.aspx</id><published>2010-02-21T10:54:05Z</published><updated>2010-02-21T10:54:05Z</updated><content type="html">&lt;ul&gt;   &lt;li&gt;WF: &lt;a href="http://msdn.microsoft.com/en-us/library/dd489441(VS.100).aspx"&gt;http://msdn.microsoft.com/en-us/library/dd489441(VS.100).aspx&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;WCF: &lt;a href="http://msdn.microsoft.com/en-us/library/dd456779(VS.100).aspx"&gt;http://msdn.microsoft.com/en-us/library/dd456779(VS.100).aspx&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;WF Designer: &lt;a href="http://msdn.microsoft.com/en-us/library/dd489396(VS.100).aspx"&gt;http://msdn.microsoft.com/en-us/library/dd489396(VS.100).aspx&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;WCF Samples: &lt;a href="http://msdn.microsoft.com/en-us/library/dd483346(VS.100).aspx"&gt;http://msdn.microsoft.com/en-us/library/dd483346(VS.100).aspx&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;WF Samples: &lt;a href="http://msdn.microsoft.com/en-us/library/dd483375(VS.100).aspx"&gt;http://msdn.microsoft.com/en-us/library/dd483375(VS.100).aspx&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10463" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author><category term="WCF" scheme="http://developers.de/blogs/damir_dobric/archive/tags/WCF/default.aspx" /></entry><entry><title>Uninstalling of AppFabric Beta 1</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/02/19/uninstalling-of-appfabric-beta-1.aspx" /><id>/blogs/damir_dobric/archive/2010/02/19/uninstalling-of-appfabric-beta-1.aspx</id><published>2010-02-19T17:59:15Z</published><updated>2010-02-19T17:59:15Z</updated><content type="html">&lt;p&gt;If you have installed the AppFabric beta 1, and want to install VS 2010 RC, note that you have to uninstall AppFabric BETA 1 before installing of VS RC bits.   &lt;br /&gt;This is NOT documented in installation documentation of VS 2010 BETA 1. AppFabric BETA 1 is buld with dependency to .NET 40 BETA 1 which is build &lt;strong&gt;4 v4.0.21006&lt;/strong&gt;. The new version of .NET 4.0 is build &lt;strong&gt;v4.0.30128&lt;/strong&gt;.    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;When uninstalling AppFabric setup looks for the old version of .NET 40 BETA 1 which is renamed as &lt;strong&gt;old_4 v4.0.21006&lt;/strong&gt;. The exact dependency of AppFabric Beta 1 is a dependency on the presence on these .NET Framework 4 configuration files:    &lt;br /&gt;    &lt;br /&gt;&lt;em&gt;1. %SystemRoot%\Microsoft.NET\Framework[64]\v4.0.21006\config\machine.config     &lt;br /&gt;2. %SystemRoot%\Microsoft.NET\Framework[64]\v4.0.21006\config\web.config&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;To be sure that this cause the setup to fail uninstall process grab out the log file %systemroot%:\Windows\Logs\CBS\CBS.LOG   &lt;br /&gt;You will find there following:&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;Info: Loading configuration: C:\Windows\Microsoft.NET\Framework64\v4.0.21006\config\machine.config      &lt;br /&gt;&lt;/font&gt;&lt;font color="#ff0000"&gt;Error: Failed to load configuration.      &lt;br /&gt;&lt;/font&gt;&lt;font color="#ff0000"&gt;Error: Xml parse error 0x800c0006: The system cannot locate the object specified.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Solution:    &lt;br /&gt;To avoid this problem, uninstall AppFabric Beta 1 before uninstalling .NET Framework 4 v4.0.21006. Assuming that you are reading this you probably already uninstalled .NET BETA 1 :(    &lt;br /&gt;    &lt;br /&gt;So, to work around this problem if .NET Framework &lt;strong&gt;4 v4.0.21006&lt;/strong&gt; was already removed, create the machine.config and web.config files in the old .NET Framework 4 location by copying from new .NET Framework 4 location. I simply have copied all existing config of &lt;strong&gt;v4.0.30128&lt;/strong&gt; to .&lt;strong&gt;4 v4.0.21006.     &lt;br /&gt;&lt;/strong&gt;After that unsinstall AppFabric and restart the machine.&lt;/p&gt;  &lt;p&gt;Then open applicationHost.config file of IIS 7 and remove following attrubutes from all apps which have it defined: &amp;quot;&lt;strong&gt;serviceAutoStartMode&lt;/strong&gt;&amp;quot; and &amp;quot;&lt;strong&gt;previouslyEnabledProtocols&lt;/strong&gt;    &lt;br /&gt;These attributes are in ther if you have used “Always Running” feature of AppFabric.&lt;/p&gt;  &lt;p&gt;Thanks to &lt;em&gt;AppFabric&lt;/em&gt; team which helped me solving this issue. &lt;a href="https://connect.microsoft.com/dublintap/feedback/details/533852/uninstalling-appfabric-beta-1?wa=wsignin1.0"&gt;Filed under&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10447" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author><category term="WCF" scheme="http://developers.de/blogs/damir_dobric/archive/tags/WCF/default.aspx" /><category term="AppFabric" scheme="http://developers.de/blogs/damir_dobric/archive/tags/AppFabric/default.aspx" /></entry><entry><title>First VS 2010 RC Patch for Brave Hearths</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/02/16/first-vs-2010-rc-patch-for-brave-hearths.aspx" /><id>/blogs/damir_dobric/archive/2010/02/16/first-vs-2010-rc-patch-for-brave-hearths.aspx</id><published>2010-02-16T01:42:59Z</published><updated>2010-02-16T01:42:59Z</updated><content type="html">&lt;p&gt;If you are one of brave VS 2010 starters, you might notice that the VS IDE just diaper frequently&amp;#160; in front of your eyes.   &lt;br /&gt;This happens if you are looking to critically focused on the screen or if you type something like MyClass&amp;lt;TypeHereAnything&amp;gt; &lt;a href="http://weblogs.asp.net/scottgu/archive/2010/02/11/intellisense-crashing-fix-for-vs-2010.aspx"&gt;or, or&lt;/a&gt;,..    &lt;br /&gt;Anyhow, there is a help &lt;a href="https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=26662&amp;amp;wa=wsignin1.0"&gt;patch&lt;/a&gt; for this.&lt;/p&gt;  &lt;p&gt;:)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10386" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author></entry><entry><title>Visual Studio 2010 RC Setup does not start on Windows 7 - x64</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/02/13/visual-studio-2010-rc-setup-does-not-start-on-windows-7-x64.aspx" /><id>/blogs/damir_dobric/archive/2010/02/13/visual-studio-2010-rc-setup-does-not-start-on-windows-7-x64.aspx</id><published>2010-02-13T18:01:10Z</published><updated>2010-02-13T18:01:10Z</updated><content type="html">&lt;p&gt;I tried to install &lt;a href="http://weblogs.asp.net/scottgu/archive/2010/02/08/vs-2010-net-4-release-candidate.aspx"&gt;Visual Studio Release Candidate 2010&lt;/a&gt;&amp;#160; on one one Windows 7 - 64 – Bit machines. Unfortunately the setup just does not start. If I try to start the same setup (to be sure that hash is correct) from other Win7 64-Bit machine it starts successfully.     &lt;br /&gt;    &lt;br /&gt;Note that my machine which cannot start the setup had previously installed VS 2010 Beta 2. I did my best to uninstall bunch of components in the right order. But, who knows.    &lt;br /&gt;    &lt;br /&gt;To workaround this problem I started the &lt;strong&gt;setup.exe&lt;/strong&gt; in &lt;strong&gt;Setup&lt;/strong&gt; folder and not &lt;strong&gt;setup.exe&lt;/strong&gt; in the &lt;strong&gt;root&lt;/strong&gt; of installation media (ISO, DVD or whatever you have). The setup.exe has been started elevated.    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;This issue is documented at Microsoft connect site: &lt;a title="https://connect.microsoft.com/VisualStudio/feedback/details/533209/visual-studio-2010-rc-setup-does-not-start-on-windows-7-x64" href="https://connect.microsoft.com/VisualStudio/feedback/details/533209/visual-studio-2010-rc-setup-does-not-start-on-windows-7-x64"&gt;https://connect.microsoft.com/VisualStudio/feedback/details/533209/visual-studio-2010-rc-setup-does-not-start-on-windows-7-x64&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10351" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author></entry><entry><title>File-less activation of Routing Service</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/02/09/file-less-activation-of-routing-service.aspx" /><id>/blogs/damir_dobric/archive/2010/02/09/file-less-activation-of-routing-service.aspx</id><published>2010-02-09T22:56:48Z</published><updated>2010-02-09T22:56:48Z</updated><content type="html">&lt;p&gt;while using File-Less activation feature to activate &lt;strong&gt;RoutingService&lt;/strong&gt; you may experience an error. &lt;/p&gt;  &lt;p&gt;To make sure that RoutingService works at all, I added RoutingService.svc file which hosts RoutingService:   &lt;br /&gt;    &lt;br /&gt;&lt;font color="#000080"&gt;&amp;lt;%@ ServiceHost Language=&amp;quot;C#&amp;quot; Debug=&amp;quot;true&amp;quot; Service=&amp;quot;System.ServiceModel.Routing.RoutingService, System.ServiceModel.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&amp;quot;%&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;When I open the page /RoutingService.svc the WSDL description is shown as expected.    &lt;br /&gt;    &lt;br /&gt;However, when I add file-less activation (se below), the error appears, when trying to open RoutingService.svc (delete this file when using file-less activation):    &lt;br /&gt;    &lt;br /&gt;Here is the configuration:&lt;/p&gt;  &lt;p&gt;&lt;font color="#004080"&gt;&amp;lt;add relativeAddress=&amp;quot;RoutingService2.svc&amp;quot; service=&amp;quot;System.ServiceModel.Routing.RoutingService&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;.. and these are errors:   &lt;br /&gt;    &lt;br /&gt;&lt;font color="#ff0000"&gt;&amp;quot;&lt;em&gt;The resource cannot be found&lt;/em&gt;&amp;quot; OR&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;&lt;font color="#ff0000"&gt;The type &amp;#39;System.ServiceModel.Routing.RoutingService&amp;#39;, provided as the Service attribute value in the ServiceHost directive could not be found.&lt;/font&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;Following configuration solves the problem:&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080"&gt;&amp;lt;add relativeAddress=&amp;quot;RoutingService.svc&amp;quot; service=&amp;quot;System.ServiceModel.Routing.RoutingService, System.ServiceModel.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10293" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author></entry><entry><title>WinSpool.Drv SetPort function fails</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/02/09/winspool-drv-setport-function-fails.aspx" /><id>/blogs/damir_dobric/archive/2010/02/09/winspool-drv-setport-function-fails.aspx</id><published>2010-02-09T16:10:43Z</published><updated>2010-02-09T16:10:43Z</updated><content type="html">&lt;p&gt;When calling &lt;a href="http://msdn.microsoft.com/en-us/library/dd145081(VS.85).aspx"&gt;SetPort&lt;/a&gt; function implemented in WinSpool.Drv within .NET, you may get following error:    &lt;br /&gt;    &lt;br /&gt;&lt;font color="#ff0000"&gt;0x0000007C - The system call level is not correct.&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;After intensive digging in internet I didn’t find anything related to this error. The problem is that obviously nobody has ever called it within .NET. This is reasonable, because this function is designed to be called within one &lt;a href="http://msdn.microsoft.com/en-us/library/ms802178.aspx"&gt;port monitor&lt;/a&gt;, and port monitor is always written in C++ as user mode driver. Till now.    &lt;br /&gt;    &lt;br /&gt;The error above has no logical meaning. In my case indicates stack corruption, because .NET code didn’t marshal few parameters as expected. The reason for this is that all interop definitions of &lt;strong&gt;SetPort&lt;/strong&gt; function, which you can found in internet&amp;#160; are just wrong. They probably have been generated automatically.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The right definition is for sure:&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;[&lt;span style="color:#2b91af;"&gt;DllImport&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;DllNames&lt;/span&gt;.WinSpool, CharSet = &lt;span style="color:#2b91af;"&gt;CharSet&lt;/span&gt;.Unicode, SetLastError = &lt;span style="color:blue;"&gt;true&lt;/span&gt;)]      &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:blue;"&gt;extern&lt;/span&gt; &lt;span style="color:blue;"&gt;bool&lt;/span&gt; SetPort(      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-no-proof:yes;"&gt;[&lt;span style="color:#2b91af;"&gt;In&lt;/span&gt;, &lt;span style="color:#2b91af;"&gt;MarshalAs&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;UnmanagedType&lt;/span&gt;.LPWStr)] &lt;span style="color:blue;"&gt;string&lt;/span&gt; pName,        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-no-proof:yes;"&gt;[&lt;span style="color:#2b91af;"&gt;In&lt;/span&gt;, &lt;span style="color:#2b91af;"&gt;MarshalAs&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;UnmanagedType&lt;/span&gt;.LPWStr)] &lt;span style="color:blue;"&gt;string&lt;/span&gt; portName,        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-no-proof:yes;"&gt;&lt;span style="color:blue;"&gt;uint&lt;/span&gt; dwLevel,        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-no-proof:yes;"&gt;&lt;span style="color:#2b91af;"&gt;IntPtr&lt;/span&gt; pData&lt;/span&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-no-proof:yes;"&gt;);&lt;/span&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And the ultimate call to &lt;strong&gt;SetPort&lt;/strong&gt; looks like:    &lt;br /&gt;&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2"&gt;     &lt;tr&gt;       &lt;td&gt;         &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:#2b91af;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;IntPtr&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt; handle;             &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;&lt;span style="color:#2b91af;"&gt;PORT_INFO_3&lt;/span&gt; pInf = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;PORT_INFO_3&lt;/span&gt;();              &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;pInf.dwSeverity = &lt;span style="color:#2b91af;"&gt;WinSpooler&lt;/span&gt;.PORT_STATUS_TYPE_INFO;              &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;pInf.dwStatus = &lt;span style="color:#2b91af;"&gt;WinSpooler&lt;/span&gt;.PORT_STATUS_OFFLINE;              &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;pInf.pszStatus = &lt;span style="color:blue;"&gt;null&lt;/span&gt;; // This works with OS Ver. &amp;gt;= 6               &lt;br /&gt;              &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;&lt;span style="color:blue;"&gt;uint&lt;/span&gt; level = 3;              &lt;br /&gt;              &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;&lt;span style="color:#2b91af;"&gt;IntPtr&lt;/span&gt; pData = &lt;span style="color:#2b91af;"&gt;Marshal&lt;/span&gt;.AllocHGlobal(&lt;span style="color:#2b91af;"&gt;Marshal&lt;/span&gt;.SizeOf(pInf));              &lt;br /&gt;              &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;&lt;span style="color:#2b91af;"&gt;Marshal&lt;/span&gt;.StructureToPtr(pInf, pData, &lt;span style="color:blue;"&gt;true&lt;/span&gt;);              &lt;p&gt;&lt;/p&gt;           &lt;/span&gt;&lt;/p&gt;          &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;&lt;span style="color:blue;"&gt;bool&lt;/span&gt; res = &lt;span style="color:#2b91af;"&gt;WinSpooler&lt;/span&gt;.SetPort( &lt;span style="color:blue;"&gt;null&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;DOT4_002&amp;quot;&lt;/span&gt;, level, pData);              &lt;p&gt;&lt;/p&gt;           &lt;/span&gt;&lt;/p&gt;          &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&lt;/font&gt;            &lt;br /&gt;&amp;#160;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/table&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10287" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author></entry><entry><title>Error while MergingDictionaries in Silverlight</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/01/26/error-while-mergingdictionaries-in-silverlight.aspx" /><id>/blogs/damir_dobric/archive/2010/01/26/error-while-mergingdictionaries-in-silverlight.aspx</id><published>2010-01-26T13:25:15Z</published><updated>2010-01-26T13:25:15Z</updated><content type="html">&lt;p&gt;In my SIlverlight application I used following code to perform the merge of Resources which are stored in some dedicated assembly designed for this purpose. For this reason I used following code:   &lt;br /&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:#2b91af;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;ResourceDictionary&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt; dict = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;ResourceDictionary&lt;/span&gt;();      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:blue;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;string&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt; src = “/MySilverlightControls;component/themes/MyDictionary.xaml”     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;dict.Source = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Uri&lt;/span&gt;(src, &lt;span style="color:#2b91af;"&gt;UriKind&lt;/span&gt;.RelativeOrAbsolute);      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;color:#2b91af;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;Application&lt;/span&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;.Current.Resources.MergedDictionaries.Add(dict);&lt;/span&gt;&lt;span style="mso-ansi-language:en-us;"&gt;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;This code usually works perfect. However sometimes it fails with following exception:&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;&lt;em&gt;Error HRESULT E_FAIL has been returned from a call to a COM component.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;This nothing saying exception does not help and do not try do decrypt the hidden information. I figured out that following code does a bit better job.   &lt;br /&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; src = &lt;span style="color:#2b91af;"&gt;“/MySilverlightControls;component/themes/MyDictionary.xaml”.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;&lt;span style="color:#2b91af;"&gt;StreamResourceInfo&lt;/span&gt; resourceInfo =       &lt;br /&gt;&lt;span style="color:#2b91af;"&gt;Application&lt;/span&gt;.GetResourceStream(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Uri&lt;/span&gt;(src, &lt;span style="color:#2b91af;"&gt;UriKind&lt;/span&gt;.RelativeOrAbsolute));      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height:normal;margin-bottom:0pt;mso-layout-grid-align:none;" class="MsoNormal"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;&lt;span style="color:#2b91af;"&gt;StreamReader&lt;/span&gt; resourceReader = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;StreamReader&lt;/span&gt;(resourceInfo.Stream);      &lt;br /&gt;      &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; xaml = resourceReader.ReadToEnd();      &lt;br /&gt;      &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;&lt;span style="color:#2b91af;"&gt;ResourceDictionary&lt;/span&gt; resourceTheme = &lt;span style="color:#2b91af;"&gt;XamlReader&lt;/span&gt;.Load(xaml) &lt;span style="color:blue;"&gt;as&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;ResourceDictionary&lt;/span&gt;;      &lt;br /&gt;      &lt;br /&gt;&lt;/span&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;font-size:10pt;mso-ansi-language:en-us;mso-no-proof:yes;"&gt;&lt;span style="color:#2b91af;"&gt;Application&lt;/span&gt;.Current.Resources.MergedDictionaries.Add(resourceTheme);&lt;/span&gt;&lt;span style="mso-ansi-language:en-us;"&gt;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;When using this code you will get the real error description. In my case this was indication that I had some error in XAML, which designer didn’t discover:&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;Invalid attribute value Daenet_Silverlight_Controls:WindowControl for property TargetType. [Line: 377 Position: 54]&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;To solve this specifi problem I added missing declaration:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;xmlns:Daenet_Silverlight_Controls=&amp;quot;clr-namespace:Daenet.Silverlight.Controls;assembly=Daenet.Silverlight&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10139" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author><category term="Silverlight" scheme="http://developers.de/blogs/damir_dobric/archive/tags/Silverlight/default.aspx" /></entry><entry><title>DataServices 0x80070006 error</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/01/26/dataservices-0x80070006-error.aspx" /><id>/blogs/damir_dobric/archive/2010/01/26/dataservices-0x80070006-error.aspx</id><published>2010-01-26T12:59:53Z</published><updated>2010-01-26T12:59:53Z</updated><content type="html">&lt;p&gt;When working with Ado.Net data services you may get following error.&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;Could not load file or assembly &amp;#39;System.Data.Services.Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;#39; or one of its dependencies. The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;This error can indicate anything related to JIT-er. In my case there is directly nothing to do with JIT-er.   &lt;br /&gt;I have a service which talks to database by using of ADO.NET services (like described in &lt;a href="http://developers.de/blogs/damir_dobric/archive/2009/12/23/using-of-impersonation-with-dataservices.aspx"&gt;this&lt;/a&gt; post).    &lt;br /&gt;    &lt;br /&gt;However my DataService overrides the method &lt;strong&gt;OnStartProcessingRequest&lt;/strong&gt;. Within this method I invoke sometimes another service to check the caller’s permissions. If this fails the error shown above will appear.    &lt;br /&gt;    &lt;br /&gt;In fact, this error is shown (at least) if the method like &lt;strong&gt;OnStartProcessingRequest&lt;/strong&gt; fails during execution.&lt;/p&gt;  &lt;p&gt;protected override void &lt;strong&gt;OnStartProcessingRequest&lt;/strong&gt;(ProcessRequestArgs args)    &lt;br /&gt;{&lt;/p&gt;  &lt;p&gt;&amp;#160; throw Exception(“Any error here causes the error described aabove”)&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10137" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author><category term="WCF" scheme="http://developers.de/blogs/damir_dobric/archive/tags/WCF/default.aspx" /><category term="Silverlight" scheme="http://developers.de/blogs/damir_dobric/archive/tags/Silverlight/default.aspx" /></entry><entry><title>Difficulties with Virtual PC on Windows 7</title><link rel="alternate" type="text/html" href="/blogs/damir_dobric/archive/2010/01/23/difficulties-virtual-pc-on-windows-7.aspx" /><id>/blogs/damir_dobric/archive/2010/01/23/difficulties-virtual-pc-on-windows-7.aspx</id><published>2010-01-23T17:45:37Z</published><updated>2010-01-23T17:45:37Z</updated><content type="html">&lt;p&gt;In my daily working I use used a number of virtual images, with different configurations. After I installed Virtual PC for Windows 7 x64 I figured out that no one of my images can be used.&lt;/p&gt;  &lt;h4&gt;Problem I&lt;/h4&gt;  &lt;p&gt;When you start the image created on&lt;em&gt; Release Candidate&lt;/em&gt; of Windows 7 following error appear:    &lt;br /&gt;&lt;font color="#ff0000"&gt;“Could not register the virtual machine.     &lt;br /&gt;&lt;/font&gt;&lt;font color="#ff0000"&gt;The virtual machine configuration could not be added. User does not have sufficient access rights.&lt;/font&gt; “&lt;/p&gt;  &lt;p&gt;I was like “uupss”?! Really no time for such stupid thinks.&lt;/p&gt;  &lt;p&gt;To workaround this create the fresh new image with Virtual PC for “Windows 7 RTM” and bind existing VHD drive.   &lt;br /&gt;Then you can jump to the next problem.&lt;/p&gt;  &lt;h4&gt;Problem II&lt;/h4&gt;  &lt;p&gt;After I started the new image following erroro apered:&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;Virtual PC bla, blla &amp;quot;was unable to write to one of its virtual hard disks&amp;quot;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Now I was like “arggsh” (read and feel frustrated).   &lt;br /&gt;To slve the proble I figured out, that the external VHD drive has to be bound by using of share name.&lt;/p&gt;  &lt;p&gt;For example: &lt;em&gt;&lt;strong&gt;c:\Machines\MyDrive.vhd&lt;/strong&gt;&lt;/em&gt; will fail with error shown above.    &lt;br /&gt;So, to make it working use share name: &lt;em&gt;&lt;strong&gt;&lt;a&gt;\\MyMachineName:\Machines\MyDrive.vhd&lt;/a&gt;&lt;/strong&gt;&lt;/em&gt; &lt;/p&gt;  &lt;p&gt;Now I’m asking myself ”why do we like to make things to complex?”   &lt;br /&gt;    &lt;br /&gt;Just forget it and be lucky.&lt;/p&gt;  &lt;p&gt;:)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=10128" width="1" height="1"&gt;</content><author><name>ddobric</name><uri>http://developers.de/members/ddobric/default.aspx</uri></author></entry></feed>