<?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:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Mister SQL</title>
	
	<link>http://suburbandestiny.com/Tech</link>
	<description>The other half of MS SQL</description>
	<pubDate>Thu, 22 Jul 2010 21:24:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MrSql" /><feedburner:info uri="mrsql" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Using unit testing principles to write better integration tests</title>
		<link>http://feedproxy.google.com/~r/MrSql/~3/QloQ6Ssd5yI/</link>
		<comments>http://suburbandestiny.com/Tech/?p=601#comments</comments>
		<pubDate>Thu, 22 Jul 2010 21:24:13 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[SQL Server]]></category>

		<category><![CDATA[Unit Tests]]></category>

		<guid isPermaLink="false">http://suburbandestiny.com/Tech/?p=601</guid>
		<description>My application is a database application. There is some logic that is easy to move into an application server where it is easy to do dependency inversion and unit testing.  That leaves untested all that code in the database, the stored procedures, triggers, tables and so on.
Compilation Tests. Sql Server allows for SET NOEXEC ON, which [...]</description>
			<content:encoded><![CDATA[<p>My application is a database application. There is some logic that is easy to move into an application server where it is easy to do dependency inversion and unit testing.  That leaves untested all that code in the database, the stored procedures, triggers, tables and so on.</p>
<p><strong>Compilation Tests.</strong> Sql Server allows for SET NOEXEC ON, which compiles and checks many things for a batch of SQL commands, but doesn&#8217;t execute of it.  I have integration tests that run almost all my data layer code with NOEXEC ON and it reveals malformed parameter lists and other issues that would normally only show at runtime.  The tests run very fast, do not change the state of the system, and they don&#8217;t interfere with each other.  There isn&#8217;t anything to assert except that no exception was thrown.</p>
<p><strong>Indempotent Tests.</strong> If your code has working transactions, then you create a root object (store), the child object (books in stock), etc as if the database was empty.  Then when you have enough objects to record a book sale, record the sale.  Assert something useful like numbers of rows affected, size of primary key etc.  Then roll it all back.</p>
<p>These tests can run fast, but might not depending on the particulars of the transaction.  For example, a stored procedure to calculate the payroll might be slow if the database has a 100,000 employees.  A good idempotent test will skip over any of these slow tests</p>
<p>Idempotent tests leave the database unchanged as long as your transaction code isn&#8217;t buggy.</p>
<p><strong>Additive Integration Tests. </strong>Additive tests look a lot like the idempotent tests, except they don&#8217;t roll back.  Read world database code fails on account of how the data looks just as often as it fails for how the code works.  Not all code failures should be fixed by writing more code.  If common sense is violated by a column containing nulls 1% of the time, then it isn&#8217;t possible to write code to do something other than fail when that column is null.  But we can&#8217;t discover that our code and our data aren&#8217;t in harmony unless we run this test.</p>
<p>A good additive test is mostly inserts and driven by existing, real or highly realistic data.  An example would be taking the entire inventory of books and re-adding them with slightly different names.  If a row that exists now can&#8217;t be inserted with existing code, then one of them is wrong.</p>
<p>Additive tests leave the database modified, but because the transactions are mostly inserts, tests aren&#8217;t likely to be competing for the same rows and tables.  If performance characteristics warrant it, consider running it in a transaction and rolling back.  Better databases can rollback large numbers of transactions rapidly, worse database will take huge amounts of time to rollback or hang the server.</p>
<p><strong>Destructive Integration Tests.</strong> Destructive tests operate on the existing data in a way to make it unsuable for other tests.  Destructive tests primarily do deletes and updates.  For example, if we imagine a test that looped through all books in inventory and recorded a sale, we might be able to discover some books fail to be sold when run through the sales code.  Either we have a code problem or a data problem and that is something we&#8217;d like to know.</p>
<p>At the end of the test, the database may be logically correct given the transactions you&#8217;ve run, but all the books have been sold, all the employees have been fired, all the book descriptions overwritten with lorem ipsum.  Like additive tests, these can be rolled back if your database can do so without performance problems.  Otherwise,  you will want to let these transactions commit and then restore the database from a backup.</p>
<p>Destructive tests are the least like unit tests and the most like the integration tests your unit test text book warned you about.</p>
<p>All of these proposed tests are, except the destructive ones, in my opinion, safe for putting in a build server nightly build.  Obviously none of these tests are safe for running on production and better integration testing is no substitute to refactoring, dependency inversion and writing true unit tests that are independent of the peculiarities of the persistent data store.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MrSql?a=QloQ6Ssd5yI:ZD2EWE-BYJM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MrSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MrSql?a=QloQ6Ssd5yI:ZD2EWE-BYJM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MrSql?i=QloQ6Ssd5yI:ZD2EWE-BYJM:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://suburbandestiny.com/Tech/?feed=rss2&amp;p=601</wfw:commentRss>
		<feedburner:origLink>http://suburbandestiny.com/Tech/?p=601</feedburner:origLink></item>
		<item>
		<title>MaxiVista and Visual Studio 2010 and my computers</title>
		<link>http://feedproxy.google.com/~r/MrSql/~3/ZCUMUYCt6_U/</link>
		<comments>http://suburbandestiny.com/Tech/?p=597#comments</comments>
		<pubDate>Fri, 16 Jul 2010 00:28:49 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[Matthew Martin]]></category>

		<guid isPermaLink="false">http://suburbandestiny.com/Tech/?p=597</guid>
		<description>I have Maxivista version 4.0.11 downloaded in December 2009.  It is different from the one downloaded in July 2010.  I don&amp;#8217;t know if that makes a difference.
The Dec 2009 version lets Visual Studio 2010 run on 2 monitors, but not 3.
The July 2010 version will not let Visual Studio run on 2 monitors&amp;#8211; you get [...]</description>
			<content:encoded><![CDATA[<p>I have Maxivista version 4.0.11 downloaded in December 2009.  It is different from the one downloaded in July 2010.  I don&#8217;t know if that makes a difference.</p>
<p>The Dec 2009 version lets Visual Studio 2010 run on 2 monitors, but not 3.</p>
<p>The July 2010 version will not let Visual Studio run on 2 monitors&#8211; you get constant flashing, disconnect-reconnect cycles (same as trying to take the Dec 2009 version to 3 monitors)</p>
<p>When rolling back, the old installer refused to run (claimed it was outdated) and you had to reset the system clock to get the install to complete.</p>
<p>Oh well.</p>
<p>The demo version is .12, but re-download seems to try to force you to get only the point version you originally bought, which is odd because the site seems to imply that you can get point updates for free within a major version.  I&#8217;m waiting for my phpBB credentials so I can ask on their support board.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MrSql?a=ZCUMUYCt6_U:2tGLlJUIiTo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MrSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MrSql?a=ZCUMUYCt6_U:2tGLlJUIiTo:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MrSql?i=ZCUMUYCt6_U:2tGLlJUIiTo:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://suburbandestiny.com/Tech/?feed=rss2&amp;p=597</wfw:commentRss>
		<feedburner:origLink>http://suburbandestiny.com/Tech/?p=597</feedburner:origLink></item>
		<item>
		<title>A build server for home</title>
		<link>http://feedproxy.google.com/~r/MrSql/~3/7MlgvN4dM98/</link>
		<comments>http://suburbandestiny.com/Tech/?p=594#comments</comments>
		<pubDate>Mon, 31 May 2010 20:49:59 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[Matthew Martin]]></category>

		<guid isPermaLink="false">http://suburbandestiny.com/Tech/?p=594</guid>
		<description>I&amp;#8217;ve got a WHS.  So I just finished installing:
Subversion vs VisualSVN.  Used AnkhSVN and checked in my code.  Installed WAMP. Found out that my windows home server for some reason had a PHP installation, so I had to update the environment variables to point to the WAMP installation.  I finally got VisualSVN to work with [...]</description>
			<content:encoded><![CDATA[<p>I&#8217;ve got a WHS.  So I just finished installing:</p>
<p><strong>Subversion vs VisualSVN</strong>.  Used AnkhSVN and checked in my code.  Installed WAMP. Found out that my windows home server for some reason had a PHP installation, so I had to update the environment variables to point to the WAMP installation.  I finally got VisualSVN to work with webSVN with windows auth.  It was tricky, required .conf file reading.  Using cygwin I got websvn working.</p>
<p><strong>TeamCity</strong>.  Didn&#8217;t have to install Visual Studio, but did have to copy C:\program files\MSBUILD files.  It took an hour but now my unit tests and code coverage tools are all running.</p>
<p><strong>Issue Tracker. </strong>Team City integrates with only 3 bugtrackers, of which only one is flat out free.  So I&#8217;ll be trying out Bugzilla, although several other bug trackers look more interesting.  Update: In frustruation, I gave up on Bugzilla because Perl is for people who enjoy configuration and installation pain and chewing on glass and poking their eyes with ballpoint pens.  I tried next the ruby and rails app &#8220;Warehouse&#8221;, but the @#$@#$ db scripts refused to run and I realized I didn&#8217;t have the patience to build my <a href="http://warehouseapp.com/installing/ruby-subversion-bindings">own inter-op doohicky for ruby to svn communication</a>.  So on to mantis and flyspray.  Superficially, they&#8217;re closely matched.  But mantis has plugins and flyspray is more familiar to me because I&#8217;ve used it many times before.  So much work just to find out that free tools for developers often come with a heck-of-a installation burden.</p>
<p><strong>Sharepoint homepage.</strong>  I&#8217;m still trying  to make WSS3.0 sharepoint useful.  So far only the link list is useful, but I may see about taking the RSS Feeds from everything above and creating a RSS reader in WSS3.0 to agregate my feeds which are essentially all intranet feeds.  If it frustrates me too much I&#8217;ll install a php base feed reader.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MrSql?a=7MlgvN4dM98:30Wv4lg-kIM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MrSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MrSql?a=7MlgvN4dM98:30Wv4lg-kIM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MrSql?i=7MlgvN4dM98:30Wv4lg-kIM:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://suburbandestiny.com/Tech/?feed=rss2&amp;p=594</wfw:commentRss>
		<feedburner:origLink>http://suburbandestiny.com/Tech/?p=594</feedburner:origLink></item>
		<item>
		<title>Stop! In the name of code!</title>
		<link>http://feedproxy.google.com/~r/MrSql/~3/6_cvPmrHxYU/</link>
		<comments>http://suburbandestiny.com/Tech/?p=591#comments</comments>
		<pubDate>Thu, 22 Apr 2010 19:11:39 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[Matthew Martin]]></category>

		<guid isPermaLink="false">http://suburbandestiny.com/Tech/?p=591</guid>
		<description>Stop! In the name of code
Before you break the build!
I&amp;#8217;m aware of where you go
Each time you check in code
I watch my rss feed of the daily build
Knowing your code turns green dots red
But this time before you run the build
Making us do more work
(Think it over) Have you done a unit test or two [...]</description>
			<content:encoded><![CDATA[<p>Stop! In the name of code</p>
<p>Before you break the build!<br />
I&#8217;m aware of where you go<br />
Each time you check in code<br />
I watch my rss feed of the daily build<br />
Knowing your code turns green dots red<br />
But this time before you run the build<br />
Making us do more work<br />
(Think it over) Have you done a unit test or two ?<br />
(Think it over) Is it refactored through ?</p>
<div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MrSql?a=6_cvPmrHxYU:6_AiPRCQ_-c:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MrSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MrSql?a=6_cvPmrHxYU:6_AiPRCQ_-c:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MrSql?i=6_cvPmrHxYU:6_AiPRCQ_-c:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://suburbandestiny.com/Tech/?feed=rss2&amp;p=591</wfw:commentRss>
		<feedburner:origLink>http://suburbandestiny.com/Tech/?p=591</feedburner:origLink></item>
		<item>
		<title>ASP.NET MAF plugable website working</title>
		<link>http://feedproxy.google.com/~r/MrSql/~3/LqOVv4-ZvFE/</link>
		<comments>http://suburbandestiny.com/Tech/?p=588#comments</comments>
		<pubDate>Sat, 14 Nov 2009 14:17:40 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[Matthew Martin]]></category>

		<category><![CDATA[System.AddIn]]></category>

		<guid isPermaLink="false">http://suburbandestiny.com/Tech/?p=588</guid>
		<description>The plug in needs a way to talk to the host app. In ASP.NET, this means things like updating the UI by adding controls, etc.  In fact, since in ASP.NET only creates pages, you will eventually have to talk to Page.  The host Page isn&amp;#8217;t serializable or remotable, so if your Contract has [...]</description>
			<content:encoded><![CDATA[<p>The plug in needs a way to talk to the host app. In ASP.NET, this means things like updating the UI by adding controls, etc.  In fact, since in ASP.NET only creates pages, you will eventually have to talk to Page.  The host Page isn&#8217;t serializable or remotable, so if your Contract has a Page, you won&#8217;t be able to create the Add in in a separate AppDomain, i.e. no sandboxing or other isolation, at least not directly.  Fortunately, we like to write code and can solve this by writing another layer of indirection.</p>
<p>What I tried next was creating a set of Page and Control wrappers and factory functions.  I called the add-in-side wrappers &#8220;Recipes&#8221; because they where recipes for building controls and recipes for building pages.  The new contracts no longer had references to System.Web since no WebForms types there seem to be remotabe. In the hosting application I wrote a &#8220;Page Automator&#8221;, whose job was to implement recipes recommended by the Add-In and to describe the page for the Add-In by looping through the controls, putting their current state into a wrapper and then providing it to the Add-In.</p>
<p>Finally, out-of-AppDomain Add-In activiation works.  And I was able to run the add in in minimal trust.  If you&#8217;ve ever tried to get a non-trivial website to run under medium trust, you know this is just incredible!  I gave up on medium trust because too many of my third party components didn&#8217;t play the medium trust way.  In a medium trust website, everything in the AppDomain (i.e. the entire website) must refrain from calling forbidden APIs. As soon as there is a single line of code that requires Full-Trust and if you can&#8217;t remove it or change it (because it is both necessary and 3rd party closed source), you have to bump the entire website up to Full Trust.  Unless you are using Add-Ins.</p>
<p>The plug in may need to communicate several things at once in the AddIn&#8217;s interface. System.AddIn makes this very, very hard.  I tried string[].  I tried List<T>.  I tried IListContract<T>. They all failed.  When I used IListContract<T>, the pipeline generator generated interfaces of type IList<T>, and then the addin finder stopped finding addins that supported the contract.  Humorously, string[] failed because System.AddIn said string[] wasn&#8217;t serializable. WTF? These are strings. I finally decided to use Control NextControl(); as a signature to return a collection one at a time.  I finally did get IListContract<T> to work, but the type of T needs to be remotable.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MrSql?a=LqOVv4-ZvFE:LZZEpzRD-BU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MrSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MrSql?a=LqOVv4-ZvFE:LZZEpzRD-BU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MrSql?i=LqOVv4-ZvFE:LZZEpzRD-BU:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://suburbandestiny.com/Tech/?feed=rss2&amp;p=588</wfw:commentRss>
		<feedburner:origLink>http://suburbandestiny.com/Tech/?p=588</feedburner:origLink></item>
		<item>
		<title>MAF, Plugin Architectures and the ASP.NET 3.5 website</title>
		<link>http://feedproxy.google.com/~r/MrSql/~3/rv1ExBRoOZA/</link>
		<comments>http://suburbandestiny.com/Tech/?p=585#comments</comments>
		<pubDate>Fri, 13 Nov 2009 15:56:31 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[Matthew Martin]]></category>

		<guid isPermaLink="false">http://suburbandestiny.com/Tech/?p=585</guid>
		<description>Plug ins allow developers to collaborate with zero co-ordination.  The host application provides extension points and another developer writes a module that the host application can use without re-compile.  A typical plug in architecture also includes:
- Activation. A way to enable and disable plug ins at runtime
- Discovery. Plug ins are registered by [...]</description>
			<content:encoded><![CDATA[<p>Plug ins allow developers to collaborate with zero co-ordination.  The host application provides extension points and another developer writes a module that the host application can use without re-compile.  A typical plug in architecture also includes:</p>
<p>- Activation. A way to enable and disable plug ins at runtime<br />
- Discovery. Plug ins are registered by scanning a directory for code artifacts.<br />
- Code artifacts that implement an expected interface are used by the host application<br />
- Plug ins are invoked with some sort of reflection<br />
- Plug ins might need to run with fewer security rights than host code.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/bb384241.aspx">MAF/System.AddIn</a> exists.<br />
MEF is on the way,but it looks like it will be fully baked in .NET 4.0, no sign if it will support 3.5. </p>
<p>MEF is getting much more attention on the blog and the web and I attribute that entirely to the MEF team promoting their work more than the MAF team.</p>
<p><strong>Benefits of MAF</strong><br />
Its a documented solution, that will always be better known and understood than any plug-in architecture you could throw together.<br />
It is available in release form *now* and doesn&#8217;t require 4.0. MEF is pre-release and will require upgrading to 4.0 when it is release. (I think)</p>
<p><strong>Challenges with MAF:</strong><br />
They team assumes you want version resilience.  This is the most expensive feature.  It achieves version resilience by adding 5 assemblies between your host and plug ins.  Without code generation, the extra five assemblies adds too much work.  </p>
<p>Also, when it comes time to write the V2 to V1 adapters, you will have to make ugly choices like, should the adapters throw errors or should they similate the new functionality. For example, in the calculator example where V1 supported adding and subtracting and V2 supported multiplication, you could have simulated multiplication by calling the V1 addition method in a loop to replicate multiplication.  This would be better backwards compatibility, but now you got some business logic in your ViewAdapters.  If you don&#8217;t put that logic there, then you will throw NotImplementedExceptions. Now how is a component backwards compatible if it throws runtime errors? (Well, admittedly the adapter lets the old plug in work as well as it used to just so long as you keep away from &#8220;new funcitonality&#8221; that arrived in V2)</p>
<p>They assume you need the extra security and reliability you get from loading plug ins in a sandbox.  This means MAF wants you to declare contracts with primative datatypes if you can.  Just like you can&#8217;t pass database connections or the HttpContext back and forth across a webservice, you aren&#8217;t supposed to do that in MAF (but you can, as long as you don&#8217;t load plug ins in a new AppDomain.)</p>
<p><strong>Plug in UI</strong>. Officially, you aren&#8217;t supposed to pass winforms controls across MAF contracts, ie only the host has UI.  WPF controls are supposed to be able to cross, ie. the plugin can have UI.  </p>
<p>In ASP.NET, my own experimentation shows you can have server controls in the plug in, but it is hard beyond being worth it to put a Page or UserControl in a plug in and then get it to render on an ASP.NET page.  This means that all ASP.NET plugins must mix code and UI more than I like.  Some of this can be mitigated by the host providing enough extension points that it wouldn&#8217;t matter.  For example, if a pluggable form page queried the plug in for the controls and used a host owned layout engine to layout the labels and input boxes, then the plug in writer wouldn&#8217;t have to mix too much presentation code and C#.</p>
<p><strong>How does MAF relate to other similar ASP.NET technologies?</strong><br />
ASP.NET already can cope with new pages and classes being added at run time with minimal effect on the running application.  A pattern I&#8217;ve seen is where V1 of the website is deployed, then when V2 is deployed, only the classes and pages that the developer thinks changed are copied into the V1 website.  This creates a blended version V1/V2 website.  If the contracts changed, e.g. a property of a webcontrol has a different data type, it is up to the developer to also track down the dependencies and deploy new versions of those too.  Because pages are compiled on first request, the developer may not learn about broken contracts until long after the code in in production.</p>
<p>WebParts lets chunks of code and UI get plugged into or removed from a page at runtime.  WebParts assume the webparts are being developed by the same team as the host, so the there isn&#8217;t necessarily any features for versioning, isolation or what have you.  As a component technology, WebParts is all about a specific type of UI widget, where AddIns is *anything*, including things like adding an Icelandic spell checker to your website. </p>
<p><strong>ASP.NET and process isolation.</strong><br />
ASP.NET and JSP and most other non CGI web technologies were created because spawning a new process for each request crushed server when they were under load.  A common MAF recommendation is to design for the possibility of running your Add Ins in a separate process.  But why would I want to constrain my design so that future developers will have the option of running a new process per page request and destroying the ability to support more than a few dozen concurrent requests?  I&#8217;m convinced that a MAF addin running in ASP.NET should not take advantage of process isolation.</p>
<p><strong>MAF and COM</strong><br />
It&#8217;s been noted that MAF has a lot of COM nostalgia. I think this is because MAF was created to solve the problems of creating Microsoft Office add ins.  Microsoft office is a COM application and as such will work best with a component technology that has a lot of parallels with COM.  This is a challenge for people like me because I never wrote C++ and don&#8217;t have an internal mental model of how COM works.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MrSql?a=rv1ExBRoOZA:hUmyuO8L0ZI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MrSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MrSql?a=rv1ExBRoOZA:hUmyuO8L0ZI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MrSql?i=rv1ExBRoOZA:hUmyuO8L0ZI:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://suburbandestiny.com/Tech/?feed=rss2&amp;p=585</wfw:commentRss>
		<feedburner:origLink>http://suburbandestiny.com/Tech/?p=585</feedburner:origLink></item>
		<item>
		<title>ASP.NET Profile Compilation- Mystery Solved!</title>
		<link>http://feedproxy.google.com/~r/MrSql/~3/w_3Aqj_5-38/</link>
		<comments>http://suburbandestiny.com/Tech/?p=579#comments</comments>
		<pubDate>Mon, 17 Aug 2009 18:41:19 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://suburbandestiny.com/Tech/?p=579</guid>
		<description>ASP.NET will kick off a little profile thingy when it finds a &amp;#60;property&amp;#62; section.  It appears to go into the ASP.NET Temporary Folder.  It seems to be a private method in ProfileBase that loads this. 
Some errors that happen:
Sometimes deleting the  &amp;#60;property&amp;#62; section and readding it works.  This happens all the [...]</description>
			<content:encoded><![CDATA[<p>ASP.NET will kick off a little profile thingy when it finds a &lt;property&gt; section.  It appears to go into the ASP.NET Temporary Folder.  It seems to be a private method in ProfileBase that loads this. </p>
<p>Some errors that happen:<br />
Sometimes deleting the  &lt;property&gt; section and readding it works.  This happens all the time for all sorts of reasons, not just profile related, but dynamic compilation and shadow assembly related.</p>
<p>ProfileCommon not available- this is supposed to be compiled either at design time, run time or sometime.  It fails to work in a variety of circumstances.</p>
<p>Precompiled apps can have problems with the ProfileBase class<br />
Ambiguous  reference errors-  can happen when App_Code.Compiled or PrecompiledApp.config exist or fail to exist and ProfileCommon gets compiled twice.<br />
Similarly copying the bin of the new version into the bin of the old is bad. You get a blended set of .dlls<br />
Deleting files in ASP.NET Temporary Files sometimes works.</p>
<p>Interestingly, all the above don&#8217;t seem to be addressable by writing a custom provider.  It doesn&#8217;t seem possible to override the settings part, where it reads web.config and starts trying to create that problematic ProfileCommon.</p>
<p><strong>Conclusion</strong><br />
It turned out to be a dll that was referencing a native dll that wasn&#8217;t on the PATH.  The profile was just triggering a compile.  The compile then check references for everything in the \bin\ folder, even if the profile or invoked page isn&#8217;t using it.  Oddly, this doesn&#8217;t happen on every single page, so there are some code paths where ASP.NET doesn&#8217;t feel the need to recompile every !@#$@!#$ thing in the world.  This, I suppose is good or else we&#8217;d see pathalogical compile churning.</p>
<p>I diagnosed this by watching the list of assemblies that were getting loaded in Visual Studio while the debugger was attached. If it couldn&#8217;t load symbols or if it was obviously a COM dll, I considered it a candidate and finally narrowed it down to a SMO library, which happens to have non-managed dependencies.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MrSql?a=w_3Aqj_5-38:hXP7G5iJAu8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MrSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MrSql?a=w_3Aqj_5-38:hXP7G5iJAu8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MrSql?i=w_3Aqj_5-38:hXP7G5iJAu8:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://suburbandestiny.com/Tech/?feed=rss2&amp;p=579</wfw:commentRss>
		<feedburner:origLink>http://suburbandestiny.com/Tech/?p=579</feedburner:origLink></item>
		<item>
		<title>You think you’re doing tier architecture or business objects, but its just super pipelines and ziggurats.</title>
		<link>http://feedproxy.google.com/~r/MrSql/~3/agkGlNr4FFw/</link>
		<comments>http://suburbandestiny.com/Tech/?p=576#comments</comments>
		<pubDate>Thu, 06 Aug 2009 16:35:56 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://suburbandestiny.com/Tech/?p=576</guid>
		<description>Superpiplining. Methods that call methods that call methods do not magically add value along the way.
If one tier is bad, two tiers is better, why not n tiers (or layers), I mean, literally an infinite number of tiers, each adding zero value along the way.  I call this patter &amp;#8220;Super Pipelining&amp;#8221;  Super pipelining [...]</description>
			<content:encoded><![CDATA[<p><strong>Superpiplining. Methods that call methods that call methods do not magically add value along the way.</strong></p>
<p>If one tier is bad, two tiers is better, why not n tiers (or layers), I mean, literally an infinite number of tiers, each adding zero value along the way.  I call this patter &#8220;Super Pipelining&#8221;  Super pipelining makes dependency tracing a pain.  A typial super-pipelined application will still put all authorization, validation, calculations in the UI and pass System.Data or SqlClient objects back and forth the super pipeline.</p>
<p><code><br />
class Customer() {<br />
  public void AddCustomer(Dto customer){     (new CustomerBusinessObject()).AddCustomer(); }<br />
}</p>
<p>class CustomerBusinessObject() {<br />
  public void AddCustomer(Dto customer){     (new CustomerBusinessLogicObject()).AddCustomer(); }<br />
}</p>
<p>class CustomerBusinessLogicObject() {<br />
  public void AddCustomer(Dto customer){     (new CustomerBusinessLogicDomainObject()).AddCustomer(); }<br />
}</p>
<p>class CustomerBusinessLogicDomainObject() {<br />
  public void AddCustomer(Dto customer){     (new CustomerBusinessLogicDomainScenarioDatabasePersistenceObject()).AddCustomer(); }<br />
}</p>
<p>class CustomerBusinessLogicDomainScenarioDatabasePersistenceObject() {<br />
  public void AddCustomer(Dto customer){     (new CustomerBusinessObject()).AddCustomer(); }<br />
}<br />
</code></p>
<p><strong>Ziggurat. </strong> A class that inherits from a class that inherits from a class that inherits from a class where the middle classes and the base don&#8217;t do anything.  The classes in the middle do not magically make your code better.</p>
<p><code><br />
class BusinessObject: BaseObject {}<br />
class BaseObject: BasementObject{}<br />
class BasementObject: UndergroundObject{}<br />
class UndergroundObject: UbberBasementObject{}<br />
class UbberBasementObject: SuperDuperBasementObject{}<br />
class SuperDuperBasementObject: AceOfBaseObject{}<br />
class AceOfBaseObject: China{}<br />
</code></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MrSql?a=agkGlNr4FFw:Jtnsp8kmqaM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MrSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MrSql?a=agkGlNr4FFw:Jtnsp8kmqaM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MrSql?i=agkGlNr4FFw:Jtnsp8kmqaM:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://suburbandestiny.com/Tech/?feed=rss2&amp;p=576</wfw:commentRss>
		<feedburner:origLink>http://suburbandestiny.com/Tech/?p=576</feedburner:origLink></item>
		<item>
		<title>System.TypeLoadException: Method ‘CreateObject’ in type ‘Microsoft.Practices.EnterpriseLibrary.Validation.Instrumentation.ValidationInstrumentationListenerCustomFactory’ from assembly ‘Microsoft.Practices.EnterpriseLibrary.Validation, Version=3.1.0.0, Culture=neutral, PublicKeyToken=21a151ab59c9591d’ does not have an implementation.</title>
		<link>http://feedproxy.google.com/~r/MrSql/~3/CZedQkDqot0/</link>
		<comments>http://suburbandestiny.com/Tech/?p=574#comments</comments>
		<pubDate>Sat, 01 Aug 2009 12:50:18 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[Matthew Martin]]></category>

		<guid isPermaLink="false">http://suburbandestiny.com/Tech/?p=574</guid>
		<description>I got the following error when using Enterprise Library 3.1. It mean it can&amp;#8217;t find the reference to ObjectBuilder or it is resolving to the wrong version in GAC.  So to use VAB, you need Common, ObjectBuilder and the VAB assembly. If not that then check this link.
System.TypeLoadException: Method &amp;#8216;CreateObject&amp;#8217; in type &amp;#8216;Microsoft.Practices.EnterpriseLibrary.Validation.Instrumentation.ValidationInstrumentationListenerCustomFactory&amp;#8217; from [...]</description>
			<content:encoded><![CDATA[<p>I got the following error when using Enterprise Library 3.1. It mean it can&#8217;t find the reference to ObjectBuilder or it is resolving to the wrong version in GAC.  So to use VAB, you need Common, ObjectBuilder and the VAB assembly. If not that then <a href="http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx">check this link</a>.</p>
<p>System.TypeLoadException: Method &#8216;CreateObject&#8217; in type &#8216;Microsoft.Practices.EnterpriseLibrary.Validation.Instrumentation.ValidationInstrumentationListenerCustomFactory&#8217; from assembly &#8216;Microsoft.Practices.EnterpriseLibrary.Validation, Version=3.1.0.0, Culture=neutral, PublicKeyToken=21a151ab59c9591d&#8217; does not have an implementation.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MrSql?a=CZedQkDqot0:c7JKICuNAKI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MrSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MrSql?a=CZedQkDqot0:c7JKICuNAKI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MrSql?i=CZedQkDqot0:c7JKICuNAKI:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://suburbandestiny.com/Tech/?feed=rss2&amp;p=574</wfw:commentRss>
		<feedburner:origLink>http://suburbandestiny.com/Tech/?p=574</feedburner:origLink></item>
		<item>
		<title>Troubleshooting “Service ‘Astoria’ implements multiple ServiceContract types, and no endpoints are defined in the configuration file.”</title>
		<link>http://feedproxy.google.com/~r/MrSql/~3/NIpQh8gs_tg/</link>
		<comments>http://suburbandestiny.com/Tech/?p=568#comments</comments>
		<pubDate>Mon, 27 Jul 2009 00:44:26 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[ADO.NET]]></category>

		<category><![CDATA[ADO.NET Data Services]]></category>

		<category><![CDATA[Astoria]]></category>

		<guid isPermaLink="false">http://suburbandestiny.com/Tech/?p=568</guid>
		<description>This is a misleading error that means you forgot to put the connection string into web.config.
So if you get:


WebHost failed to process a request.
 Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/63432468
 Exception: System.ServiceModel.ServiceActivationException: The service '/Services/Astoria.svc' cannot be activated due to an exception during compilation.  The exception message is: Service 'Astoria' implements multiple ServiceContract types, and no endpoints [...]</description>
			<content:encoded><![CDATA[<p>This is a misleading error that means you forgot to put the connection string into web.config.</p>
<p>So if you get:</p>
<blockquote><p>
<code><br />
WebHost failed to process a request.<br />
 Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/63432468<br />
 Exception: System.ServiceModel.ServiceActivationException: The service '/Services/Astoria.svc' cannot be activated due to an exception during compilation.  The exception message is: Service 'Astoria' implements multiple ServiceContract types, and no endpoints are defined in the configuration file. WebServiceHost can set up default endpoints, but only if the service implements only a single ServiceContract. Either change the service to only implement a single ServiceContract, or else define endpoints for the service explicitly in the configuration file.. ---> System.InvalidOperationException: Service 'Astoria' implements multiple ServiceContract types, and no endpoints are defined in the configuration file. WebServiceHost can set up default endpoints, but only if the service implements only a single ServiceContract. Either change the service to only implement a single ServiceContract, or else define endpoints for the service explicitly in the configuration file.<br />
   at System.ServiceModel.Web.WebServiceHost.AddAutomaticWebHttpBindingEndpoints(ServiceHost host, IDictionary`2 implementedContracts, String multipleContractsErrorMessage)<br />
   at System.ServiceModel.Web.WebServiceHost.OnOpening()<br />
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)<br />
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)<br />
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)<br />
   --- End of inner exception stack trace ---<br />
   at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)<br />
   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)<br />
 Process Name: WebDev.WebServer<br />
 Process ID: 8168<br />
</code>
</p></blockquote>
<p>This is what a connection string for an entity data model looks like. If you created your edmx file in a different project from your .svc file, you will need to manually copy the connection string.  In this case I&#8217;m using Sqlite (which can&#8217;t be design using Visual Studio Express, in case you were wondering)</p>
<p><code><br />
&lt;connectionStrings&gt;<br />
    &lt;add name="calendarEm" connectionString="metadata=res://*/CalendarV1.csdl|res://*/CalendarV1.ssdl|res://*/CalendarV1.msl;provider=System.Data.SQLite;provider connection string=&quot;data source=C:\code\CommunityCalendar\Calendar\App_Data\calendar.db3;useutf16encoding=True&quot;" providerName="System.Data.EntityClient" /&gt;<br />
    &lt;/connectionStrings&gt;<br />
</code></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MrSql?a=NIpQh8gs_tg:LwaVyNyO_J4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MrSql?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MrSql?a=NIpQh8gs_tg:LwaVyNyO_J4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MrSql?i=NIpQh8gs_tg:LwaVyNyO_J4:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://suburbandestiny.com/Tech/?feed=rss2&amp;p=568</wfw:commentRss>
		<feedburner:origLink>http://suburbandestiny.com/Tech/?p=568</feedburner:origLink></item>
	</channel>
</rss>
