<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Damien McGivern</title><link>http://nimtug.org/blogs/damien-mcgivern/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/DamienMcGivern" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>SQL Error 30080 - The full-text population on table [table name] cannot be started because the full-text catalog is importing data from existing catalogs.</title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/YmYPOhOXv-8/sql-error-30080-the-full-text-population-on-table-table-name-cannot-be-started-because-the-full-text-catalog-is-importing-data-from-existing-catalogs.aspx</link><pubDate>Thu, 22 Oct 2009 14:02:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:2498</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=2498</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2009/10/22/sql-error-30080-the-full-text-population-on-table-table-name-cannot-be-started-because-the-full-text-catalog-is-importing-data-from-existing-catalogs.aspx#comments</comments><description>&lt;p&gt;Earlier today I received an error while running an update script on a client&amp;#39;s SQL Server 2008 database. The script was trying to add FTS to a new field in the table&lt;/p&gt;&lt;p&gt;The &lt;a href="http://msdn.microsoft.com/en-us/library/cc645727.aspx" title="SQL 2008 Error code 30080 details"&gt;error code 30080&lt;/a&gt; had the message The full-text population on table [table name] cannot be started because the
full-text catalog is importing data from existing catalogs. After the
import operation finishes, rerun the command.&lt;/p&gt;&lt;p&gt;I search the web but didn&amp;#39;t get much help as the only solution I could find involved restarting the SQL Server which wasn&amp;#39;t an option. Also there wasn&amp;#39;t any additional help in the SQL logs, I tried restoring the database and updating again (only same issue occurred) and even waited for an hour then trying the script again.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In the end my solution was to:&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;In SQL Server Management Studio open Database &amp;gt; Storage &amp;gt; Full Text Catalogs &amp;gt; Right click Properties&amp;nbsp; &lt;/p&gt;&lt;p&gt;In the general setting select &amp;#39;Rebuild catalog&amp;#39; and click OK.&lt;/p&gt;&lt;p&gt;Then I can run the script without errors.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;m not sure why this issue occurred in the first place but at least the database is updated and running as expected now. Hope this helps anyone with the same issue.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://nimtug.org/aggbug.aspx?PostID=2498" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/SQL/default.aspx">SQL</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2009/10/22/sql-error-30080-the-full-text-population-on-table-table-name-cannot-be-started-because-the-full-text-catalog-is-importing-data-from-existing-catalogs.aspx</feedburner:origLink></item><item><title>UK Students to get Windows 7 for £30</title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/xU-mrx63t-c/uk-students-to-get-windows-7-for-163-30.aspx</link><pubDate>Thu, 17 Sep 2009 16:22:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:2446</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=2446</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2009/09/17/uk-students-to-get-windows-7-for-163-30.aspx#comments</comments><description>&lt;p&gt;From 1st Oct Microsoft are offering UK students with a valid uni/college email address either Windows 7 Home Premium or Windows 7 Professional for only £30 &lt;/p&gt;&lt;p&gt;For more information see &lt;a href="http://www.microsoft.com/uk/windows/studentoffer/" target="_blank"&gt;http://www.microsoft.com/uk/windows/studentoffer/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;img src="http://www.microsoft.com/library/media/2057/uk/windows/images/Windows7.png" height="64" width="400" alt="" /&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://nimtug.org/aggbug.aspx?PostID=2446" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/windows+7/default.aspx">windows 7</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/Student/default.aspx">Student</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/Offer/default.aspx">Offer</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2009/09/17/uk-students-to-get-windows-7-for-163-30.aspx</feedburner:origLink></item><item><title>Google Page Speed - Firefox/Firebug Add-On - Web Developer Tool</title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/bwTqgaFYwcU/google-page-speed-firefox-firebug-add-on-web-developer-tool.aspx</link><pubDate>Tue, 11 Aug 2009 08:13:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:2394</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=2394</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2009/08/11/google-page-speed-firefox-firebug-add-on-web-developer-tool.aspx#comments</comments><description>&lt;p&gt;Yesterday &lt;a href="http://googleblog.blogspot.com/2009/08/new-tools-for-google-services-for.html" title="Page Speed, Web Elements "&gt;google announced some new tools and services for web developers&lt;/a&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;i&gt;We&amp;#39;ve just added new tools to the suite:&lt;br /&gt;&lt;/i&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;i&gt;&lt;a href="http://www.google.com/webelements/"&gt;Web Elements&lt;/a&gt;
allows your customers to enhance their websites with the ease of
cut-and-paste. Webmasters can provide maps, real-time news, calendars,
presentations, spreadsheets and YouTube videos on their sites. With the
Conversation Element, websites can create more engagement with their
communities. The Custom Search Element provides inline search over your
own site (or others you specify) without having to write any code and
various options to &lt;a href="http://googlecustomsearch.blogspot.com/2009/08/custom-search-with-custom-style-peanut.html"&gt;customize further&lt;/a&gt;. &lt;/i&gt;&lt;/li&gt;

&lt;li&gt;&lt;i&gt;&lt;a href="http://code.google.com/speed/page-speed/"&gt;Page Speed&lt;/a&gt;
allows webmasters to measure the performance of their websites.
Snappier websites help users find things faster; the recommendations
from these latency tools allow hosters and webmasters to optimize
website speed. These techniques can help hosters reduce resource use
and optimize network bandwidth.&lt;/i&gt;&lt;/li&gt;

&lt;li&gt;&lt;i&gt;The &lt;a href="http://www.google.com/webmasters/provider/tips.html"&gt;Tips for Hosters page&lt;/a&gt;
offers a set of tips for hosters for creating a richer website hosting
platform. Hosters can improve the convenience and accessibility of
tools, while at the same time saving platform costs and earning
referral fees. Tips include the use of analytics tools such as Google
Analytics to help webmasters understand their traffic and linguistic
tools such as &lt;a href="http://translate.google.com/translate_tools?hl=en"&gt;Google Translate&lt;/a&gt; to help websites reach a broader audience.&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;I&amp;#39;m impressed by &lt;a href="http://code.google.com/speed/page-speed/" title="Google Page Speed"&gt;Page Speed&lt;/a&gt; which is a &lt;a href="http://www.mozilla.com/firefox/" title="Firefox Browser"&gt;Firefox&lt;/a&gt;/&lt;a href="http://getfirebug.com/%20" title="Firebug Firefox Web Developer Add-On"&gt;Firebug &lt;/a&gt;add-on  for web developers. If you are familiar with &lt;a href="http://developer.yahoo.com/yslow/" title="Yahoo! YSlow Firefox Web Developer Add-On"&gt;Yahoo&amp;#39;s YSlow&lt;/a&gt; (if not you should be) which is also a FF add-on it offers similar features in that it enables you to analyse the loading of web pages, rates how good the load time is and &lt;a href="http://code.google.com/speed/page-speed/docs/rules_intro.html" title="Page Speed Rules"&gt;suggests how you could improve page load times&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;A couple of features that I like that are not available in YSlow are:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://code.google.com/speed/page-speed/docs/rendering.html#UseEfficientCSSSelectors%20"&gt;Use Efficient CSS Selectors&lt;/a&gt; - lists those CSS selectors that may slow down the user&amp;#39;s experience&lt;/p&gt;

&lt;p&gt;&lt;a href="http://nimtug.org/blogs/damien-mcgivern/efficient_css_selectors.png"&gt;&lt;img src="http://nimtug.org/blogs/damien-mcgivern/efficient_css_selectors.png" border="0" alt="" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://code.google.com/speed/page-speed/docs/payload.html#RemoveUnusedCSS" target="_blank"&gt;Remove unused CSS &lt;/a&gt;- lists all the CSS that is not used in a page, great for helping you to remove CSS that is no longer used or refractor large CSS files.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://nimtug.org/blogs/damien-mcgivern/remove_css.png"&gt;&lt;img src="http://nimtug.org/blogs/damien-mcgivern/remove_css.png" border="0" alt="" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://code.google.com/speed/page-speed/docs/using.html#activities" target="_blank"&gt;Page Speed Activity &lt;/a&gt;- enables you to record your activity on a website over multiple pages and see what the browser is doing and spending time on.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://nimtug.org/blogs/damien-mcgivern/recorder.png"&gt;&lt;img src="http://nimtug.org/blogs/damien-mcgivern/recorder.png" border="0" alt="" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;I highly recommend checking out this add-on - I think it&amp;#39;s a great tool. &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fnimtug.org%2fblogs%2fdamien-mcgivern%2farchive%2f2009%2f08%2f11%2fgoogle-page-speed-firefox-firebug-add-on-web-developer-tool.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fnimtug.org%2fblogs%2fdamien-mcgivern%2farchive%2f2009%2f08%2f11%2fgoogle-page-speed-firefox-firebug-add-on-web-developer-tool.aspx" alt="kick it on DotNetKicks.com" border="0" /&gt;&lt;/a&gt;

&lt;a href="http://dotnetshoutout.com/Google-Page-Speed-FirefoxFirebug-Add-On-Web-Developer-Tool-Damien-McGivern"&gt;&lt;img src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fnimtug.org%2Fblogs%2Fdamien-mcgivern%2Farchive%2F2009%2F08%2F11%2Fgoogle-page-speed-firefox-firebug-add-on-web-developer-tool.aspx" alt="Shout it" style="border:0px none;" /&gt;&lt;/a&gt;&lt;img src="http://nimtug.org/aggbug.aspx?PostID=2394" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/Firefox/default.aspx">Firefox</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/web+development/default.aspx">web development</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2009/08/11/google-page-speed-firefox-firebug-add-on-web-developer-tool.aspx</feedburner:origLink></item><item><title>WCF CommunicationObjectFaultedException " cannot be used for communication because it is in the Faulted state"  MessageSecurityException "An error occurred when verifying security for the message"</title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/gxSjjpUNZ6A/wcf-communicationobjectfaultedexception-quot-cannot-be-used-for-communication-because-it-is-in-the-faulted-state-quot-messagesecurityexception-quot-an-error-occurred-when-verifying-security-for-the-message-quot.aspx</link><pubDate>Tue, 26 May 2009 12:06:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:2320</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>5</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=2320</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2009/05/26/wcf-communicationobjectfaultedexception-quot-cannot-be-used-for-communication-because-it-is-in-the-faulted-state-quot-messagesecurityexception-quot-an-error-occurred-when-verifying-security-for-the-message-quot.aspx#comments</comments><description>		    
&lt;p&gt;
I&amp;#39;ve just spent a couple of hours trying to track down a customer issue with one of our WCF services. Below was part of the unit test I was suing to test the service.&lt;br /&gt;&lt;/p&gt;

&lt;pre class="brush: c-sharp;"&gt;using (var client = new MemberServiceClient())
{
    client.ClientCredentials.UserName.UserName = ConfigurationManager.AppSettings[&amp;quot;username&amp;quot;];
    client.ClientCredentials.UserName.Password = ConfigurationManager.AppSettings[&amp;quot;password&amp;quot;];
    client.CreateMember(mem);
    client.DeleteMember(mem.ExternalRef);
}
&lt;/pre&gt;


&lt;p&gt;and the exception it was throwing was:&lt;br /&gt;&lt;/p&gt;

&lt;pre class="brush: c-sharp;"&gt;failed: System.ServiceModel.CommunicationObjectFaultedException : The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.
	
	Server stack trace: 
	at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
	
	Exception rethrown at [0]: 
	at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
	at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp;amp; msgData, Int32 type)
	at System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout)
	at System.ServiceModel.ClientBase`1.System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout)
	at System.ServiceModel.ClientBase`1.Close()
	at System.ServiceModel.ClientBase`1.System.IDisposable.Dispose()

&lt;/pre&gt;

&lt;p&gt;When I debugged the code the code actually fails at the CreateMember line not at the close method indicated at by the stack trace. Then I realised that this was one of thoes WCF silly moments - don&amp;#39;t use using blocks!. Yes believe it or not if you use a using block around a WCF client and it fails when the using block calls the dispose method it throws a new excpetion masking the real exception. &lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;The code below is some helper methods we use for making WCF clients are cleaned up correctly.&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;


&lt;pre class="brush: c-sharp;"&gt;/// &amp;lt;summary&amp;gt;
/// WCF proxys do not clean up properly if they throw an exception. This method ensures that the service proxy is handeled correctly.
/// Do not call TService.Close() or TService.Abort() within the action lambda.
/// &amp;lt;/summary&amp;gt;
/// &amp;lt;typeparam name=&amp;quot;TService&amp;quot;&amp;gt;The type of the service to use&amp;lt;/typeparam&amp;gt;
/// &amp;lt;param name=&amp;quot;action&amp;quot;&amp;gt;Lambda of the action to performwith the service&amp;lt;/param&amp;gt;

public static void Using&amp;lt;TService&amp;gt;(Action&amp;lt;TService&amp;gt; action)
	where TService : ICommunicationObject, IDisposable, new()
{
	var service = new TService();
	bool success = false;
	try
	{
		action(service);
		if (service.State != CommunicationState.Faulted)
		{
			service.Close();
			success = true;
		}
	}
	finally
	{
		if (!success)
		{
			service.Abort();
		}
	}
}

&lt;/pre&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;Changing the code to using our service helper methods.&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;pre class="brush: c-sharp;"&gt;ServiceHelper.Using(
    client =&amp;gt;

        {
            client.ClientCredentials.UserName.UserName = ConfigurationManager.AppSettings[&amp;quot;username&amp;quot;];
            client.ClientCredentials.UserName.Password = ConfigurationManager.AppSettings[&amp;quot;password&amp;quot;];
            client.CreateMember(mem);
            client.DeleteMember(mem.ExternalRef);
        }
    );

&lt;/pre&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;Now the code exposed the actual exception that was causing the issue.&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;pre class="brush: c-sharp;"&gt;failed: System.ServiceModel.Security.MessageSecurityException : An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
  ----&amp;gt; System.ServiceModel.FaultException : An error occurred when verifying security for the message.
	
	Server stack trace: 
	at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)
	at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
	at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout)
	at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout)
	at System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout)
	at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout)
	at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
	at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
	at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
	at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
	at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
	at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
	at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
	at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)


&lt;/pre&gt;

&lt;p&gt;This exception had me stumped as I had never come across it before but after a bit of digging I discovered that the server time was 7 minutes late and that changing the time fixed the issue. Still trying to figure out how the server&amp;#39;s time got out of synced.&lt;br /&gt;&lt;/p&gt;

&lt;img src="http://nimtug.org/aggbug.aspx?PostID=2320" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/WCF/default.aspx">WCF</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/Debugging/default.aspx">Debugging</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2009/05/26/wcf-communicationobjectfaultedexception-quot-cannot-be-used-for-communication-because-it-is-in-the-faulted-state-quot-messagesecurityexception-quot-an-error-occurred-when-verifying-security-for-the-message-quot.aspx</feedburner:origLink></item><item><title>XML Linq requires correct namespace for all XElements</title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/4d6ko9E_vTk/xml-linq-requires-correct-namespace-for-all-xelements.aspx</link><pubDate>Sun, 24 May 2009 19:58:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:2315</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=2315</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2009/05/24/xml-linq-requires-correct-namespace-for-all-xelements.aspx#comments</comments><description>
&lt;p&gt;I&amp;#39;ve been teaching myself &lt;a href="http://www.asp.net/mvc/" title="ASP.Net MVC"&gt;ASP.Net MVC&lt;/a&gt; during any free time I get at the weekends. I started a simple test project which has developed into the &lt;a href="http://nimtug.org/events/" title="NIMTUG Events"&gt;events section on NIMTUG&lt;/a&gt;. Yesterday I was looking for a way to easily create search engine sitemaps for the event and sepaker pages and I found &lt;a href="http://robtennyson.us/" title="Robert Tennyson&amp;#39;s Blog"&gt;Robert Tennyson&amp;#39;s&lt;/a&gt; post &lt;a href="http://robtennyson.us/post/2008/10/16/Dynamic-sitemaps-with-ASPNET-MVC.aspx" title="ASP.Net MVC Sitemaps"&gt;Dynamic sitemaps with ASP.NET MVC&lt;/a&gt; which seems very easy indeed. With a couple of changes I had the sitemaps working and so submitted them to google only to be notified a couple of hours later that they had failed with the error &amp;quot;Invalid Namespace&amp;quot;.&lt;/p&gt;

&lt;p&gt;I should have validated the outputed Xml using the &lt;a href="http://www.validome.org/google/validate" title="Google Sitemap Validator"&gt;Google Sitemap Validator&lt;/a&gt; but instead I had only tested the xml output in the browser which hid the root namespace (xmlns attribute) but more importantly also hid an empty namespace on all the url elements. &lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;
&amp;lt;urlset xmlns=&amp;quot;http://www.sitemaps.org/schemas/sitemap/0.9&amp;quot;&amp;gt;
  &amp;lt;url xmlns=&amp;quot;&amp;quot;&amp;gt;
    &amp;lt;loc&amp;gt;http://nimtug.org/events/speaker/details/41&amp;lt;/loc&amp;gt;
   &amp;lt;lastmod&amp;gt;2009-05-23&amp;lt;/lastmod&amp;gt;
  &amp;lt;/url&amp;gt;
  &amp;lt;url xmlns=&amp;quot;&amp;quot;&amp;gt;
    &amp;lt;loc&amp;gt;http://nimtug.org/events/speaker/details/23&amp;lt;/loc&amp;gt;

    &amp;lt;lastmod&amp;gt;2009-05-23&amp;lt;/lastmod&amp;gt;
  &amp;lt;/url&amp;gt; 
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;It appears that with LINQ to XMl you have to add the correct namespace to every XmlElement which seems like over kill to me as the child elements are supposed to inherit their namespace from their parent (as you would expect) - if anyone knows of an easier way please let me know. My fix was to just add the namespace to each XElement constructor.&lt;br /&gt;&lt;/p&gt;

&lt;pre class="brush: c-sharp;"&gt;protected string GetAlsoluteUrl(object routeValues)
{
    var values = new RouteValueDictionary(routeValues);
    var context = new RequestContext(HttpContext, RouteData);

    string url = RouteTable.Routes.GetVirtualPath(context, values).VirtualPath;

    return new Uri(Request.Url, url).AbsoluteUri;
}

protected ActionResult CreateSiteMap&amp;lt;TModel, TID&amp;gt;(IEnumerable&amp;lt;TModel&amp;gt; items, Func&amp;lt;TModel, TID&amp;gt; getID,
                                                  string controllerName, string actionName)
{
    // XML LINQ requires that ALL XElements have the correct namespace 
    XNamespace xmlns = &amp;quot;http://www.sitemaps.org/schemas/sitemap/0.9&amp;quot;;

    var root = new XElement(xmlns + &amp;quot;urlset&amp;quot;);
    foreach (TModel item in items)
    {
        object routeValues =
            new
                {
                    id = getID(item),
                    controller = controllerName,
                    action = actionName
                };


        // only add last modified element if we can get the date
        XElement lastMod = null;
        var lm = item as IObjectTimes;
        if (lm != null)
        {
            lastMod = new XElement(xmlns + &amp;quot;lastmod&amp;quot;, (lm.Updated ?? lm.Created).ToString(&amp;quot;yyyy-MM-dd&amp;quot;));
        }
        root.Add(new XElement(xmlns + &amp;quot;url&amp;quot;,
                              new XElement(xmlns + &amp;quot;loc&amp;quot;, GetAlsoluteUrl(routeValues)), lastMod
                     )
            );
    }


    using (var memoryStream = new MemoryStream())
    {
        using (var writer = new StreamWriter(memoryStream, Encoding.UTF8))
        {
            root.Save(writer);
        }

        return Content(Encoding.UTF8.GetString(memoryStream.ToArray()), &amp;quot;text/xml&amp;quot;, Encoding.UTF8);
    }
}
&lt;/pre&gt;
&lt;img src="http://nimtug.org/aggbug.aspx?PostID=2315" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/XML/default.aspx">XML</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/MVC/default.aspx">MVC</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/LINQ/default.aspx">LINQ</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2009/05/24/xml-linq-requires-correct-namespace-for-all-xelements.aspx</feedburner:origLink></item><item><title>PDF SQL Server Cheat Sheet</title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/CGLteVpFIAc/pdf-sql-server-cheat-sheet.aspx</link><pubDate>Wed, 20 May 2009 10:09:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:2310</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=2310</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2009/05/20/pdf-sql-server-cheat-sheet.aspx#comments</comments><description>&lt;p&gt;MVP &lt;a href="http://blog.sqlauthority.com" title="Pinal Dave"&gt;Pinal Dave&lt;/a&gt; has posted his &lt;a href="http://blog.sqlauthority.com/2009/05/20/sql-server-download-pdf-sql-server-cheat-sheet/%20" title="SQL Server cheat sheet"&gt;SQL Server cheat sheet&lt;/a&gt; as a PDF download.&lt;br /&gt;&lt;/p&gt;&lt;img src="http://nimtug.org/aggbug.aspx?PostID=2310" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/SQL/default.aspx">SQL</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2009/05/20/pdf-sql-server-cheat-sheet.aspx</feedburner:origLink></item><item><title>My Phone public beta opens</title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/nNwTORmm-zA/my-phone-public-beta-opens.aspx</link><pubDate>Tue, 19 May 2009 11:19:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:2309</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=2309</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2009/05/19/my-phone-public-beta-opens.aspx#comments</comments><description>&lt;p&gt;Microsoft has opened the beta of the My Phone service to the public. Only Windows Mobile phones with version 6 and up are supported.&lt;/p&gt;&lt;p&gt;It allows you to backup you data and access it from you My Phone web account and &lt;a href="http://sn1-p1.myphone.microsoft.com/mkweb//MoreInfo.po?tsid=1242731919587" title="All features of Microsoft My Phone"&gt;more&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://myphone.microsoft.com/%20" title="Microsoft My Phone"&gt;Microsoft My Phone&lt;/a&gt; &lt;br /&gt;&lt;/p&gt;&lt;img src="http://nimtug.org/aggbug.aspx?PostID=2309" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/Windows+Mobile/default.aspx">Windows Mobile</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2009/05/19/my-phone-public-beta-opens.aspx</feedburner:origLink></item><item><title>Stop Forum Spam wrapper and ASP.Net HttpModule</title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/XIEFniIQFjs/stop-forum-spam-wrapper-and-asp-net-httpmodule.aspx</link><pubDate>Sat, 13 Dec 2008 17:09:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:2241</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=2241</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2008/12/13/stop-forum-spam-wrapper-and-asp-net-httpmodule.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://www.stopforumspam.com/" title="Stop Forum Spam" target="_blank"&gt;Stop Forum Spam&lt;/a&gt; has an &lt;a href="http://www.stopforumspam.com/apis" title="Stop Forum Spam API" target="_blank"&gt;API&lt;/a&gt; that allows you to query their spam list using a REST call. I&amp;#39;ve written a simple wrapper for their API and created a HttpModule that checks the clients IP against the spam list. Making http requests is very expensive so the result of the IP check is cached for 24 hours making the performance impact to the end user only slightly noticeable on the first request.&lt;/p&gt;&lt;p&gt;The download includes the http module dll, test website and a couple of unit tests.&lt;/p&gt;&lt;p&gt;When I get a bit more time I&amp;#39;ll look into improving the performance, perhaps async using requests. Now off to finish my online xmas shopping.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://nimtug.org/files/folders/damien_mcgivern_files/entry2239.aspx" title="Stop Forum Spam API wrapper and HttpModule Code"&gt;Download Code&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://nimtug.org/files/folders/damien_mcgivern_files/entry2240.aspx" title="Download Stop Comment Spam Wrapper and HttpModule dll"&gt;Download DLL&lt;/a&gt; &lt;br /&gt;&lt;/p&gt;&lt;img src="http://nimtug.org/aggbug.aspx?PostID=2241" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/code/default.aspx">code</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2008/12/13/stop-forum-spam-wrapper-and-asp-net-httpmodule.aspx</feedburner:origLink></item><item><title>WCF REST Starter Kit Screencasts</title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/6gg1xef3Af0/wcf-rest-starter-kit-screencasts.aspx</link><pubDate>Sat, 06 Dec 2008 11:54:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:2232</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=2232</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2008/12/06/wcf-rest-starter-kit-screencasts.aspx#comments</comments><description>&lt;p&gt;Over on &lt;a href="http://channel9.msdn.com/shows/Endpoint/%20" title="Channel 9 endpoint TV" target="_blank"&gt;endpointTV&lt;/a&gt; &lt;span id="ctl00_MainPlaceHolder_Starter_BodyLabel"&gt;&lt;a href="https://mvp.support.microsoft.com/default.aspx/profile=b5b4ed23-677e-4503-869a-b0632af0cda6" title="Aaron Skonnard" target="_blank"&gt;Aaron Skonnard&lt;/a&gt; from&amp;nbsp;&lt;a href="http://www.pluralsight.com/" title="Premier training for Microsoft® .NET software developers" target="_blank"&gt;PluralSight&lt;/a&gt; has a &lt;a href="http://channel9.msdn.com/tags/REST+Starter+Kit+endpoint+screencasts/" title="WCF Starter Kit Introduction - endpoint TV - Aaron Skonnard"&gt;series of screencasts&lt;/a&gt; introducing some of the time saving features of the &lt;a href="http://msdn.microsoft.com/en-us/netframework/cc950529.aspx" title="WCF REST Starter Kit on MSDN" target="_blank"&gt;WCF REST Starter Kit&lt;/a&gt; which is &lt;a href="http://www.codeplex.com/aspnet/Wiki/View.aspx?title=WCF%20REST" title="WCF REST Starter Kit download" target="_blank"&gt;available to download from codeplex&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Found via &lt;a href="http://msmvps.com/blogs/sundar_narasiman/archive/2008/11/13/wcf-rest-starter-kit.aspx" title="WCF Rest Starter Kit or .NET 3.5 SP1 available on codeplex " target="_blank"&gt;Sundar Narasiman&amp;#39;s Blog &lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://nimtug.org/aggbug.aspx?PostID=2232" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/WCF/default.aspx">WCF</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/.Net+3.5+SP1/default.aspx">.Net 3.5 SP1</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/WCF+Starter+Kit/default.aspx">WCF Starter Kit</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2008/12/06/wcf-rest-starter-kit-screencasts.aspx</feedburner:origLink></item><item><title>(Windows Vista and Windows Server 2008) Service Pack 2 Customer Preview Program (CPP)</title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/YERAexGOiXw/windows-vista-and-windows-server-2008-service-pack-2-customer-preview-program-cpp.aspx</link><pubDate>Wed, 03 Dec 2008 04:58:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:2225</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=2225</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2008/12/03/windows-vista-and-windows-server-2008-service-pack-2-customer-preview-program-cpp.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://windowsteamblog.com/members/mikenash/default.aspx" title="Mike Nash&amp;#39;s blog" target="_blank"&gt;Mike Nash&lt;/a&gt; has announced that the &lt;a href="http://windowsteamblog.com/blogs/windowsvista/archive/2008/12/02/announcing-the-windows-vista-and-windows-server-2008-service-pack-2-customer-preview-program-cpp.aspx" title="Announcing the Windows Vista and Windows Server 2008 Service Pack 2 Customer Preview Program (CPP)" target="_blank"&gt;betas for both Windows Vista SP2 and Windows Server 2008 SP2 will be released to the public shortly&lt;/a&gt;, however if you have a TechNet or MSDN subscription then you can access them now.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://nimtug.org/aggbug.aspx?PostID=2225" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/Vista/default.aspx">Vista</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2008/12/03/windows-vista-and-windows-server-2008-service-pack-2-customer-preview-program-cpp.aspx</feedburner:origLink></item><item><title>ReSharper 4 doesn't like VS 2008 SP1/ .Net 3.5 SP1</title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/Ftt-TqMI6mw/resharper-4-doesn-t-like-vs-2008-sp1-net-3-5-sp1.aspx</link><pubDate>Thu, 15 May 2008 13:05:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:2012</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>4</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=2012</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2008/05/15/resharper-4-doesn-t-like-vs-2008-sp1-net-3-5-sp1.aspx#comments</comments><description>&lt;p&gt;&amp;nbsp;I’m a big fan of &lt;a href="http://www.jetbrains.com/resharper/" title="ReSharper" target="_blank"&gt;ReSharper &lt;/a&gt;and lately I’ve been installing the
&lt;a href="http://www.jetbrains.net/confluence/display/ReSharper/ReSharper+4.0+Nightly+Builds" title="Download ReSharper 4 Nightlu Builds" target="_blank"&gt;nightly builds&lt;/a&gt; which has resulted in a little pain with some dodgy builds but
overall I’m still allot more productive. Yesterday I noticed that &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=CF99C752-1391-4BC3-BABC-86BC0B9E8E5A&amp;amp;displaylang=en" title="Download VS 2008 SP1 Beta"&gt;Visual Studio
2008 SP1 Beta&lt;/a&gt; had been released and as I’d no other VS beta software installed
(there are issues with it if you do) I went ahead and tried it out. The
installer is very small and downloads the required files before continuing the
install. I’m not sure how long it took as I went off to play &lt;a href="http://www.rockstargames.com/" title="Grand Theft Auto - RockStar Games" target="_blank"&gt;Grand Theft Auto 4
&lt;/a&gt;on the PS3 but about 1 hour later I returned to the laptop to discover that the
install had failed. I opened up VS and checked the about dialogue – no mention
of SP1 so I left it. This morning when I opened up VS I noticed that ReSharper
no longer worked. I downloaded the latest nightly build and installed but still
ReSharper didn’t load within VS. Checking the Installed Programs I noticed that
.Net 3.5 SP1 was listed (I assume the VS SP1 installer installed this but didn’t
uninstall after it failed) and once this was uninstalled ReSharper came back to
life. Pity as I was looking forward to checking out some of the bug fixes and
performance improvements with WCF which SP1 &lt;span&gt;&amp;nbsp;&lt;/span&gt;claims to add. I&amp;#39;m running Vista Ultimate 64 bit but haven&amp;#39;t seen any other reports of issues.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Update: 19 May 2008&lt;/p&gt;&lt;p&gt;seems that my install may have failed due to issues with certain KB&amp;#39;s see &lt;a href="http://blogs.msdn.com/webdevtools/archive/2008/05/15/remove-kb945140-before-installing-visual-studio-2008-sp1-beta.aspx" title="Remove KB945140 Before installing VS 2008 SP1 Beta" target="_blank"&gt;http://blogs.msdn.com/webdevtools/archive/2008/05/15/remove-kb945140-before-installing-visual-studio-2008-sp1-beta.aspx&lt;/a&gt; - don&amp;#39;t think I&amp;#39;m going to try it again though untill I know R# will work. Some people do seem to have it working (with issues) though &lt;a href="http://www.intellij.net/forums/thread.jspa?threadID=275245&amp;amp;tstart=0" title="Resharper support for Visual Studio 2008 SP1 Beta" target="_blank"&gt;http://www.intellij.net/forums/thread.jspa?threadID=275245&amp;amp;tstart=0&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://nimtug.org/aggbug.aspx?PostID=2012" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/ReSharper/default.aspx">ReSharper</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/VS+2008+SP1/default.aspx">VS 2008 SP1</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/.Net+3.5+SP1/default.aspx">.Net 3.5 SP1</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2008/05/15/resharper-4-doesn-t-like-vs-2008-sp1-net-3-5-sp1.aspx</feedburner:origLink></item><item><title>VS 2008 Web Development Hot-Fix Roll-Up Available </title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/aAz3kx6jBMk/vs-2008-web-development-hot-fix-roll-up-available.aspx</link><pubDate>Sat, 09 Feb 2008 12:07:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:1733</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=1733</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2008/02/09/vs-2008-web-development-hot-fix-roll-up-available.aspx#comments</comments><description>&lt;p&gt;Some initial performance glitches with VS 2008 Web Development have been resolved and a patch has been released. Read more about it on Scot Guthrie&amp;#39;s blog post &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/02/08/vs-2008-web-development-hot-fix-roll-up-available.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2008/02/08/vs-2008-web-development-hot-fix-roll-up-available.aspx&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Direct download &lt;a href="https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826"&gt;https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826&lt;/a&gt;&amp;nbsp;(requires a live account)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://nimtug.org/aggbug.aspx?PostID=1733" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/VS.Net/default.aspx">VS.Net</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/VS+2008/default.aspx">VS 2008</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/ASP.NET/default.aspx">ASP.NET</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2008/02/09/vs-2008-web-development-hot-fix-roll-up-available.aspx</feedburner:origLink></item><item><title>Vista SP1 &amp; Windows Server 2008 both RTM</title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/rcCmR0Qa7pI/vista-sp1-amp-windows-server-2008-both-rtm.aspx</link><pubDate>Tue, 05 Feb 2008 06:03:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:1710</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=1710</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2008/02/05/vista-sp1-amp-windows-server-2008-both-rtm.aspx#comments</comments><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Vista SP1 and Windows Server 2008 have finally been RTM. For those of you
also on the W2K8 beta program you will be able to download from the connect
website. Unfortunately Vista SP1 hasn&amp;#39;t been made available to beta testers on
connect yet.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://windowsvistablog.com/blogs/windowsvista/archive/2008/02/04/announcing-the-rtm-of-windows-vista-sp1.aspx" title="Vista SP1 RTM"&gt;http://windowsvistablog.com/blogs/windowsvista/archive/2008/02/04/announcing-the-rtm-of-windows-vista-sp1.aspx&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://blogs.technet.com/windowsserver/archive/2008/02/04/windows-server-2008-rtm.aspx" title="Windows Server 2008 RTM"&gt;http://blogs.technet.com/windowsserver/archive/2008/02/04/windows-server-2008-rtm.aspx&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://nimtug.org/aggbug.aspx?PostID=1710" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/Vista/default.aspx">Vista</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/RTM/default.aspx">RTM</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2008/02/05/vista-sp1-amp-windows-server-2008-both-rtm.aspx</feedburner:origLink></item><item><title>WCF requires precompiled ASP.Net sites to be updatable</title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/MFsbnVY46Rg/wcf-required-precompiled-asp-net-site-to-be-updatable.aspx</link><pubDate>Wed, 30 Jan 2008 12:01:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:1688</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>7</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=1688</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2008/01/30/wcf-required-precompiled-asp-net-site-to-be-updatable.aspx#comments</comments><description>Today I was testing a deployment ASP.Net site build that I added some WCF services to. All other non deployment builds passed all testing so I was stumped when testing one of the services I got the following error.&lt;br /&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;h2&gt;&lt;i&gt;Value cannot be null.&lt;br /&gt;Parameter name: key&lt;/i&gt; &lt;/h2&gt;&lt;/span&gt;&lt;font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "&gt;&lt;b&gt;Description: 
&lt;/b&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;b&gt;Exception Details: 
&lt;/b&gt;System.ArgumentNullException: Value cannot be null.&lt;br /&gt;Parameter name: 
key&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Source Error:&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;
&lt;table bgcolor="#ffffcc"&gt;

&lt;tr&gt;
&lt;td&gt;&lt;code&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;/code&gt; 
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br /&gt;&lt;b&gt;Stack Trace:&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;
&lt;table bgcolor="#ffffcc"&gt;

&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&lt;/code&gt;
&lt;pre&gt;[ArgumentNullException: Value cannot be null.&lt;br /&gt;Parameter name: key]&lt;br /&gt;   System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) +51&lt;br /&gt;   System.Collections.Generic.Dictionary`2.FindEntry(TKey key) +5295964&lt;br /&gt;   System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue&amp;amp; value) +20&lt;br /&gt;   System.ServiceModel.Activation.MetabaseSettingsIis.GetTransportSettings(String virtualPath) +154&lt;br /&gt;   System.ServiceModel.Activation.MetabaseSettingsIis.GetAccessSslFlags(String virtualPath) +9&lt;br /&gt;   System.ServiceModel.Activation.HttpHostedTransportConfiguration.GetBaseAddresses(String virtualPath) +113&lt;br /&gt;   System.ServiceModel.Activation.HostedTransportConfigurationManager.InternalGetBaseAddresses(String virtualPath) +146&lt;br /&gt;   System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +162&lt;br /&gt;   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +46&lt;br /&gt;   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +738&lt;br /&gt;&lt;br /&gt;[ServiceActivationException: The service &amp;#39;/demo2/services/memberservice.svc&amp;#39; cannot be activated due to an exception during compilation.  The exception message is: Value cannot be null.&lt;br /&gt;Parameter name: key.]&lt;br /&gt;   System.ServiceModel.AsyncResult.End(IAsyncResult result) +7571873&lt;br /&gt;   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +4504815&lt;br /&gt;   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +288&lt;br /&gt;   System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +273&lt;br /&gt;   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80&lt;br /&gt;   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp;amp; completedSynchronously) +177&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;b&gt;Version Information:&lt;/b&gt;&amp;nbsp;Microsoft .NET Framework Version:2.0.50727.1433; 
ASP.NET Version:2.0.50727.1433 &lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The only difference with the deployment build is that the website is precompiled and the assemblies merged. Then I checked the even log and noticed that for every request of&amp;nbsp; memberservice.svc the following two errors occurred.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;font size="1"&gt;Event Type:&amp;nbsp;&amp;nbsp;&amp;nbsp; Error&lt;br /&gt;Event Source:&amp;nbsp;&amp;nbsp;&amp;nbsp; System.ServiceModel 3.0.0.0&lt;br /&gt;Event Category:&amp;nbsp;&amp;nbsp;&amp;nbsp; WebHost &lt;br /&gt;Event ID:&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;br /&gt;Date:&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 30/01/2008&lt;br /&gt;Time:&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 11:30:35&lt;br /&gt;User:&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; NT AUTHORITY\NETWORK SERVICE&lt;br /&gt;Computer:&amp;nbsp;&amp;nbsp;&amp;nbsp; ELGRECO&lt;br /&gt;Description:&lt;br /&gt;WebHost failed to process a request.&lt;br /&gt;&amp;nbsp;Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/30607723&lt;br /&gt;&amp;nbsp;Exception: System.ServiceModel.ServiceActivationException: The service &amp;#39;/demo2/services/memberservice.svc&amp;#39; cannot be activated due to an exception during compilation.&amp;nbsp; The exception message is: Value cannot be null.&lt;br /&gt;Parameter name: key. ---&amp;gt; System.ArgumentNullException: Value cannot be null.&lt;br /&gt;Parameter name: key&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue&amp;amp; value)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Activation.MetabaseSettingsIis.GetTransportSettings(String virtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Activation.MetabaseSettingsIis.GetAccessSslFlags(String virtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Activation.HttpHostedTransportConfiguration.GetBaseAddresses(String virtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Activation.HostedTransportConfigurationManager.InternalGetBaseAddresses(String virtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; --- End of inner exception stack trace ---&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)&lt;br /&gt;&amp;nbsp;Process Name: w3wp&lt;br /&gt;&amp;nbsp;Process ID: 708&lt;/font&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;font size="1"&gt;&lt;/font&gt;&lt;/i&gt;Followed by: &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;&lt;i&gt;Event Type:&amp;nbsp;&amp;nbsp; &amp;nbsp;Error&lt;br /&gt;Event Source:&amp;nbsp;&amp;nbsp; &amp;nbsp;System.ServiceModel 3.0.0.0&lt;br /&gt;Event Category:&amp;nbsp;&amp;nbsp; &amp;nbsp;WebHost &lt;br /&gt;Event ID:&amp;nbsp;&amp;nbsp; &amp;nbsp;3&lt;br /&gt;Date:&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;30/01/2008&lt;br /&gt;Time:&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;11:30:35&lt;br /&gt;User:&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;NT AUTHORITY\NETWORK SERVICE&lt;br /&gt;Computer:&amp;nbsp;&amp;nbsp; &amp;nbsp;ELGRECO&lt;br /&gt;Description:&lt;br /&gt;WebHost failed to process a request.&lt;br /&gt;&amp;nbsp;Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/49972132&lt;br /&gt;&amp;nbsp;Exception: System.ServiceModel.ServiceActivationException: The service &amp;#39;/demo2/services/memberservice.svc&amp;#39; cannot be activated due to an exception during compilation.&amp;nbsp; The exception message is: Value cannot be null.&lt;br /&gt;Parameter name: key. ---&amp;gt; System.ArgumentNullException: Value cannot be null.&lt;br /&gt;Parameter name: key&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue&amp;amp; value)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Activation.MetabaseSettingsIis.GetTransportSettings(String virtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Activation.MetabaseSettingsIis.GetAccessSslFlags(String virtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Activation.HttpHostedTransportConfiguration.GetBaseAddresses(String virtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Activation.HostedTransportConfigurationManager.InternalGetBaseAddresses(String virtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp; --- End of inner exception stack trace ---&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)&lt;br /&gt;&amp;nbsp;Process Name: w3wp&lt;br /&gt;&amp;nbsp;Process ID: 708&lt;/i&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;After a bit of searching I found the following post &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1150859&amp;amp;SiteID=1" target="_blank"&gt;http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1150859&amp;amp;SiteID=1&lt;/a&gt; which states that WCF hosted in a precompiled ASP.Net site requires the site to be updatable. So adding the &lt;b&gt;-u&lt;/b&gt; switch to our build scrip which calls &lt;b&gt;aspnet_compiler&lt;/b&gt; solved the problem.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://nimtug.org/aggbug.aspx?PostID=1688" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/.Net+3.5/default.aspx">.Net 3.5</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/WCF/default.aspx">WCF</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/ASP.NET/default.aspx">ASP.NET</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2008/01/30/wcf-required-precompiled-asp-net-site-to-be-updatable.aspx</feedburner:origLink></item><item><title>Cryptic error messges in WCF? </title><link>http://feedproxy.google.com/~r/DamienMcGivern/~3/ym6-juWDwJ8/cryptic-error-messges-in-wcf.aspx</link><pubDate>Mon, 14 Jan 2008 00:25:00 GMT</pubDate><guid isPermaLink="false">61b722dd-0c8a-41f4-a893-0fca5b7be9f7:1609</guid><dc:creator>Damien McGivern</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://nimtug.org/blogs/damien-mcgivern/rsscomments.aspx?PostID=1609</wfw:commentRss><comments>http://nimtug.org/blogs/damien-mcgivern/archive/2008/01/14/cryptic-error-messges-in-wcf.aspx#comments</comments><description>&lt;p&gt;I&amp;#39;ve recently started working with WCF on a project at work, I&amp;#39;ve read about it and played about with it but never got into any depth with it before now. So far it&amp;#39;s going well except for a few cryptic errors I was getting when running my unit tests for a patictular service. The error in was:&lt;/p&gt;
&lt;p&gt;&lt;font face="courier new,courier"&gt;Error&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; TestCase &amp;#39;CPD.Services.Test.CourseTest.Test10&amp;#39;&lt;br /&gt;failed: System.ServiceModel.CommunicationException : An error occurred while receiving the HTTP response to https://lap001.office.aurion.co.uk/cpdengage/Services/CourseService.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.&lt;br /&gt;&amp;nbsp; ----&amp;gt; System.Net.WebException : The underlying connection was closed: An unexpected error occurred on a receive.&lt;br /&gt;&amp;nbsp; ----&amp;gt; System.IO.IOException : Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.&lt;br /&gt;&amp;nbsp; ----&amp;gt; System.Net.Sockets.SocketException : An existing connection was forcibly closed by the remote host&lt;br /&gt;&lt;br /&gt;Server stack trace: &lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)&lt;br /&gt;&lt;br /&gt;Exception rethrown at [0]: &lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp;amp; msgData, Int32 type)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at CPD.Services.Test.CourseServiceReference.CourseService.GetCourseHeader()&lt;br /&gt;&amp;nbsp;&amp;nbsp; at CPD.Services.Test.CourseServiceReference.CourseServiceClient.GetCourseHeader() in c:\users\damien.mcgivern\documents\dev\aurion\cpdengage\src\cpd.services.test\service references\courseservicereference\reference.cs:line 1027&lt;br /&gt;&amp;nbsp;&amp;nbsp; at CPD.Services.Test.CourseTest.Test10() in C:\Users\damien.mcgivern\Documents\dev\aurion\cpdengage\src\CPD.Services.Test\CourseTest.cs:line 157&lt;br /&gt;--WebException&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Net.HttpWebRequest.GetResponse()&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)&lt;br /&gt;--IOException&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Net.TlsStream.Read(Byte[] buffer, Int32 offset, Int32 size)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)&lt;br /&gt;--SocketException&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)&amp;nbsp;&amp;nbsp;&amp;nbsp; c:\users\damien.mcgivern\documents\dev\aurion\cpdengage\src\cpd.services.test\service references\courseservicereference\reference.cs&amp;nbsp;&amp;nbsp;&amp;nbsp; 1027 &lt;/font&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It was the first method that used a generic collection and at first I thought this may be to fault but testing other generic collections proved that I was using them correctly (see &lt;a href="http://msdn2.microsoft.com/en-us/library/system.runtime.serialization.collectiondatacontractattribute.aspx" target="_blank"&gt;http://msdn2.microsoft.com/en-us/library/system.runtime.serialization.collectiondatacontractattribute.aspx&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;But just to make sure I wrote a test method that only returned the type that was being used for the generic collection items, and indeed it still failed with the same error.&lt;/p&gt;
&lt;p&gt;This got me thinking that I must have defined the DataContract or DataMember attributes for the object incorrectly, going through each of them I noticed the following code:&lt;/p&gt;
&lt;p&gt;&lt;font face="courier new,courier"&gt;[DataMember(IsRequired = true, EmitDefaultValue = false, Order = 5)]&lt;br /&gt;public bool IsEnabled&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The value for IsEnabled was always false in the test data, when I set this to true the error never happened and then changing the attributes IsRequired to false stopped the error altogether. Checking the code I found a few other value types that had IsRequired set to true these hadn&amp;#39;t and so far no more errors. So setting a value type DataMember to true will cause thie error if the value is the value types default value, bool = false, int = 0 etc.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;What bugs me is that this seems to be a serialisation issue, in that the object doesn&amp;#39;t match the requirements defined in the DataContract, however the error message doesn&amp;#39;t seem to indicate this at all.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Updated 24 June 2008: also see &lt;a href="http://msdn.microsoft.com/en-us/library/aa347792.aspx#Mtps_DropDownFilterText"&gt;http://msdn.microsoft.com/en-us/library/aa347792.aspx#Mtps_DropDownFilterText&lt;/a&gt;&amp;nbsp;- states that SerializationException is thrown. Although the exception details don&amp;#39;t make it down to the client.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://nimtug.org/aggbug.aspx?PostID=1609" width="1" height="1"&gt;</description><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/WCF/default.aspx">WCF</category><category domain="http://nimtug.org/blogs/damien-mcgivern/archive/tags/Debugging/default.aspx">Debugging</category><feedburner:origLink>http://nimtug.org/blogs/damien-mcgivern/archive/2008/01/14/cryptic-error-messges-in-wcf.aspx</feedburner:origLink></item></channel></rss>
