<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8211114181061311464</id><updated>2011-12-15T15:25:51.157-06:00</updated><category term='abstract base class'/><category term='datacontext vs. itemssource'/><category term='WCF transport security with basic authentication'/><category term='resgen'/><category term='dll'/><category term='Business logic framework'/><category term='duplex communication'/><category term='Silverlight debugging problem'/><category term='Expression Blend'/><category term='Navigation'/><category term='derived UserControls'/><category term='MSTest'/><category term='indexed views'/><category term='nunit'/><category term='RIA'/><category term='datacontext'/><category term='f#'/><category term='graphic design'/><category term='popup mousedragelementbehavior'/><category term='blend 4'/><category term='ole db'/><category term='c++'/><category term='breakpoints'/><category term='story'/><category term='ToString()'/><category term='visual source safe remote access'/><category term='Expression Suite'/><category term='GoDaddy'/><category term='&quot;Cannot create instance of&quot;'/><category term='datacontracts'/><category term='security'/><category term='NoSql'/><category term='TFS'/><category term='MDC'/><category term='Silverlight 4'/><category term='deployment'/><category term='best practices'/><category term='cross-domain policy'/><category term='rants'/><category term='team project names with spaces'/><category term='Expression Blend 2'/><category term='constructors'/><category term='xbap'/><category term='native'/><category term='vs 2008'/><category term='unmanaged'/><category term='alexandria'/><category term='WCF'/><category term='TreeView'/><category term='namespace resolution'/><category term='IE8'/><category term='FAILBOAT'/><category term='databound tooltip'/><category term='Silverlight controls'/><category term='Dynamically Loaded Font'/><category term='Toolkit'/><category term='Common Table Expressions'/><category term='AutoCompleteBox'/><category term='gotcha'/><category term='model-view-viewmodel'/><category term='Silverlight 2 DataGrid FontSource'/><category term='Silverlight'/><category term='SourceOffSite'/><title type='text'>AnyeDotNet</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>44</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-4200207987004422890</id><published>2011-12-15T15:03:00.001-06:00</published><updated>2011-12-15T15:05:06.232-06:00</updated><title type='text'>Silverlight 5 supported til 2021?  Not exactly...</title><content type='html'>Today an enthusiastic soul posted a link to the MS Support website, proclaiming that Silverlight isn't dead because MS is going to support Silverlight 5 til 2021.&lt;br /&gt;Sounds good? You might want to think about this in more detail.&lt;br /&gt;&lt;br /&gt;If you look carefully at the site linked below and read the fine print rather than just the pretty chart, the site actually says 2021 or&lt;span style="font-style:italic;"&gt; the support lifecycle of each of the supported browsers, &lt;span style="font-weight:bold;"&gt;whichever is shorter&lt;/span&gt;&lt;/span&gt;. (Emphasis mine) When IE 9 is no longer supported you can pretty much consider Silverlight unsupported as well. I doubt IE9 will still be supported in 2021, but I suppose I have been wrong before.&lt;br /&gt;&lt;br /&gt;After reading about the Windows 8 changes, metro mode vs. desktop mode and ne'er the twain shall meet, and so little information given at Build for what their plans are for LOB technologies (that may not need tablet support), I am of the opinion that MS is no longer interested in new development of technologies to support LOB apps, and they want to throw all their eggs into competition with iPad. Oh sure, they want you to still use their existing technologies to build LOB apps but I doubt we'll see too much innovation from them in these areas in future. They see Apple making money hand over fist selling apps through the app store, and they want to replicate this business model, even if it is to the detriment of their relationship with the business development community, because your average Joe will spend $2.99 for a small tablet app without even thinking about it, multiple that by a whole lot of average Joe's and the piece of the pie that MS will get out of it (since there is literally NO OTHER WAY to get apps for a Metro tablet besides the app store) and that is a recipe for a lot of income with relatively little expense to MS aside from the logistics of managing app store certification requirements and the store itself.&lt;br /&gt;&lt;br /&gt;I see why they are doing it, I can't necessarily fault them for wanting to try, though I think they will have a harder time ousting iPad from the #1 spot than they believe they will, as there is the catch-22 of needing market share for developers to spend resources building Metro apps for the platform and needing apps for consumers to choose Metro over iPad. MS really needs to find a way to incentivize people to develop for Metro pre-launch so that out the door they have sufficient app volume to be attractive to consumers, because without apps, a Metro tablet is not particularly attractive.&lt;br /&gt;&lt;br /&gt;Source:&lt;a href=" http://support.microsoft.com/lifecycle/?LN=en-us&amp;x=10&amp;y=12&amp;c2=12905"&gt;http://support.microsoft.com/lifecycle/?LN=en-us&amp;x=10&amp;y=12&amp;c2=12905&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-4200207987004422890?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/4200207987004422890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=4200207987004422890' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4200207987004422890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4200207987004422890'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2011/12/silverlight-5-supported-til-2021-not.html' title='Silverlight 5 supported til 2021?  Not exactly...'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-322414786343112819</id><published>2011-09-16T16:52:00.003-05:00</published><updated>2011-12-15T15:25:51.168-06:00</updated><title type='text'>Windows 8 &amp; 'death of Silverlight'</title><content type='html'>Lots of discussion of WTF is going on at Microsoft with the development platforms.  BUILD didn't answer all that many more questions than it created, leading to lots of posts that "Silverlight (and flash) are dead!"&lt;br /&gt;&lt;br /&gt;A friend of mine at MS forwarded me to this link: http://tirania.org/blog/archive/2011/Sep-15.html  which "demystifies WinRT", the new dev platform discussed at Build.  You should read it thoroughly and not rely on my summary alone.&lt;br /&gt;&lt;br /&gt;From reading this article it sounds like in reality Silverlight / WPF are evolving into a new XAML based UI development platform, which, like Silverlight, only contains exposure to a subset of the functionality that .NET developers are used to.  For "security", there is ostensibly no access to file system I/O or sockets.&lt;br /&gt;&lt;br /&gt;But wait... there are legitimate reasons that an application may need to access the file system.  Is this restriction only on the client machine for the browser application itself, or for server development as well.  For example, my Silverlight application today talks to a WCF service that grabs documents off a file share and streams them to the client.  I don't see how this would be possible if the WCF service couldn't talk to the file share.  So, does "full" .NET remain available the WCF environment or does all appdev have to go through this sanitized WinRT stuff?  But, this article doesn't really discuss server-side development at all.  Maybe .NET will still exist as-is for non-web applications?  Or something completely different?  I can't see how they could disallow a windows application or a service from filesystem IO.  &lt;br /&gt;&lt;br /&gt;Honestly, I'm concerned about what the printing capability will be with this Metro / WinRT platform.  One of the big problems we had with Silverlight was that it's printing support was insufficient for LOB application needs, where a user does NOT want to click the print button on every single page, but wants to spool a bunch of docs to their printer at once.  We had to embed a WPF application (which runs in full trust) in our application to handle this kind of printing.  I am guessing from their "security" concerns that we won't get this kind of support with WinRT either.&lt;br /&gt;&lt;br /&gt;All in all, I am still rather concerned about the future of MS development and what will be available to meet our needs, both in the short term (why start a new project in Silverlight when you know it's going to be deprecated) and in the long term.&lt;br /&gt;&lt;br /&gt;Edited to add:  I have since learned a bit more and WinRT as a platform only affects Metro mode for Windows 8.  Realistically speaking, Metro mode has so many limitations that only tablet users would ever choose to use it.  Additionally WinRT is for building Windows apps for the Metro mode -- not apps to run in the Metro browser, which is just IE with no plugin support whatsoever.  &lt;br /&gt;&lt;br /&gt;So, I have become much more pessimistic.  See my next post for more detail.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-322414786343112819?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/322414786343112819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=322414786343112819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/322414786343112819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/322414786343112819'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2011/09/windows-8-death-of-silverlight.html' title='Windows 8 &amp; &apos;death of Silverlight&apos;'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-7157117468503862319</id><published>2011-09-01T08:56:00.003-05:00</published><updated>2011-09-01T09:02:12.194-05:00</updated><title type='text'>It'll be the future soon</title><content type='html'>The last few months have had lots of hubbub about the future of .NET and Microsoft development.  I myself have spent a lot of time trying to decide what platform to recommend we build our next major project in.  For the most part I really like Silverlight, however we have had a few technical challenges in our problem space that have given us grief, so there is pressure from some channels to go a different way next time.  &lt;br /&gt;&lt;br /&gt;It sure would be helpful if MS would give some clear answers on what is coming.  Articles like http://arstechnica.com/microsoft/news/2011/06/windows-8-for-software-developers-the-longhorn-dream-reborn.ars/1 are somewhat reassuring but not exactly official.  I can't start a major project that will become the bread and butter of the company for the next several years based on rumors.&lt;br /&gt;&lt;br /&gt;Supposedly we will get answers soon.  I hope so.&lt;br /&gt;&lt;br /&gt;On a totally unrelated topic, I want to give a shout out to Roy Osherove for his "Art of Unit Testing" book.  It has really helped our team a lot.  If you are in need of a primer on how to design for test, refactor existing code, etc. this book is a great start.  http://artofunittesting.com/   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-7157117468503862319?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/7157117468503862319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=7157117468503862319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/7157117468503862319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/7157117468503862319'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2011/09/itll-be-future-soon.html' title='It&apos;ll be the future soon'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-4651558385217270972</id><published>2011-06-08T09:22:00.005-05:00</published><updated>2011-06-08T11:31:25.984-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='team project names with spaces'/><category scheme='http://www.blogger.com/atom/ns#' term='TFS'/><category scheme='http://www.blogger.com/atom/ns#' term='gotcha'/><title type='text'>Team Foundation Server gotcha - team project collection names</title><content type='html'>I will write some big long diatribe about my painful experiences setting up TFS (literally painful -- I went from only getting headaches once every couple months or so to every night for a week) but here is a quickie.&lt;br /&gt;&lt;br /&gt;DO NOT put spaces in the names of your team project, your build definitions, or pretty much anything else.  A lot of features you're going to want to put in are reliant on xcopy and xcopy chokes on spaces in the names.  (Sometimes you can write the xcopy statement yourselves but othertimes it is done in the back end for you - and you won't be able to manually kludge it with quotes or anything).&lt;br /&gt;&lt;br /&gt;And guess what?  You can't rename a team project.  So after you spent weeks getting it configured only to find that because someone put a space in the name, you can't get your build configured properly, you get to attempt to migrate it again.&lt;br /&gt;&lt;br /&gt;I am not happy.&lt;br /&gt;&lt;br /&gt;Edited to add -- thanks to a coworker I did find a workaround for my problem, there is a CopyDirectory workflow item that can be used instead of xcopy.  I modified the ClickOnce publish template to use the CopyDirectory item instead and was able to get it to work.  This was much better than a migration.  OK, so I overreacted above.  I do occasionally have a tendency to do that ;)&lt;br /&gt;&lt;br /&gt;I am not sure that I can smoothly integrate this in every location that I am currently using xcopy - ie. command line post build events for individual projects in the solution, but at least those are not reliant on the team project name itself but on the folder structure (which I had already modified to use spaces).&lt;br /&gt;&lt;br /&gt;In happier news - I give a hearty thanks and kudos to Brian Gansemer, who wrote a terrific tutorial on how to integrate ClickOnce with TFS here:&lt;br /&gt;http://blog.dontpaniclabs.com/post/2011/04/29/ClickOnce-Publish-and-Deploy-from-Team-Foundation-Server-2010.aspx&lt;br /&gt;&lt;br /&gt;Not only that, he was very quick to help me when I got stuck (even though it turned out to be an xcopy problem and not in any way his fault).  I am very appreciative!&lt;br /&gt;&lt;br /&gt;If you use this tutorial and you have spaces in your team project name:  the fix is to replace the "Copy Published Folder" work item with a "Copy Directory" work item in the DontPanicWithClickOncePublishBuild.xaml template.  I think blogger will bomb if I attempt to put the xaml in here, but that thought should get you started (it wasn't difficult to do once Duncan suggested to try that workitem).&lt;br /&gt;&lt;br /&gt;ETA again - the template above also defaults the application version to 1.0 --&gt; there are two workitems in the template that say Run MSBuild for project and Run MSBuild to publish. Both of these have a CommandLineArguments property that contains in it the application version where you can change this to whatever you need (in my case, 4.4).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-4651558385217270972?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/4651558385217270972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=4651558385217270972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4651558385217270972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4651558385217270972'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2011/06/team-foundation-server-gotcha-team.html' title='Team Foundation Server gotcha - team project collection names'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-4230485666835194642</id><published>2011-05-09T12:35:00.000-05:00</published><updated>2011-05-09T12:36:58.615-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xbap'/><category scheme='http://www.blogger.com/atom/ns#' term='deployment'/><category scheme='http://www.blogger.com/atom/ns#' term='gotcha'/><title type='text'>Gotcha - XBAP deployment updates for the client</title><content type='html'>We had another "gotcha" scenario happen recently that was hard to troubleshoot via the blogosphere so that is always my cue to add a post-mortem here.&lt;br /&gt;&lt;br /&gt;Background - we have a Silverlight 4 application hosted in ASP.NET.  We recently added functionality that required a bit more than Silverlight could give us so we created a WPF XBAP application that would be called by an ASP.NET page in the application in response to a Silverlight command to open that ASP.NET page.&lt;br /&gt;&lt;br /&gt;The issue we were having was regarding keeping the XBAP in sync with the latest version.  We were building and deploying new versions of the Silverlight, ASP.NET and XBAP but the XBAP was not being updated on the client machine - the first version installed would stay there despite new deployments to the server.&lt;br /&gt;&lt;br /&gt;For most of our application, we are using auto-incrementing version #s as set in the AssemblyInfo.cs file in the project subdirectory.  Doing this for the XBAP project results in having an autoincrementing version # when you right click on the XBAP's exe installer file and show "properties" - but this is not the version # that is used to determine whether your xbap is out of date.&lt;br /&gt;&lt;br /&gt;We had the XBAP project in the same solution as the web + Silverlight projects, that in itself isn't a problem.  However our normal process of "rebuild all, publish website" was insufficient to handle XBAP versioning.  The following steps had to be taken to ensure a proper update.&lt;br /&gt;&lt;br /&gt;1)  In the XBAP project properties, check the "autoincrement version" option (and optionally set it to a base #, ex. 4.3.0.0, to start from).&lt;br /&gt;&lt;br /&gt;2) Actively PUBLISH the XBAP, not just build it.  Note that the publish wizard will want to know where the user is going to be getting the file from (i.e. a URL).  I am honestly not sure why it is asking for this, because it doesn't seem to matter what you put in there.  I put in a nonsense URL, since we were going to be deploying this to first a QA server, then a staging server, and then eventually production -- and I sure as heck didn't want to have to republish each time!  Luckily, the only consequences I could see to putting nonsense in this field are a warning message during compilation -- it did not affect the actual build or publication adversely.&lt;br /&gt;&lt;br /&gt;Note - Steps 1 &amp; 2 will result in a new subdirectory for the explicit version # being created that hosts the installer files for the xbap.  For example, if you specified to publish to c:\\someproject, it would put the XBAP in c:\\someproject, and then create the following folder:&lt;br /&gt;c:\\someproject\\application files\\MyProjectName_MyVersionNumber&lt;br /&gt;And put the installer exe, manifest etc. here.&lt;br /&gt;&lt;br /&gt;As a result, unless you do something drastic, you're going to get a new folder every time you publish.  Lucky you!&lt;br /&gt;&lt;br /&gt;3) Publish the website&lt;br /&gt;&lt;br /&gt;If you follow these steps you will notice that publishing the website copies ALL contents under c:\\someproject.&lt;br /&gt;&lt;br /&gt;So, if you don't do some cleanup, you will have more and more folders being copied during each website publish.  That's annoying and wasteful.  So, I wanted an automatic way to remove these folders when I don't need them anymore.  &lt;br /&gt;&lt;br /&gt;I did a nice google search for "windows script delete folders" and found a nice little vbscript that removes all the folders in a subdirectory.  I then added a pre-compile event* to remove all the folders in the c:\\someproject\\application files directory.&lt;br /&gt;&lt;br /&gt;Interestingly enough this worked great in XP but when I deployed this to our Windows 2003 server, it started erroring out during the publish of the XBAP.  I noticed that the script was removing the Application Files subfolder itself.  Since technically the script was running twice - once during the 'rebuild all' and once during the 'publish xbap' step -- it was choking trying to delete a non-existant folder the second time.  Again, only on the server - I didn't get any errors on my dev machine for non-existant folders.&lt;br /&gt;&lt;br /&gt;So, I added another pre-compile event to re-add the Application Files subdirectory after deleting the folders inside it.  It would have been more elegant to modify the VBScript, but that would have taken more time that just wasn't necessary.&lt;br /&gt;&lt;br /&gt;Now, when I publish, only the latest xbap directory is there so only this one gets copied.&lt;br /&gt;&lt;br /&gt;4) One more cleanup task needed (this technically goes earlier in the list, but I want to keep all my thoughts coherent).  When you install an xbap, it puts it in your Application Cache.  When you install a new version of an xbap, it makes a new folder for that new version but does not clean up the old versions.  BAD XBAP!  On your development machine is where this is going to be the biggest issue, because you're having to publish it constantly when troubleshooting, although it is also an issue on your end user's machines (though hopefully they only will get a handful of versions instead of hundreds).&lt;br /&gt;&lt;br /&gt;On your machine, it is simple to clean these out again - again, with a pre-compile event.  You need to use the mage command to do this, which is part of the .NET framework.  I wish I knew of a way of running this command on an end user's machine without them having to do it themselves, so I could clean up old xbap versions from their cache.  If anyone has a way of doing this, I would love to hear it because I'm not fond of leaving detritus on my users' machines when I can avoid it.&lt;br /&gt;&lt;br /&gt;The precompile command to use to remove xbaps from your application cache is:  &lt;br /&gt;"C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\Mage.exe" -cc&lt;br /&gt;&lt;br /&gt;*And for newer programmers who don't know what I'm talking about when I talk about precompile events, in VS 2010 you can go to your project file in the Solution Explorer, right click on the name and select "Properties", go to the Build Events tab, and add command line text to the Pre-build command event line box.&lt;br /&gt;&lt;br /&gt;Hope this saves someone some time down the road!  Please let me know if I do, it gives me the warm fuzzies!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-4230485666835194642?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/4230485666835194642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=4230485666835194642' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4230485666835194642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4230485666835194642'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2011/05/gotcha-xbap-deployment-updates-for.html' title='Gotcha - XBAP deployment updates for the client'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-25065510787390451</id><published>2011-05-04T14:35:00.005-05:00</published><updated>2011-05-04T16:26:20.806-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RIA'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='MSTest'/><category scheme='http://www.blogger.com/atom/ns#' term='nunit'/><title type='text'>Polls for the Peanut Gallery</title><content type='html'>Gosh, it's been awhile since I posted.  Sorry about that.  We've been really busy with the last couple releases and a push into new territory, aka Scrum.  I've been putting together coding standards and best practices for the team, doing research into test driven development and unit testing for Silverlight and non-Silverlight .NET along with all my normal development stuff, buying a house, moving into it, doing renovations and keeping the family fed.  Busy busy!&lt;br /&gt;&lt;br /&gt;If anyone is reading this (and hopefully someone is), I am curious about a couple things.&lt;br /&gt;&lt;br /&gt;Question 1)  For those of you using Silverlight - do you find RIA Services useful?  And if so, are you using it for business applications or for fun stuff?  &lt;br /&gt;&lt;br /&gt;My reason for asking is, I've found it next to useless for anything except small personal projects, and a royal pain to troubleshoot in general.  Updating the database schema as it grows doesn't seem to successfully translate into updating the domain service class effectively, the metadata goes missing, you name it, I've probably seen an error for it.  I am just having a lot of trouble finding the value-add here - RIA Services automates so much of the manual process, but if it doesn't work you spend more time trying to figure it out than you would have to just written a service and a data access class yourself.  And, Linq-to-Entities isn't exactly known for its speed.&lt;br /&gt;&lt;br /&gt;The other beef I have with RIA Services (and other obscure-all-the-details frameworks) is that people become so dependent on them they cannot perform tasks any other way, fail to understand the underlying technologies and then they try to shoehorn any business problem to work with these kinds of solutions - even when they just don't make sense.  Technology is supposed to make a task easier, not harder, and if it is a nightmare getting a particular technology to work with your business problem it might not be the right solution.&lt;br /&gt;&lt;br /&gt;If you do find RIA useful, for business apps, do you have any recommended resources for troubleshooting / best practices / a really good example implementation etc?  The samples I have downloaded seem to be of variable working quality and there are surprisingly few useful posts for the various errors I have been encountering in the general googlesphere.&lt;br /&gt;&lt;br /&gt;Question 2)  For those of you doing test-driven development, what framework(s) are you using for your unit tests?  I've been doing a lot of research because I was hoping to find a one-size-fits-all solution between Silverlight and the regular .NET (which I don't think is going to happen) and then trying to decide between all the tradeoffs between nUnit, MSTest, and ??? (xUnit, etc.)  Trying to get other people in my organization to engage on the topic has been like trying to move a dead blue whale off your lawn with nothing but a plastic straw.  I see big pros and cons to both nUnit and MSTest (robust assertion libraries in nUnit vs. tight integration with VS and TFS + datadriven testing capability for MSTest, plus more) but have yet to put my foot down and say "We're using this, come what may."&lt;br /&gt;&lt;br /&gt;Anyway, I am really excited at having the opportunity to institute some best practices within our team.  The move to Scrum is a great excuse to overhaul all sorts of things that I'd not previously been successful at convincing TPTB were important enough for action when compared to pressing customer issues.  I am sure it is going to be a rocky transition but I think in the end it will be well worth the growing pains.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-25065510787390451?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/25065510787390451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=25065510787390451' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/25065510787390451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/25065510787390451'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2011/05/polls-for-peanut-gallery.html' title='Polls for the Peanut Gallery'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-3800494823476893871</id><published>2010-09-23T11:19:00.002-05:00</published><updated>2010-09-23T11:26:35.017-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='blend 4'/><category scheme='http://www.blogger.com/atom/ns#' term='namespace resolution'/><title type='text'>Gotcha!  Blend 4 &amp; namespaces</title><content type='html'>When we first upgraded from Silverlight 3 to Silverlight 4 (and thus Blend 3 to Blend 4) we started noticing some issues in Blend we'd never seen before.  Any template we created that contained a ValueConverter reference would not render and would show "invalid xaml".  Additionally, none of the templates that contained one of our self-contained xaml "image" canvases we used for icons would render either.&lt;br /&gt;&lt;br /&gt;After a lot of pain and anguish I figured out the issue.&lt;br /&gt;&lt;br /&gt;Basically, in Blend 4, namespaces are resolved purely based on folder structure, NOT by what namespace they are actually in.  Blend 3 resolved based on the actual namespace.&lt;br /&gt;&lt;br /&gt;When we first started working on this project we didn't have the same level of organization that we eventually came up with.  We made a Common folder for some class files (including the ValueConverters) and an Images folder for our xaml image canvases and then moved the files into these folders from the root where they had been originally created.  We did not change the namespace when we did this.&lt;br /&gt;&lt;br /&gt;Thus, in Blend 3, which resolved namespaces based on, well, reality -- there was no problem locating the files.  In Blend 4, which relies on the folder structure -- the files could not be found because it was insisting that if the file was in the Root/Common folder it MUST be in the Root.Common namespace.  When I changed the namespace of the file to match the folder structure and changed the references in Blend to point to the new namespace, the files were resolved and the Blend errors went away.&lt;br /&gt;&lt;br /&gt;People creating new projects in a pre-determined folder structure won't have this issue because when you create the file in the Root.Common folder it automatically puts it in the Root.Common namespace -- but this is a big gotcha for people reorganizing existing projects. And, since the code actually works fine when you compile and run it -- it's not immediately apparent until you try to use Blend that you've created a problem just by moving the file to a subfolder.&lt;br /&gt;&lt;br /&gt;While in general I favor clear organization where the folder structure and namespaces match, I do not like this change.  I wasted a LOT of time figuring it out.  Hopefully I can save someone else the time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-3800494823476893871?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/3800494823476893871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=3800494823476893871' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/3800494823476893871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/3800494823476893871'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2010/09/gotcha-blend-4-namespaces.html' title='Gotcha!  Blend 4 &amp; namespaces'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-8031611586738566930</id><published>2010-06-23T23:43:00.003-05:00</published><updated>2010-06-23T23:52:25.828-05:00</updated><title type='text'>Quiet on the home front</title><content type='html'>I've been pretty quiet lately because I've been jumping between a lot of things lately.  But here's what I've been up to.&lt;br /&gt;&lt;br /&gt;1) Preparing to make the jump to light speed, I mean VS 2010 / Silverlight 4 / Blend 4.  And not a minute too soon!&lt;br /&gt;&lt;br /&gt;2) Working on a new eponymous website to replace the cheesy looking one I have now.  Built in Silverlight, with graphic design by the illustrious &lt;a href="http://www.aimee-design.com" target="_blank"&gt;Aimee&lt;/a&gt;.  This site uses WCF RIA Services (although most people won't see that, because it's used by a members-only application for a club I belong to.  Sorry, folks!  What you will see is the cool layout and design stuff.&lt;br /&gt;&lt;br /&gt;3) Playing with &lt;a href="http://www.mongodb.net" target="_blank"&gt;MongoDb&lt;/a&gt; and the MongoDB C# drivers.  Need to learn the strengths and weaknesses of a NoSQL system to figure out if and when I want to use it for projects (personal or otherwise).  I have read mixed reports of experiences with MongoDB.  It has the advantage of having .NET driver support with a pretty active community working on that.  &lt;br /&gt;&lt;br /&gt;4) New book club.  June's book was Count of Monte Cristo, this month is Guns, Germs &amp; Steel.  Sorry, that's not tech based - but it's what I'm doing.&lt;br /&gt;&lt;br /&gt;5) Missing my loved ones.  *sigh*&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-8031611586738566930?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/8031611586738566930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=8031611586738566930' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/8031611586738566930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/8031611586738566930'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2010/06/quiet-on-home-front.html' title='Quiet on the home front'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-697822151647790706</id><published>2010-05-25T17:26:00.003-05:00</published><updated>2010-05-25T17:49:34.343-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visual source safe remote access'/><category scheme='http://www.blogger.com/atom/ns#' term='SourceOffSite'/><title type='text'>Adventures in Telecommuting</title><content type='html'>I've been quiet lately because a lot has been going on.  For family reasons not necessary to go into, I needed to relocate back to the DFW area fairly quickly.  All the standard job-hunting ensued but as it turns out, my employers wanted to keep me and suggested that we undertake a grand experiment in telecommuting.  I hadn't thought it would be an option, but I was glad of it since I really do like my job.  Plus, any job where you can work with your dog's head on your lap while wearing pajamas is a big plus!  &lt;br /&gt;&lt;br /&gt;But, telecommuting is not without its snags.  We have hit a number of networking issues in getting my environment set up.  Most of them I won't go into details about, since I am no expert in networking and I would likely screw up the explanation.  But, the problem that hit me the hardest and the fastest was that Visual Source Safe DOES NOT WORK REMOTELY.  I mean, seriously, it takes about 10 minutes to check out one file, and I am not exaggerating.  Now, I know VSS is old and crappy and we should be using something better, but I pick my battles - and it wasn't time for the source control battle in the past.&lt;br /&gt;&lt;br /&gt;Now, my goal was to get back to my source code ASAP.  Developing in a vacuum in a team environment is not feasible, and spending half the day checking files in and out wasn't an option.  So, I asked some friends, and got a bunch of recommendations and ended up trying SourceOffSite from SourceGear.  I now owe the friends who recommended it a beverage of their choice.&lt;br /&gt;&lt;br /&gt;First of all, it was really easy to set up.  The person who ended up setting up the server is not a technical person -- and he was able to do it from the directions with no problem.  Installing the client was easy, and only required a couple odd steps.  And then, it just worked.  Lightning fast.  I think it is faster than VSS was running locally.  Plus, the interface is similar enough to VSS that I didn't need any manuals to figure out how to use it... I just took off running.&lt;br /&gt;&lt;br /&gt;This is just awesome!  &lt;br /&gt;&lt;br /&gt;If all the other networking issues were as easy to solve, I would be stoked.  (Alas, I feel bad for the nice guys in our IT department who are having to devote way too much of their time to get me up and running...I owe them beverages too, if they ever come visit me in the North, or if I ever come back for the day.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-697822151647790706?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/697822151647790706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=697822151647790706' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/697822151647790706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/697822151647790706'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2010/05/adventures-in-telecommuting.html' title='Adventures in Telecommuting'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-3229498924684306161</id><published>2010-03-25T08:31:00.002-05:00</published><updated>2010-03-25T08:38:17.922-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NoSql'/><title type='text'>NoSql data stores</title><content type='html'>Has anyone reading this ever worked with Cassandra or another NoSql data store?  I think my brain is so deep in relational data modeling that I am having trouble wrapping my brain around how they work and why they would be so much faster than RDBMS for ultra large datasets.  The other half and I are thinking this might be a better back end for our game than a SQL-Server though, if the reports are correct.  Thus, we must evaluate and compare!&lt;br /&gt;&lt;br /&gt;It looks like Cassandra requires a UNIX system, which I am not sure I want to set up at present given that I already have a windows server that needs to stay as a windows server and don't feel like buying another one right now.  I need to look into whether there are Windows based NoSql open source datastores available and how those are to work with, especially from C++.&lt;br /&gt;&lt;br /&gt;I need to do some research when I have time.  I am not sure when that will be - myself and the kidling just started Kung-Fu on Monday, and while it is great fun and exercise it does chew up much of the evenings.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-3229498924684306161?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/3229498924684306161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=3229498924684306161' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/3229498924684306161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/3229498924684306161'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2010/03/nosql-data-stores.html' title='NoSql data stores'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-5133948543698520810</id><published>2010-03-23T12:35:00.002-05:00</published><updated>2010-03-23T12:59:48.505-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4'/><title type='text'></title><content type='html'>Excellent overview of what's coming in Silverlight 4 &lt;a href="http://channel9.msdn.com/learn/courses/Silverlight4/Overview/Overview/Enabling-Business-Application-Development/"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What has me happy?  Printing support, ability to bind to string indexers, ability to instantiate an ObservableCollection from a List, new interfaces for validation support for starters!&lt;br /&gt;&lt;br /&gt;No idea when TPTB will let us upgrade though.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-5133948543698520810?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/5133948543698520810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=5133948543698520810' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/5133948543698520810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/5133948543698520810'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2010/03/excellent-overview-of-whats-coming-in.html' title=''/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-205903639246223601</id><published>2010-03-15T10:53:00.002-05:00</published><updated>2010-03-15T11:36:08.361-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RIA'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>RIA, a picky mistress</title><content type='html'>I mentioned quite awhile ago that I was interested in the upcoming (now more or less here) flow-down business objects aka WCF RIA Services.  The idea behind the technology is that you can create the business objects on the server and use them from the client in a more streamlined way than was possible before.  I started my Silverlight LOB application during the Silverlight 2 beta, and as such found some situations where I had to create analogous classes in the Silverlight code base and on the server as a .NET class, then use a conversion routine to convert the server version to the Silverlight version in order to perform any client-side logic, support a ViewModel etc.&lt;br /&gt;&lt;br /&gt;During a recent code freeze I finally had the opportunity to investigate the now-in-beta RIA services to see whether they will work for us.  Here's what I discovered:  they are VERY VERY VERY tightly bound to the ADO.NET Data Services Entity Framework.  As in you have to use it.  By default, the Entity Framework requires you tightly bind to a specific database.  That's not possible for us because each customer project has its own case and schema.  We could try to work with a custom entity framework without such bindings but I am not yet convinced that that isn't even more work for less benefit.  We still couldn't use the DomainService class with anything that involved dynamic schema, which is a not-insignificant portion of the application.  Given that we really only have one area where we have significant redundancy between the Silverlight and server-side object logic, I am not seeing a benefit to changing how this particular system works.&lt;br /&gt;&lt;br /&gt;As I reminded one of my devs when he was researching the technology on his own, just because we COULD generate a custom and dynamic entity model, doesn't mean we SHOULD.  There needs to be a compelling reason to do it, which as of yet I haven't found.  I think the main place where I would see utility in this technology at the office is in the authentication service, since that would interface with a "master" database instead of project specific ones, and I may decide to go this route.&lt;br /&gt;&lt;br /&gt;Now, for some of my personal projects that do have a single database this is a super neat and easy alternative to an "old school" Silverlight WCF service.  Given what a pain it is to deploy a WCF application to service providers as I mentioned in my previous post, I am hoping this will be more a more straight forward deployment scenario. &lt;br /&gt;&lt;br /&gt;If any of you have worked with custom entity frameworks where you were not tightly bound to an individual instance or schema and have thoughts on how it worked for you and whether it was worth it, I'd love to hear them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-205903639246223601?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/205903639246223601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=205903639246223601' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/205903639246223601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/205903639246223601'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2010/03/ria-picky-mistress.html' title='RIA, a picky mistress'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-4243731050300451248</id><published>2010-03-15T10:50:00.003-05:00</published><updated>2010-03-15T10:53:03.541-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GoDaddy'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>WCF with GoDaddy</title><content type='html'>I have been helping a friend with some personal projects and in the process ran into a bit of trouble when deploying the sites to GoDaddy.  Luckily, someone has been there before me:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.edoverip.com/edoverip/index.php/2009/01/30/running-wcf-on-godaddy/" target="_new"&gt;http://www.edoverip.com/edoverip/index.php/2009/01/30/running-wcf-on-godaddy/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It doesn't sound like his WCF services were for Silverlight though, so if I come up with any additional tips in getting this up and running, I will update this post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-4243731050300451248?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/4243731050300451248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=4243731050300451248' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4243731050300451248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4243731050300451248'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2010/03/wcf-with-godaddy.html' title='WCF with GoDaddy'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-2161326692553423683</id><published>2010-02-10T09:08:00.002-06:00</published><updated>2010-02-10T09:12:52.361-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='story'/><title type='text'>Trigger Happy</title><content type='html'>One of the things I did with my database design is incorporate a "soft delete only" policy on any data the customers could possibly accidentally delete and want to recover later, along with a robust auditing strategy.  All these tables have a pretty-obvious "IsDeleted" column and all the queries filter against undeleted rows.&lt;br /&gt;&lt;br /&gt;As part of the implementation I added delete triggers to all the tables that simply said "No hard deletes permitted", just in case someone sometime down the road tried to actually delete a record from one of these tables.  Obviously *I* would never do that :) but you never know who might end up developing against the code and forget the golden rule.&lt;br /&gt;&lt;br /&gt;Sure enough, when I assigned another developer a ticket to fix a "delete" that wasn't working properly - he tried to hard-delete data, came up against the trigger and asked me about it.  I explained the policy, pointed at the apparently-not-as-obvious-as-I-thought IsDeleted column, and all was well in Anye-land.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-2161326692553423683?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/2161326692553423683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=2161326692553423683' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/2161326692553423683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/2161326692553423683'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2010/02/trigger-happy.html' title='Trigger Happy'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-1041561095854046696</id><published>2010-02-08T16:17:00.002-06:00</published><updated>2010-02-08T16:22:15.614-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphic design'/><category scheme='http://www.blogger.com/atom/ns#' term='Expression Suite'/><title type='text'>Pimping</title><content type='html'>Just taking a moment to pimp my graphic designer's new blog.&lt;br /&gt;&lt;br /&gt;http://aimee-design.com/notebook/&lt;br /&gt;&lt;br /&gt;While the subject of graphic design for Silverlight using Expression may not be directly related to development, it is directly related to making the most of Silverlight.  G-d knows how crappy my web applications would look (Silverlight or no Silverlight) without the expertise of a talented artist!  Additionally, I've found that putting together the UI in Blend is a hundred times easier than trying to work just from the XAML in Visual Studio's Design View (especially since the graphical design view usually shows you exactly nothing), so we frequently teach each other little tricks on how to make things work from the design side.&lt;br /&gt;&lt;br /&gt;If you have an interest in UI development for Silverlight and/or know any graphic designers who do, feel free to pass it along.  She's just getting started with the blog but I suspect there will be plenty of good stuff here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-1041561095854046696?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/1041561095854046696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=1041561095854046696' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/1041561095854046696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/1041561095854046696'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2010/02/pimping.html' title='Pimping'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-5788356076847923136</id><published>2010-02-05T15:27:00.003-06:00</published><updated>2010-02-05T15:35:07.105-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IE8'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight debugging problem'/><category scheme='http://www.blogger.com/atom/ns#' term='FAILBOAT'/><category scheme='http://www.blogger.com/atom/ns#' term='breakpoints'/><title type='text'>FAILBOAT:  IE 8 and Silverlight debugger - "no breakpoints have been loaded"</title><content type='html'>Awhile ago one of my newhire devs informed me he could not debug our Silverlight application.  I sent him on a google-fu quest to figure out why and get it working, since not being able to debug is a Pretty Big Deal.  He was not able to find a solution to the problem but being a resourceful fellow he found a workaround which involved a single test page that opened the Silverlight window in-situ instead of popping up a new one.&lt;br /&gt;&lt;br /&gt;Fast forward to yesterday, where your gentle blogger was having issues with the )(#%)@*(#*(@% application known as Software Planner, a dinosaur of a bug tracking system built in *gags* Classic ASP, that has truly abyssmal usability and hangs constantly.  I was told that upgrading my IE to version 8 (I was on 7) would magically solve all my problems with that bit of software "engineering".  Well, it didn't, and it created a world of new ones.&lt;br /&gt;&lt;br /&gt;Suddenly, I can't debug my Silverlight application either.  I spend several hours trying every suggestion I can find in the blogosphere before I come across a post asking it the problem might perhaps be related to IE8, which had just been installed.&lt;br /&gt;&lt;br /&gt;Aha!  So I uninstalled IE8, and guess what?  My problems mysteriously vanished and my debugger is happily munching Silverlight grass again.&lt;br /&gt;&lt;br /&gt;I wonder how many hours of people's productivity has been wasted on this.&lt;br /&gt;&lt;br /&gt;The moral of this story is, until they fix this, if you are a Silverlight developer, run, don't walk, away from IE 8 as fast as your little feet can carry you.&lt;br /&gt;&lt;br /&gt;*Note - I use Firefox and/or Chrome for my personal browsing pleasure.  But since most people use IE, I figure I ought to be testing on that.  I hadn't even noticed I didn't have the latest version until my coworker mentioned it.  &lt;br /&gt;&lt;br /&gt;I love Silverlight, but this IE8 bug gets a failboat award from me big time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-5788356076847923136?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/5788356076847923136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=5788356076847923136' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/5788356076847923136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/5788356076847923136'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2010/02/failboat-ie-8-and-silverlight-debugger.html' title='FAILBOAT:  IE 8 and Silverlight debugger - &quot;no breakpoints have been loaded&quot;'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-8657520740142887782</id><published>2010-02-02T11:47:00.002-06:00</published><updated>2010-02-02T11:56:36.162-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='unmanaged'/><category scheme='http://www.blogger.com/atom/ns#' term='ole db'/><category scheme='http://www.blogger.com/atom/ns#' term='native'/><category scheme='http://www.blogger.com/atom/ns#' term='dll'/><title type='text'>Call for assistance</title><content type='html'>This is a long shot but my google-fu has been weak on these subjects.&lt;br /&gt;&lt;br /&gt;1) database access from native C++ using OLE DB without wiring it into any UI or using a template.  I want to open my own connections, send my own sql queries and traverse my results without creating strongly typed objects as the templates do.  This will run from a dll exposed by some sort of service.&lt;br /&gt;&lt;br /&gt;(The most promising thing I've found is the SQLAPI from www.sqlapi.com, I am going to evaluate this and see if it meets my needs or at the very least teaches me something, but it's not free.)&lt;br /&gt;&lt;br /&gt;2) creating win32 dlls (not MFC) from native C++, how to expose the properties and methods and get them to export a lib file that can be referenced elsewhere.  How to expose "endpoints" for socket connections that can access these.&lt;br /&gt;&lt;br /&gt;I have been giving myself a crash course in native unmanaged C++ using Ivor Horton's Beginning C++ for VS 2008, basically ignoring all of the managed C++/CLI stuff to keep from confusing myself and it has been going very well except that about halfway through the book he moves into MFC and windows development and assumes everything you want to do is in that context, so the above two topics aren't handled well at all.  If for some reason you want to do MFC or WinForms development using C++ it really is a great book though.&lt;br /&gt;&lt;br /&gt;I looked for books that were more advanced on these topics and they are mostly from 8+ years ago, so I'm not sure how pertinent they will still be (although admittedly native C++ isn't exactly new technology).&lt;br /&gt;&lt;br /&gt;Any thoughts or suggestions from the peanut gallery?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-8657520740142887782?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/8657520740142887782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=8657520740142887782' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/8657520740142887782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/8657520740142887782'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2010/02/call-for-assistance.html' title='Call for assistance'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-2615807301741450271</id><published>2009-12-08T14:22:00.005-06:00</published><updated>2009-12-08T14:25:44.951-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Common Table Expressions'/><title type='text'>Good stuff!</title><content type='html'>Some previews of what is to come with Silverlight 4 that are of keen interest to me are found &lt;a href="http://www.silverlightshow.net/items/Developing-applications-gets-easy-with-improved-DataBinding-in-Silverlight-4.aspx"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Better databinding with formatting, nullvalue and invalid binding handling.  And more...I even heard rumors that binding to collections with an indexer will be natively supported, but I heard that elsewhere.&lt;br /&gt;&lt;br /&gt;Additionally, if you haven't worked with Common Table Expressions in your SQL database, you really need to know about them.  They make all sorts of things easier including paging and complex combinations of queries.  &lt;a href="http://www.sqlservercentral.com/articles/T-SQL/68651/"&gt;Here's&lt;/a&gt; a nice introductory article.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-2615807301741450271?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/2615807301741450271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=2615807301741450271' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/2615807301741450271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/2615807301741450271'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2009/12/good-stuff.html' title='Good stuff!'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-3095564212463056386</id><published>2009-11-25T14:23:00.004-06:00</published><updated>2009-11-25T14:28:15.341-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='popup mousedragelementbehavior'/><title type='text'>Popups and Borders, Oh my!</title><content type='html'>In Silverlight there is a "Popup" control which is designed to be a popup.  You open and close it using the "IsOpen" property.  It is a container like border, grid, etc.  In Blend it sometimes decides to be open and sometimes not (I noticed this odd behavior both in Blend 2 and 3).  &lt;br /&gt;&lt;br /&gt;One big downside I found to using the Popup control aside from the Blend oddness is its drag behavior is very choppy.&lt;br /&gt;&lt;br /&gt;When you add the MouseDragElementBehavior to a Popup, and then try to drag it at runtime, it jumps around before stopping where you dragged it.  YUCK.&lt;br /&gt;&lt;br /&gt;Thus I really don't see any advantage to using the Popup over using a Border instead.  When the MouseDragElementBehavior is applied to a Border, its movement is as smooth as a baby's tushie.  From a code perspective you just have to control the Border's Visibility property instead of using IsOpen.  Not a huge change.&lt;br /&gt;&lt;br /&gt;If anyone knows some advantage of the Popup that I'm missing, please do tell.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-3095564212463056386?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/3095564212463056386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=3095564212463056386' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/3095564212463056386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/3095564212463056386'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2009/11/popups-and-borders-oh-my.html' title='Popups and Borders, Oh my!'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-485018871565564486</id><published>2009-10-26T17:31:00.003-05:00</published><updated>2009-10-26T17:39:43.355-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Dynamically Loaded Font'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 2 DataGrid FontSource'/><title type='text'>DataGrid &amp; Dynamic Font Loading</title><content type='html'>Unicode font packages are HUGE.  Like 33MB huge.  This interferes with compiling your .xap file if you are using the "supported" method of using the FontManager to include the font in your Silverlight assembly.  By interferes, I mean anywhere from 25-75% of the time you get an "Out of memory" exception when you try to compile.  Reboot and the problem goes away for awhile, but not long.&lt;br /&gt;&lt;br /&gt;For months I've had on my "to-do" list to pull the font file out and start loading it dynamically using the WebClient, but I had so many features in my "to-do" list that the users can actually see that I kept delaying it.  Well, today I got so fed up with the out-of-memory shuffle that I decided to put my foot down, stop working on everything else, and git-r-dun.&lt;br /&gt;&lt;br /&gt;I decided to use the unicode font only where the potential for dynamic data exists and to use a static font for static data.  Find-replace for the win.  However, there is a bit of drudgery associated with updating the FontSource for each framework element that must use the dynamically loaded font.  And, when it came to updating the Silverlight ToolKit DataGrid objects I was using... a small stumbling block.  The DataGrid and its DataGridColumns do not expose the FontSource.  They expose the FontFamily, but that's only half the work.&lt;br /&gt;&lt;br /&gt;So here's how I handled it -  I replaced all my DataGridTextColumns with DataGridTemplateColumns and for each one, defined a custom CellTemplate containing a TextBlock.  I set the Text using the normal Binding Path methodology and defined a handler for the Loaded event of the TextBlock.  In this Loaded event, I set the FontSource.&lt;br /&gt;&lt;br /&gt;You might recognize this trick from my dynamic ToolTip post... that's where I got the idea.  (I also tried binding the FontSource property of the TextBlock in the XAML but that caused a Big Fiery Ball Visible From Space.)&lt;br /&gt;&lt;br /&gt;Maybe prujohn or some of my other Silverlight 3 savvy readers may know if there is a better way to do this in Silverlight 3 (which I should be able to upgrade to any time now when our Blend 3 licenses arrive...waiting...waiting...) or whether I should continue to make this change all over my application (spending a heck of a lot of drudgerous time in so doing)?&lt;br /&gt;&lt;br /&gt;Happy Monday,&lt;br /&gt;Anye&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-485018871565564486?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/485018871565564486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=485018871565564486' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/485018871565564486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/485018871565564486'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2009/10/datagrid-dynamic-font-loading.html' title='DataGrid &amp; Dynamic Font Loading'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-2433760890641652644</id><published>2009-10-05T14:11:00.004-05:00</published><updated>2009-10-06T21:26:03.563-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='abstract base class'/><category scheme='http://www.blogger.com/atom/ns#' term='Expression Blend 2'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><title type='text'>Abstract base classes</title><content type='html'>A short fyi - Expression Blend (ETA: Blend 2) can't handle abstract base classes.&lt;br /&gt;&lt;br /&gt;Scenario:  I have two pages A &amp; B that I need to be possible "source" pages for another page - I could either have both implement an interface or use inheritance.  I choose inheritance for various reasons (mainly involving shared functionality between A &amp; B), and want each class to have an UpdateAfterDone() type method to be called by the 2nd page to update the 1st with its results.  I tried having both A&amp;B inherit from an abstract class that defines an abstract method UpdateAfterDone(), and everything was hunky dory until I tried to open A in Blend.  When I switched the base class to be concrete and made UpdateAfterDone virtual, it rendered fine.&lt;br /&gt;&lt;br /&gt;Not a show-stopper, but since I don't really have "default" functionality for UpdateAfterDone() like I do for some of the other methods I would think it would be cleaner to be abstract.  If not for the shared functionality I'd use an interface instead.  &lt;br /&gt;&lt;br /&gt;Harumph.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-2433760890641652644?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/2433760890641652644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=2433760890641652644' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/2433760890641652644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/2433760890641652644'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2009/10/abstract-base-classes.html' title='Abstract base classes'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-1773769601280546546</id><published>2009-08-28T16:00:00.002-05:00</published><updated>2009-08-28T16:10:19.762-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='indexed views'/><title type='text'>Indexed views in SQL 2K5 Standard</title><content type='html'>I know, I've been away for awhile.  Main reason for that is every topic I think of to blog about ends up being too darn proprietary.  The powers that be would be unhappy if I blogged about certain topics.&lt;br /&gt;&lt;br /&gt;So, today I will talk about something I was investigating recently that ended up being a pain in the rear: indexed views.&lt;br /&gt;&lt;br /&gt;Here's the situation - you have a view that is crossing several tables, all the tables are indexed properly, but the performance of the view is slow because the view itself is not indexed.  When you write the same query using all the underlying tables, messy as it is, it runs faster.  Wouldn't it be nice if you could index the view?&lt;br /&gt;&lt;br /&gt;Well, you can...sometimes.  The biggest kicker here is in order to use indexed views there are certain settings that your database table has to have - QUOTED_IDENTIFIERS = ON, ANSI_NULLS = ON among others - and these have to be set when you create the table.  So, if you've already got lots of happy data living peacefully in your tables - it's not necessarily a simple matter to drop the table and rebuild.&lt;br /&gt;&lt;br /&gt;Additionally, it's not just the table that needs these settings - all of your queries that perform CRUD against these tables need to be adjusted as well to run in a session with these settings in place.  And of course, whenever you read from the view in question they must also be set this way.&lt;br /&gt;&lt;br /&gt;The good news is, if you are starting from scratch it is a relatively simple matter to do all these things.  The bad news is, if you are maintaining a system like mine where deleting the data to upgrade is not an option, then you are in a pickle.  At first I tried going the route of, "ok, we just won't update existing installations."  But - this presents a problem when all installations have to use the same codebase.  The code needs to be able to figure out how to set the settings.  There are functions to look at the settings of a table, so you technically could query each table in question, determine if ANSI_NULLS and the other usual suspects are ON or OFF and set the session accordingly.  Multiply that across all your code and you have a maintenance nightmare.  &lt;br /&gt;&lt;br /&gt;So, I decided to wait until the next major schema rewrite where we don't upgrade existing installations and to make the changes then, full stop.  So I can support one schema, one codebase without a bunch of kludgy code to figure out which database schema I'm working with.  In the meantime, the slower of my views won't be getting as much heavy lifting as they should be.&lt;br /&gt;&lt;br /&gt;But, the lesson has been learned for the future - when you write your schema, plan for these indexed views.  Or just plain don't use views unless you have to.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-1773769601280546546?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/1773769601280546546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=1773769601280546546' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/1773769601280546546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/1773769601280546546'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2009/08/indexed-views-in-sql-2k5-standard.html' title='Indexed views in SQL 2K5 Standard'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-4547410205317456922</id><published>2009-06-02T10:49:00.004-05:00</published><updated>2009-06-02T11:14:24.762-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WCF transport security with basic authentication'/><title type='text'>Dance of the Transport Security Penguins</title><content type='html'>I've spent the last couple days getting a WCF service working with Transport security + basic authentication using wsHttpBinding and it has been an experience.&lt;br /&gt;&lt;br /&gt;If I weren't constrained to a server that already has live sites that can't go down randomly for tinkering, it would have been much easier.  I will warn you up front that although it is possible to fool WCF using a fake SSL certificate your life will be easier if you can work where there is a real, trusted one.&lt;br /&gt;&lt;br /&gt;But, I finally prevailed.&lt;br /&gt;&lt;br /&gt;Some tidbits of "wisdom"...&lt;br /&gt;I had trouble with the mex endpoint requiring anonymous authentication being available once I turned basic authentication on.  So I had to remove the mex endpoint and remove the httpsGetEnabled line in the service behavior.  This of course means you cannot discover the service from this location, so luckily I had discovered it locally already (locally does not have an SSL certificate however).&lt;br /&gt;&lt;br /&gt;(Interestingly enough, when I tried this with a simple basicHttpBinding service, discovered locally w/o security and then changed the config to transport security, I got an error trying to set the client credentials, telling me the username and password were read only.  Huh?  I abandoned my simple test and went back to the main service which I already had running under transport security with no authentication.)&lt;br /&gt;&lt;br /&gt;This part is probably obvious but just in case I will state it here in case it helps anyone - when you are configuring IIS, if you are going to use a local machine account for the basic authentication, the domain &amp; realm should be empty.  If you are using a domain account, you need to pick the domain and put it in these fields.&lt;br /&gt;&lt;br /&gt;I eventually got this running with anonymous auth turned off, no mex endpoint, using either a domain account or a local machine account.  I settled on a local machine account with remote access disabled and no permissions, which I then encrypted before adding to the config as settings.  Luckily for me, I don't WANT my app to function if anyone messes with my settings.&lt;br /&gt;&lt;br /&gt;One other thing I will mention is that the error messages I got were not always descriptive.  I saw a lot of "the service could not be activated" when I had the mex endpoint still existing after turning on Basic Authentication in IIS, and even after getting to the working configuration of IIS and my config files, when I passed an incorrect username &amp; password on the proxy, the resulting error message didn't indicate that the problem was invalid credentials but instead said "the http request is unauthorized with client authentication scheme 'anonymous'".  Note that you will see this same error message if you forget to change the client side config transport clientCredentialType to Basic from None.  That doesn't really help when you're trying to figure out if you're making progress, I'm afraid.  If you forget to give credentials at all after setting up IIS and the config files, you will see a message indicating that you have to pass credentials though.&lt;br /&gt;&lt;br /&gt;Here are some links that helped me:&lt;br /&gt;&lt;br /&gt;Alan Smith's excellent webcast on WCF Security using Basic Authentication&lt;br /&gt;http://bloggersguides.net/media/p/1804.aspx&lt;br /&gt;(covers how to fake out the SSL for development and steps through setting up the security on a local machine with a local account)&lt;br /&gt;&lt;br /&gt;Some MS resources:&lt;br /&gt;http://msdn.microsoft.com/en-us/library/ms733775(VS.85).aspx&lt;br /&gt;http://msdn.microsoft.com/en-us/library/ms731925.aspx&lt;br /&gt;&lt;br /&gt;but much of my work was just trial and error.  So hopefully google will pick this up and I'll help someone with these scattered thoughts.&lt;br /&gt;&lt;br /&gt;Cheers!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-4547410205317456922?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/4547410205317456922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=4547410205317456922' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4547410205317456922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4547410205317456922'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2009/06/dance-of-transport-security-penguins.html' title='Dance of the Transport Security Penguins'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-4200310480988015269</id><published>2009-03-19T09:22:00.003-05:00</published><updated>2009-03-19T09:23:37.215-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>A must-read link on application security</title><content type='html'>A very interesting link from the Dept of Homeland Security regarding (you guessed it) application security:&lt;br /&gt;&lt;br /&gt;http://cwe.mitre.org/top25/#CWE-20&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-4200310480988015269?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/4200310480988015269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=4200310480988015269' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4200310480988015269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4200310480988015269'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2009/03/must-read-link-on-application-security.html' title='A must-read link on application security'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-7409590967426309878</id><published>2009-02-23T17:26:00.006-06:00</published><updated>2009-06-02T11:15:58.871-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='constructors'/><category scheme='http://www.blogger.com/atom/ns#' term='&quot;Cannot create instance of&quot;'/><category scheme='http://www.blogger.com/atom/ns#' term='Expression Blend'/><title type='text'>Blend &amp; Logic in your UserControl constructors</title><content type='html'>If you put any initialization code in your UserControl constructor, make sure to wrap all your object assignments with null reference checks.  This is a good practice anyway, but in Blend if you are doing anything complicated in your assignment (like, say, instantiating a proxy) that it doesn't actually perform - it will give you a lovely "Cannot create an instance of ObjectType" message in the Blend UI. &lt;br /&gt;&lt;br /&gt;In fact, even if you DO wrap it in a null check, it still bombs. &lt;br /&gt;&lt;br /&gt;My code looks like this:&lt;br /&gt;if(App.Current!=null)&lt;br /&gt;{&lt;br /&gt;    _Proxy = (App.Current as App).GetProxy();&lt;br /&gt;    if(_Proxy !=null )&lt;br /&gt;    {&lt;br /&gt;      //dostuff&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;and I'm still getting NRE's.&lt;br /&gt;&lt;br /&gt;It turns out it is actually : (App.Current as App) that is returning null - which is odd, given that my application is of type App, so I'm not sure what App.Current would be if it isn't null!  But if I change my statement to:&lt;br /&gt;if (App.Current!=null &amp;&amp; (App.Current as App)!=null){&lt;br /&gt;then it renders properly.&lt;br /&gt;&lt;br /&gt;I usually haven't been using the constructor much for initialization just because of my navigation architecture, which calls an InitializeAll() method but I had seen this happen a few times on controls that aren't part of the navigation tree but sit on another xaml control and finally bothered to investigate it.&lt;br /&gt;&lt;br /&gt;Just a minor annoyance, I mention it here because it's not really intuitive as to why you get that error in Blend even though the app compiles and runs just peachily.&lt;br /&gt;&lt;br /&gt;Update to add - this happens because Blend has its own custom App object.&lt;br /&gt;&lt;br /&gt;Workaround - don't put initialization code in the constructor, put it in a code-called Initialization method and use your navigation framework to call this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-7409590967426309878?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/7409590967426309878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=7409590967426309878' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/7409590967426309878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/7409590967426309878'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2009/02/blend-logic-in-your-usercontrol.html' title='Blend &amp; Logic in your UserControl constructors'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-5990856934498055206</id><published>2009-01-30T13:16:00.003-06:00</published><updated>2009-01-30T13:37:57.517-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rants'/><title type='text'>Scientific Method as it relates to formulating tutorials</title><content type='html'>The scientific method states that you should only change one characteristic of a scenario at a time in order to determine which factors affect it in which way.  In cooking, if the recipe tastes a little off, you change one ingredient - not the whole recipe.  This technique clearly applies to debugging software applications - if you change a bunch of code at once, you can't necessarily tell which piece fixed the bug - to avoid making a similar error later.  Here I will argue that it also applies to formulating tutorials.&lt;br /&gt;&lt;br /&gt;First, the anecdotal evidence.  When I first started working with Silverlight and WCF I had to rely heavily on how-to's formulated by other people online.  Many of these were coming out of MS itself and the various teams working on "all the new cool stuff", although there were many useful ones from random techies not unlike myself as well.&lt;br /&gt;&lt;br /&gt;If you're writing a business application as many of us are, eventually you're going to want to figure out how to get your data into Silverlight.  Start looking for tutorials on Silverlight + WCF and you will find they almost all rely on other new technologies for their data access - ADO.NET Data Services (Astoria, wasn't even released yet when many of these tutorials were written), Linq-to-SQL, yada yada.&lt;br /&gt;So, to follow these instructions you have to work out all the kinks of setting up some new entity schema, then figure out how to write the WCF service, then figure out how to connect it to Silverlight, and then figure out which of these 3 pieces is f*'d when it doesn't work.&lt;br /&gt;&lt;br /&gt;I did not find one single tutorial that said, "but, you can also access your data from the WCF service the same way you always do from a .NET application - either using ADO.NET, the Microsoft Enterprise Libraries, or insert-your-favorite-third-party-object/relational modeling tool here."  Luckily I only wasted a small amount of time trying to figure out pre-release Astoria before I had the epiphany on my own and tried the novel concept of writing my data access the same way I always do...just to get it working and help prove out the concept that I really was focused on.&lt;br /&gt;&lt;br /&gt;I also, as a frequent denizen of the Silverlight forums, have noticed a large number of people posting questions that say that a) the user is a .NET developer without Silverlight or WCF experience and b) they want to know how to get data from a database into Silverlight.  I notice that almost every single f'ing response talks about...you guessed it...Linq-to-SQL/Astoria/Linq-to-My-Dog-Spot what have you.&lt;br /&gt;&lt;br /&gt;Now, I don't say any of this to bash the new data access technologies themselves.   I have looked into them and see that they have their advantages and disadvantages, like any technology.  They are very useful in some scenarios - and a major pain in the ass not worth the effort or a performance killer in other scenarios.  Now, it may very well be that many of these Silverlight/WCF novices will eventually decide that one of these new data access technologies is right for them.  But, I argue they will have a hell of a lot easier time making an intelligent decision about that if people in the web-o-sphere (MS and not MS employees alike) stop acting as if these technologies are tightly coupled to a Silverlight / WCF solution -- because they aren't.&lt;br /&gt;&lt;br /&gt;For what it's worth, I am still using the Enterprise Libraries and writing a custom DAL for my application at work, because of the specific business needs of my application and the need for dynamic database schemas/different databases for each client all using the same application.  But, I will probably use the Entity Framework for my personal projects at home which have a 1:1 relationship between application and database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-5990856934498055206?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/5990856934498055206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=5990856934498055206' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/5990856934498055206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/5990856934498055206'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2009/01/scientific-method-as-it-relates-to.html' title='Scientific Method as it relates to formulating tutorials'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-4822505480238921277</id><published>2009-01-29T15:11:00.002-06:00</published><updated>2009-01-29T16:56:55.618-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='resgen'/><category scheme='http://www.blogger.com/atom/ns#' term='vs 2008'/><title type='text'>ResourceBuilder - AWOL in VS 2008</title><content type='html'>Sorry for the radio silence.  Life and work have both been busy lately.  My Silverlight app is going to make its public demo debut next week at LegalTech (woohoo!) and *knock on wood* it's ready to go. (Not ready for production, there is still a lot to do, but ready to demo anyway.)&lt;br /&gt;&lt;br /&gt;So, during my self-imposed code freeze on my Silverlight app I've gone back to the ASP.NET based security administration application that I was working on before I got pulled onto this, with the idea of integrating security for the two apps into one (hence why I built an extensible security framework for it in the first place).  Overall it has gone pretty well. &lt;br /&gt;&lt;br /&gt;I was very surprised though when I wanted to add some resource data, to find the link in VS 2008 under Tools --&gt; ResourceBuilder to be greyed out.  I looked on the googlesphere and found nothing, so I just played around with it.  Turns out, it was looking for resgen.exe in a path analogous to where it lived in VS 2005 in the VS 2008 app folder, but it wasn't actually there.  A scan of my hard drive revealed it wasn't there at all for VS 2008.  So I copied it from VS 2005's path, closed my eyes and hoped for the best.  It worked.&lt;br /&gt;&lt;br /&gt;Now I suspect that they changed the way resources work between the two versions in some way, though I didn't find concrete info on this, and I had already written a ResourceManagerWrapper class to handle the resource files for my non-UI classes (the UI ones don't require external compilation), so I really didn't feel like changing my paradigm at the moment.&lt;br /&gt;&lt;br /&gt;Anyway, this is pretty low on the importance scale but just in case anyone else was wondering "why the heck is ResourceBuilder disabled in VS 2008"...that's why.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-4822505480238921277?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/4822505480238921277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=4822505480238921277' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4822505480238921277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4822505480238921277'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2009/01/resourcebuilder-awol-in-vs-2008.html' title='ResourceBuilder - AWOL in VS 2008'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-7625682752935551070</id><published>2008-12-22T13:11:00.002-06:00</published><updated>2010-03-09T05:54:17.256-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='best practices'/><category scheme='http://www.blogger.com/atom/ns#' term='duplex communication'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Multiple WCF services in the same assembly</title><content type='html'>I recently had to figure out how to expose multiple WCF services in the same "site" - i.e. one web site project containing multiple service classes &amp; *.svc files, with different service nodes in the web.config, as opposed to multiple service contracts in the same *.svc file / service node that have different endpoints defined.&lt;br /&gt;&lt;br /&gt;I am still not convinced this is a best practice - the reason I did this was for ease in my testing scenario - I can deploy two linked but not necessarily related services at once. I didn't want to include them in the same .svc file because they serve different purposes and could potentially be separated into separate deployments later (and they probably will be).  But, I wanted to get this working and it took a little tinkering to figure out how.&lt;br /&gt;&lt;br /&gt;The problem I was having was - I could only discover my original service.  I'd get errors trying to discover the other one, even though I specified a base address for it.  Turns out what the missing piece was is that I needed a separate virtual directory for each service, both pointing to the same physical path on the server, but one set up with ServiceA.svc as the default file and the other with ServiceB.svc as the default.&lt;br /&gt;&lt;br /&gt;In that way, I could discover ServiceA as :  http://myserver/ServiceA &lt;br /&gt;and ServiceB as http://myserver/ServiceB&lt;br /&gt;voila.&lt;br /&gt;&lt;br /&gt;I still suspect there may be another way to do this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-7625682752935551070?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/7625682752935551070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=7625682752935551070' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/7625682752935551070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/7625682752935551070'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/12/multiple-wcf-services-in-same-assembly.html' title='Multiple WCF services in the same assembly'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-7177490484356198282</id><published>2008-12-17T22:49:00.003-06:00</published><updated>2008-12-17T23:00:07.881-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='alexandria'/><category scheme='http://www.blogger.com/atom/ns#' term='Business logic framework'/><category scheme='http://www.blogger.com/atom/ns#' term='MDC'/><title type='text'>Alexandria, or my senility</title><content type='html'>My honey likes to tell me I'm getting senile, since he is two years younger than I. (Happy Birthday to him today, by the way.)  He may be right.  When I was at the MDC last week, one of the most exciting topics I heard discussed was a current project in development at Microsoft which I could have sworn was "code name Alexandria".  This project was for a business object framework that can flow down from .NET to Silverlight in a similar same way to how a service contract does today.  Think about it - right now, when you discover a WCF service, all you really see are the methods, event handlers, and in the case of DataContracts, a very thin object.  If you'd defined any logic in the DataContract class, it is stripped away during the proxy generation process.&lt;br /&gt;&lt;br /&gt;What if that didn't happen, and you could see the methods and constructors in a proxy class that corresponded to the actual business logic of a .NET class?  Well, that's the idea behind (what I thought was called) Alexandria.  You "discover" the business objects similarly to how you discover a WCF service, and can call proxy methods to its logic.&lt;br /&gt;&lt;br /&gt;This will solve the problem that has been driving me nuts about having to duplicate business logic in Silverlight classes and .NET classes.  My application involves generating a set of parameters in the Silverlight application that are going to be used to define the data we want to query and do stuff with in the .NET side and database.  These parameters are complex types with specific business logic governing how they are configured.  This logic has to exist on the Silverlight side, otherwise we wouldn't have the information we need to form them in the first place to send off to the WCF service.  But, it also has to exist on the .NET side because that is where the actual queries, operations and data-changing work is done.  It's not identical in both places certainly, but there is definitely overlap.&lt;br /&gt;&lt;br /&gt;Once (the project I am calling) Alexandria comes out though, I can write the logic once against the .NET framework and discover it from Silverlight.  &lt;br /&gt;&lt;br /&gt;So what's the catch?  I can't find any evidence of this project in the blogosphere.  Either it is so new that google hasn't found it yet, I am misremembering the project code name.  I looked at the Wiki page for MS code names, and Alexandria was actually used as a code name for a Zune store at one point - definitely NOT the same Alexandria.&lt;br /&gt;&lt;br /&gt;So I'm a bit confused.  Regardless, I am waiting with baited breath for a CTP of this project...whatever it ends up being called.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-7177490484356198282?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/7177490484356198282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=7177490484356198282' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/7177490484356198282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/7177490484356198282'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/12/alexandria-or-my-senility.html' title='Alexandria, or my senility'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-8887377081515848874</id><published>2008-12-10T09:36:00.001-06:00</published><updated>2008-12-10T09:36:49.932-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MDC'/><title type='text'>Houston MDC</title><content type='html'>I went to the Houston Microsoft Developers Conference yesterday and it was very useful.  There is a lot of cool stuff coming down the pipe, some I can use, some I may not, but all very interesting.   I will post more later, just wanted to say that for now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-8887377081515848874?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/8887377081515848874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=8887377081515848874' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/8887377081515848874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/8887377081515848874'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/12/houston-mdc.html' title='Houston MDC'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-7146750058188931999</id><published>2008-12-08T17:21:00.002-06:00</published><updated>2008-12-08T17:31:58.597-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='f#'/><title type='text'></title><content type='html'>Am I the only one that thinks F# sounds like a curse word?  Just checking.&lt;br /&gt;&lt;br /&gt;That said, it is on my "to investigate" list.  I usually prefer to learn the strengths and weaknesses of a technology before deciding to incorporate it in my work, so I honestly have no idea if I will ever use it or not.  But, it is another pulse to keep my finger on I suspect, who knows, maybe I will find it useful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-7146750058188931999?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/7146750058188931999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=7146750058188931999' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/7146750058188931999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/7146750058188931999'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/12/am-i-only-one-that-thinks-f-sounds-like.html' title=''/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-8487942507399951583</id><published>2008-12-08T17:07:00.002-06:00</published><updated>2008-12-08T17:17:01.493-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='datacontext'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='ToString()'/><title type='text'>Gotcha:  ToString(), Silverlight bindable classes and DataContext</title><content type='html'>I mentioned in a previous post that when working with comboboxes and autocompleteboxes the ToString() method is how the control figures out what the value of a bindable item is.&lt;br /&gt;&lt;br /&gt;ToString() gets a bit more complicated.&lt;br /&gt;&lt;br /&gt;I recently imported some .NET classes code into a Silverlight library and began tweaking them for Silverlight use.  These classes all used the ToString() method to spit out an XML representation of themselves.&lt;br /&gt;&lt;br /&gt;I attempted to set the DataContext of a control to one of these objects and to bind some individual properties to properties of the object.  Simple, no?  (Well, it's something that has become old hat in the few months I've been working with Silverlight anyway.)  But, the binding wasn't working - nothing was getting populated on the UI side.&lt;br /&gt;&lt;br /&gt;So I did what all conscientious developers do and started stepping through my code.  The object was being loaded properly from the WCF service callback that was populating it, the DataContext of the control was being set without error... but...what's this... when I moused over the control.DataContext line in the code-behind after it bound, instead of seeing {MyObjectType} as I usually do, I saw my ToString() XML representation of the object.&lt;br /&gt;&lt;br /&gt;The runtime is by default using ToString() as the datacontext if it is overridden, instead of using the object itself.  Que horror!  No wonder binding to the "ImagePath" property wasn't doing squat... it's context was just the xml text string.&lt;br /&gt;&lt;br /&gt;So, I replaced my ToString() override with ToXmlString() which I then added to the common base class as an abstract method (alternatively I could have used an interface but these related types already had a base class, so I didn't.)  Voila, it worked.&lt;br /&gt;&lt;br /&gt;For some controls, like a textbox, I could see it making sense to have the DataContext bind to the ToString() of an object...but really, I don't like it.  It takes away my choice to use a different property.  I would like to be able to use ToString() if I want, but as in this scenario, I wasn't trying to bind a text property - I was trying to bind to an ImagePath property.  I might have used a Text property elsewhere in the bound control, or not, but I wasn't given a choice.&lt;br /&gt;&lt;br /&gt;The workaround wasn't difficult - but now it means I cannot use ToString() to, well, generate a string.  Harumph.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-8487942507399951583?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/8487942507399951583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=8487942507399951583' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/8487942507399951583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/8487942507399951583'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/12/gotcha-tostring-silverlight-bindable.html' title='Gotcha:  ToString(), Silverlight bindable classes and DataContext'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-1528190587867825029</id><published>2008-12-08T16:44:00.002-06:00</published><updated>2008-12-08T17:06:40.944-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='datacontracts'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Gotcha: Using complex types as input parameters to a WCF service method</title><content type='html'>I had first noticed this issue when I first started playing with WCF but was too goal oriented at the time to follow up with it.  Now that I understand WCF better I took the time to investigate.&lt;br /&gt;&lt;br /&gt;The issue - I was creating DataContracts to act as Request objects for my WCF services, but their properties weren't being passed through the channel.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;[DataContract]&lt;br /&gt;public class DoSomethingRequest&lt;br /&gt;{&lt;br /&gt;   [DataMember]&lt;br /&gt;   public int SomethingID {get;set;}&lt;br /&gt;   [DataMember]&lt;br /&gt;   public int UserID {get;set;}&lt;br /&gt;   [DataMember]&lt;br /&gt;   public string SomeText {get;set;}&lt;br /&gt;}&lt;br /&gt;would be the input for a DoSomething method in my service:&lt;br /&gt;&lt;br /&gt;[OperationContract]&lt;br /&gt;void DoSomething(DoSomethingRequest request);&lt;br /&gt;&lt;br /&gt;When I would actually call this method from a client, the int properties in DoSomethingRequest were all 0, but the string SomeText was populated.&lt;br /&gt;&lt;br /&gt;I noticed the proxy created another set of properties SomethingIDSpecified and UserIDSpecified, but these were always false.&lt;br /&gt;&lt;br /&gt;My initial investigations confirmed that it had something to do with the XmlSerializer creating the proxy - the proxy creates the *Specified property in order to handle nullable XML properties - but most of the googlespace didn't really specify what the fix for the issue was in the context of a DataContract.  I did a bit of reading though and discovered that for some data types, if you don't specify the IsRequired=true on the DataMember declaration, the proxy would assume they aren't used. &lt;br /&gt;&lt;br /&gt;So, if I change my DoSomethingRequest object to:&lt;br /&gt;[DataContract]&lt;br /&gt;public class DoSomethingRequest&lt;br /&gt;{&lt;br /&gt;   [DataMember(IsRequired=true)]&lt;br /&gt;   public int SomethingID {get;set;}&lt;br /&gt;   [DataMember(IsRequired=true)]&lt;br /&gt;   public int UserID {get;set;}&lt;br /&gt;   [DataMember(IsRequired=true)]&lt;br /&gt;   public string SomeText {get;set;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;then the *Specified properties aren't created, and the property values will get passed across the wire as you intend.&lt;br /&gt;&lt;br /&gt;This makes me happy, because I really don't like long lists of parameters for my methods when I can avoid them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-1528190587867825029?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/1528190587867825029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=1528190587867825029' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/1528190587867825029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/1528190587867825029'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/12/gotcha-using-complex-types-as-input.html' title='Gotcha: Using complex types as input parameters to a WCF service method'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-4418516741329291236</id><published>2008-11-19T10:56:00.002-06:00</published><updated>2008-11-19T11:12:02.262-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='model-view-viewmodel'/><title type='text'>Reinventing the wheel - Model-View-ViewModel Pattern</title><content type='html'>Sometimes reinventing the wheel is bad.  Other times though it provides a validation that you are actually thinking about something the right way (or at the very least in a common way).&lt;br /&gt;&lt;br /&gt;In Silverlight (and WPF for that matter) you have the ability to bind UI elements to business object elements in a "hot phone" kind of manner with no intermediate steps, thanks to Two-Way Binding and INotifyPropertyChanged.&lt;br /&gt;&lt;br /&gt;This creates both opportunities and issues - the opportunities being that you can avoid annoying iterative code to see what checkboxes a user selected on a form just by binding those checkboxes to a property on the underlying object, the issues being that for anything other than string type inputs, you don't have much opportunity to perform input validation before the application tries to stuff the input into the property.&lt;br /&gt;&lt;br /&gt;From here, it follows that we need to add properties to our bound object class that really don't have any meaning to the business object itself, and then to translate them before assigning them to the "real" properties.  If you're like me, this really bothers your sense of compartmentalizing responsibility.  Why should a business object have display-only properties.  NO! BAD!  So, it naturally follows to wrap the business class in something with all these display only properties.  The way I was doing it was to derive from the base class and call it "BindableMyObjectType".  I would use a combination of string properties and IValueConverters in the UI to determine how to map between the properties of one type and what the UI needed.&lt;br /&gt;&lt;br /&gt;But, it turns out there is an actual design pattern based on this concept called Model-View-ViewModel (not to be confused with Model-View-Controller or Model-View-Presenter or any of the other in the plethora of Model-View-* patterns.)  M-V-VM specifically provides a wrapper between the business object (model) and the XAML (view) that can have string versions of all the displayable properties and handle the validation.  This pattern doesn't derive the ViewModel from the Model but carries a reference to the Model instead.  &lt;br /&gt;&lt;br /&gt;Josh Smith has a &lt;a href="http://joshsmithonwpf.wordpress.com/2008/11/14/using-a-viewmodel-to-provide-meaningful-validation-error-messages/"&gt;good discussion of the pattern in his blog.&lt;/a&gt;  &lt;br /&gt;&lt;br /&gt;Even though my solution and the MVVM aren't identical, they're pretty similar and it was kind of nice to have a validation that my way of architecting Silverlight applications isn't coming out of nowhere.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-4418516741329291236?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/4418516741329291236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=4418516741329291236' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4418516741329291236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4418516741329291236'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/11/reinventing-wheel-model-view-viewmodel.html' title='Reinventing the wheel - Model-View-ViewModel Pattern'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-2455594338473322938</id><published>2008-11-17T16:52:00.000-06:00</published><updated>2008-11-17T17:13:43.177-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='datacontext vs. itemssource'/><title type='text'>DataContext vs. ItemsSource</title><content type='html'>I have seen a number of questions about these two common properties and I know it took me awhile to get them straight in my head too, so I figure it's a topic worth addressing.&lt;br /&gt;&lt;br /&gt;The DataContext property of a control allows you to specify a business object that will be the source for all the control bindings inside that control.  Yeah, I know that sounds really wordy.  So I will attempt to explain by example.&lt;br /&gt;&lt;br /&gt;Say I want to create a page that allows users to edit a customer's contact info.  It makes sense that most of the fields on that page are going to be bound to properties on some sort of Customer business object.  There might be a FirstName, LastName,  PhoneNumber, Address, City, State etc.  All are properties on the business object, all have a field in the form that are bound to them.&lt;br /&gt;&lt;br /&gt;In the old-school way of developing, we'd have to manually wire all these fields:&lt;br /&gt;txtFirstName.Text = customer.FirstName;&lt;br /&gt;txtLastName.Text = customer.LastName;&lt;br /&gt;ad nauseum, ad infinitum.&lt;br /&gt;&lt;br /&gt;But, with the DataContext, we don't have to do that.  If we put all our fields inside a layout element such as a Grid, we can set the DataContext of the *Grid* to our Customer object and then in the XAML specify which Customer object properties to bind to each control:&lt;br /&gt;&lt;br /&gt;(since I can't use brackets here, I am leaving them off... pretend they are there!)&lt;br /&gt;Grid x:Name="customerFields"&lt;br /&gt;...layout stuff...&lt;br /&gt;&lt;br /&gt;TextBox x:Name="txtFirstName" Text="{Binding Path=FirstName, Mode=TwoWay}"&lt;br /&gt;TextBox x:Name="txtLastName" Text="{Binding Path=LastName, Mode=TwoWay}"&lt;br /&gt;&lt;br /&gt;/Grid&lt;br /&gt;&lt;br /&gt;That's half the work right there.  The other half is of course setting the DataContext of the container, because without that the app won't know what object to look for "FirstName" or "LastName" on!&lt;br /&gt;&lt;br /&gt;Chances are you loaded your Customer object using a WCF service and have a method to handle the asyncronous callback like so:&lt;br /&gt;void proxy_LoadCustomerComplete(object sender, LoadCustomerCompleteEventArgs e)&lt;br /&gt;{&lt;br /&gt;   Customer c = new Customer (e.Result);  //handy-dandy way of getting a usable business object out of the returntype from the WCF service&lt;br /&gt;&lt;br /&gt;   customerFields.DataContext = c;&lt;br /&gt;&lt;br /&gt;   //Note - you probably want to save the customer "c" to a page level variable, not &lt;br /&gt;   // a method level variable... but this is just for demonstration.&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;That's all you have to do.  Because of the "Mode=TwoWay" tags I put on the binding, if I change the FirstName in the UI, it will automatically update it on the underlying business object, no code required.&lt;br /&gt;&lt;br /&gt;Ok, so what about ItemsSource?  ItemsSource is for collection based controls like ListBoxes, and it very specifically tells the control what collection to use to populate the items.&lt;br /&gt;&lt;br /&gt;So, if my form above has a State dropdown and a Country dropdown, the ItemsSource will need to point to a list of States and a list of Countries respectively.&lt;br /&gt;&lt;br /&gt;I can do this with a static resource for this purpose, because every customer probably has the same list of states and countries (unless they live in an alternate universe.)&lt;br /&gt;&lt;br /&gt;ListBox x:Name="StateList" ItemsSource="{StaticResource listOfStates}" SelectedItem="{Binding Path=State,Mode=TwoWay}"&lt;br /&gt;&lt;br /&gt;or I can do this in the code behind if I really want to...&lt;br /&gt;&lt;br /&gt;StateList.ItemsSource = someListOfStatesILoadedViaWCF;&lt;br /&gt;&lt;br /&gt;So how do ItemsSource and DataContext play nicely together?&lt;br /&gt;Well, in the example above we need them both for our StateList box.&lt;br /&gt;&lt;br /&gt;The ItemsSource tells it what states go in the list.  The DataContext tells it which state the Customer lives in (aka what business object the Binding Path maps to).&lt;br /&gt;&lt;br /&gt;Now, there are times where you will use a listbox without setting the DataContext. In the app I'm working on now I use listboxes for all sorts of crazy things, where the ItemsSource points to far more complex objects than a State property, and where I use the ListBoxItem's DataTemplate to display all that information for each item.  Often times the ListBox works more like a Grid than a traditional listbox, with several fields of data being displayed per line.  In these scenarios I can either two-way bind to a checkbox in the ListItemTemplate to handle "selection" or can use an external button to capture which items are selected.  The former is cleaner, IMO.&lt;br /&gt;&lt;br /&gt;So...for collection controls, ItemsSource = mandatory (or it will be empty!), DataContext is useful when the collection represents possible choices for a single-valued property of a larger business object but is not mandatory.&lt;br /&gt;&lt;br /&gt;Hope that helped!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-2455594338473322938?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/2455594338473322938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=2455594338473322938' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/2455594338473322938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/2455594338473322938'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/11/datacontext-vs-itemssource.html' title='DataContext vs. ItemsSource'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-7514614333693477482</id><published>2008-11-04T15:01:00.000-06:00</published><updated>2008-11-04T15:09:33.823-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight controls'/><category scheme='http://www.blogger.com/atom/ns#' term='databound tooltip'/><title type='text'>Databound Tooltips with custom templates</title><content type='html'>I have a requirement for basically a custom tooltip for items in a ListBox, where the data in the tooltip is specific to the individual items.&lt;br /&gt;&lt;br /&gt;Silverlight is very nice in that they give you the ability to customize your Tool Tips using the ToolTipService.ToolTip node, and then creating a template like you would any other data template.  But, if you set the Binding on individual elements as you would in the DataTemplate for the ListItem, it doesn't find the ItemSource.&lt;br /&gt;&lt;br /&gt;While googling this topic, I found a post &lt;a href="http://infosysblogs.com/microsoft/2008/06/silverlight_getting_tooltip_to.html"&gt;here&lt;/a&gt; that got me about 90% of the way there.  The original author was using a dummy text box in the ListItem DataTemplate to hold the data and then creating a ToolTip object and setting it at runtime when the container grid for his ListItem is loaded:&lt;br /&gt;&lt;br /&gt;private void Grid_Loaded(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;... create and set tooltip in codebehind.&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;But, there is a better way to do it...&lt;br /&gt;create the ToolTip in your XAML like you wanted to in the first place, specify the binding to the properties on the ToolTip just like you do on the rest of the DataTemplate...but then set the DataContext of the ToolTip to the ListItem's DataContext in your Grid_Loaded handler:&lt;br /&gt;private void Grid_Loaded (object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;   ToolTip t = ToolTipService.GetToolTip(sender as Grid) as ToolTip;&lt;br /&gt;   if(t!=null)&lt;br /&gt;   {&lt;br /&gt;      t.DataContext = (sender as Grid).DataContext;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;I would post full XAML for the DataTemplate w/ ToolTip declaration, but BlogSpot apparently strips out all xml carats and it's a big cluster.  I may need to move this blog elsewhere.  Harumph.  Anyway, your XAML will look exactly like what Atul was trying to do in the link above before he put the dummy text box in (but with the Loaded=Grid_Loaded declaration on the Grid surrounding the controls in the DataTemplate).&lt;br /&gt;&lt;br /&gt;Have fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-7514614333693477482?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/7514614333693477482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=7514614333693477482' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/7514614333693477482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/7514614333693477482'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/11/databound-tooltips-with-custom.html' title='Databound Tooltips with custom templates'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-4749683026550278318</id><published>2008-10-31T12:26:00.000-05:00</published><updated>2008-10-31T12:58:17.129-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TreeView'/><category scheme='http://www.blogger.com/atom/ns#' term='Toolkit'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='AutoCompleteBox'/><title type='text'>Silverlight Toolkit</title><content type='html'>Just in the off chance that someone who reads this doesn't read the main Silverlight.net site, a few days ago MS released the &lt;a href="http://www.codeplex.com/Silverlight"&gt;Silverlight Toolkit&lt;/a&gt; that contains a bunch of new controls for Silverlight development.  A couple of these I was quite in need of, namely the AutoCompleteBox and the TreeView.&lt;br /&gt;&lt;br /&gt;You can download the source code for these controls as well as just the binaries, and there are some decent examples included as well that illustrate the main functions you'd want to do.  There are a few little gotchas and things that don't work yet, of course.  But for the most part these are great and highly useful.&lt;br /&gt;&lt;br /&gt;AutoCompleteBox Gotcha #1 - The basic functionality of the textbox is well documented in the samples, so I won't do one from scratch here.  The main gist is, you can template the itemslist fueling  your AutoCompleteBox like you would a Silverlight ListBox but it is crucial that you override the "ToString()" method of whatever class your ListItems are bound to.  Why?  Because it is the "ToString()" value that will actually be entered in the box if you pick that option.&lt;br /&gt;&lt;br /&gt;For example, say my AutoCompleteBox contains a list of all company employees.  It's a REALLY big company, so big that there are actually TWO Anye Mercy's in it.  One works in London, and the other in Barcelona.  To know that I'm picking the right ListItem, I have my template showing both the employee's name and their location as such in the dropdown listbox by using 3 TextBlock objects:&lt;br /&gt;&lt;br /&gt;First Last (City)&lt;br /&gt;Anye Mercy (Barcelona)&lt;br /&gt;Anye Mercy (Lond0n)&lt;br /&gt;&lt;br /&gt;But, when I pick the London Anye Mercy, I only want the value in the AutoCompleteBox to say Anye Mercy and leave the London off.  Thus, in my Employee class I need to have ToString() return just FirstName + " " + LastName.&lt;br /&gt;&lt;br /&gt;It isn't really documented well that it is the ToString() value that is so crucial.  If you don't set ToString(), the AutoCompleteBox will take whatever text is in your template (and I'll be stuck with the (London)) after my name.&lt;br /&gt;&lt;br /&gt;AutoCompleteBox Gotcha #2:  This may go without saying but because it can be a stumping problem I will say it anyway.  Make sure there is enough room around your AutoCompleteBox inside its layout element to show the dropdownlist, if you have the AutoCompleteBox configured to show the items in the list, and make sure the MaxDropDownSize &gt; 0.  When I first copied the code from one of the examples into my project, the dropdown never showed up.  In the codebehind I could see it was binding properly to the ItemSource, but no autocomplete functionality was happening.  I moved that box all over the place before I finally started seeing the list, and the list was now showing up above the box.  So I somehow realized there had been an element in the way and eventually got it working.  There isn't really any sample code to go with it, it's just what happens when you get a really object-heavy layout.&lt;br /&gt;&lt;br /&gt;TreeView Gotcha #1 - You can use HierarchicalDataTemplates for your ItemsSources when you want different levels to have their own template.  This lets you bind the first level to a parent object, the second level to a collection of child properties on the parent etc.  But, Blend 2 SP1 won't render the object binding to them and will insist there is Invalid XAML.  There isn't - it will build in Visual Studio.  It's annoying nonetheless.&lt;br /&gt;&lt;br /&gt;TreeView Gotcha #2 - Although the TreeView &amp;amp; TreeViewItems expose events to allow you to perform "lazy loading" they aren't as of yet well designed to be used in combination with the HierarchicalDataTemplates listed above.&lt;br /&gt;&lt;br /&gt;For example, TreeViewItem exposes the "Expanded" event - so when a TreeViewItem is expanded you could theoretically load its children then, instead of preloading all children for all top level items etc.&lt;br /&gt;&lt;br /&gt;However, if you do not explicitly list your TreeViewItems, there does not seem to be a place to tie the Expanded event.  It's not exposed by HierarchicalDataTemplate.  &lt;br /&gt;I have a code snippet, but blogspot doesn't seem to have an option to allow you to enter code...it just shows up empty.  I'll have to see if I can find a setting to allow code insertion.  Grumble.&lt;br /&gt;&lt;br /&gt;I'm waiting for a reply from the Toolkit folks to my question about this.  Hopefully I'm just missing something.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-4749683026550278318?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/4749683026550278318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=4749683026550278318' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4749683026550278318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4749683026550278318'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/10/silverlight-toolkit.html' title='Silverlight Toolkit'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-8125552930569759923</id><published>2008-10-27T09:43:00.000-05:00</published><updated>2008-10-27T09:46:22.733-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='derived UserControls'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><title type='text'>Solution to derived usercontrols not loading in Blend</title><content type='html'>This is fixed in Blend 2 SP1, however there is a trick to it.&lt;br /&gt;In addition to all the obvious stuff, you have to add an XML namespace declaration in your AssemblyInfo.cs file:&lt;br /&gt;&lt;br /&gt;using System.Windows.Markup;&lt;br /&gt;...&lt;br /&gt;[assembly: XmlnsDefinition("http://schemas.microsoft.com/client/2007", "YourNamespace")]&lt;br /&gt;&lt;br /&gt;Now Blend will know how to open it.&lt;br /&gt;&lt;br /&gt;Tada!  Thanks go out to Yi-Lun Luo at Microsoft for the tip.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-8125552930569759923?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/8125552930569759923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=8125552930569759923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/8125552930569759923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/8125552930569759923'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/10/solution-to-derived-usercontrols-not.html' title='Solution to derived usercontrols not loading in Blend'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-4600591821684272010</id><published>2008-10-17T16:13:00.000-05:00</published><updated>2008-10-17T16:16:21.832-05:00</updated><title type='text'>Another short "gotcha" for Duplex communication</title><content type='html'>When you update the service reference to the service on your client, the app.config is replaced - removing your clientBaseAddress tag.  If you see a "port +:80 is listening to something else" message, you just need to put it back.&lt;br /&gt;&lt;br /&gt;ANNOYING!&lt;br /&gt;&lt;br /&gt;(This might not happen for web clients where you copy the app.config / output.config section into your web.config.  It does happen for WinForm clients though.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-4600591821684272010?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/4600591821684272010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=4600591821684272010' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4600591821684272010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/4600591821684272010'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/10/another-short-gotcha-for-duplex.html' title='Another short &quot;gotcha&quot; for Duplex communication'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-1257977595187782116</id><published>2008-10-17T07:56:00.000-05:00</published><updated>2008-10-17T07:57:22.406-05:00</updated><title type='text'>Update on Blend and Derived Controls</title><content type='html'>According to a post at silverlight.net, this has been fixed in Blend 2 SP 1.  Yay!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-1257977595187782116?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/1257977595187782116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=1257977595187782116' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/1257977595187782116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/1257977595187782116'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/10/update-on-blend-and-derived-controls.html' title='Update on Blend and Derived Controls'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-1955739612331194341</id><published>2008-10-16T22:37:00.000-05:00</published><updated>2008-10-16T23:16:33.909-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='duplex communication'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Duplexes aren't just residential units anymore</title><content type='html'>There are several ways to call a WCF service.&lt;br /&gt;&lt;br /&gt;1) Synchronously - Ask for data, wait for response.  Most "traditional" methods are synchronous,  Ex.&lt;br /&gt;public int GetIDByName(string name) {...&lt;br /&gt;&lt;br /&gt;Since this will hold up your application until a response is returned, you want to use it sparingly.&lt;br /&gt;Oh, except for if you're calling from Silverlight, which actually will execute these seemingly synchronous operations asynchronously anyway!&lt;br /&gt;&lt;br /&gt;2) Asynchronous Fire &amp;amp; Forget - Use this when you don't NEED a response.&lt;br /&gt;Ex.&lt;br /&gt;public void DoSomethingAndLeaveMEOutOfIt() {...&lt;br /&gt;You can use most bindings for these - basicHttpBinding, wsHttpBinding, netTcpBinding...have at it! (To see a list of all the bindings and when to use them... go &lt;a href="http://msdn.microsoft.com/en-us/library/ms730879.aspx"&gt;here&lt;/a&gt;.)&lt;br /&gt;&lt;br /&gt;3) Asynchronous Fire &amp;amp; Forget Pairs - This is the first of two methods that allow the original asynchronous caller to be notified when the recipient has finished with its service call.   Fire &amp;amp; forget "pairs" refers to having both the "client" and the "service" define asynchronous service contracts.  The "client" calls an asynchronous service method on the "service", and when the service is done, it calls an asynchronous service method on the "client".  So in reality, both the client (initiator) and service (recipient) are WCF services and have to be configured as such.  Meaning, you have to add a service reference to the CLIENT on the SERVER as well as the normal method of adding the service reference for the service to the client.  These two services can be modified independently of each other - you just have to update the service reference on the other if you change the signature.&lt;br /&gt;&lt;br /&gt;These also can use pretty much any binding.&lt;br /&gt;&lt;br /&gt;4) Duplex communication - This is the other way you can notify a client that a service call is complete.  In this case, the service defines a callback interface (with a specific callback method), and the client must implement that interface.  Here, the service drives it all - and doesn't need to know at design time which clients are going to be calling it.  It just publishes its interface and says "Take me if you want me! Free to good home!"&lt;br /&gt;&lt;br /&gt;If you want to do duplex communication with an http binding, you need to use DualHttpBinding. (NetTcpBinding, NamedPipes etc. already support duplex, you don't need a special binding for the other protocols.)&lt;br /&gt;&lt;br /&gt;There are lots of good examples online for how to implement each of these patterns, including the Duplex communication pattern, so I won't reiterate that here.  But, I found a lot more gotchas with the duplex pattern than the synchronous or fire &amp;amp; forget methods so I will mention a couple of them here.&lt;br /&gt;&lt;br /&gt;1)  Specify the baseClientAddress in the client's web.config to use a specific, out-of-the-way port.  If you don't specify a port at all, it will attempt to use port 80 which is already reserved.  If you specify common ports, you might hit a conflict there as well.  The first time I tried doing this I started with port 8001.  I had issue #2 described below.  Tried 8002, same thing.  Today I created a new service and started with 8022, and didn't have a problem at all.  Go figure.&lt;br /&gt;&lt;br /&gt;2)  Sometimes you'll get an error stating that you don't have permission to listen on a specific port.  This is the gotcha that I'm still in the process of finding a good solution for.  All the searching I did had what appeared to be a supported utility for vista, but for xp it involved writing some cryptic Active Directory script to assign the port to the appropriate process.  But, none of the documentation actually told you how to form the cryptic command.  I found one .NET application someone had created to automatically do it for you, but it had a lot of bugs and didn't *unregister* the listener correctly - so I ended up only being able to use each port once.&lt;br /&gt;&lt;br /&gt;On my to-do list is to go through the code for that utility to figure out what it is actually doing and then see if I can figure out how to undo it.  I think the ideal solution is to have your application register to listen on the port and then unregister when needed.&lt;br /&gt;&lt;br /&gt;But, as I said, I didn't hit this error today when I created a service for port 8022.  I would really like to know what is so different about 8001, 8002 and 8022.&lt;br /&gt;&lt;br /&gt;3.  This may be obvious, but make sure your proxy &amp;amp; callback class will still be "alive" to receive the callback.  Instantiating your proxy in a button click handler as a local method variable is probably not the way to go... define a class level variable for the proxy, then instantiate and call its operations from wherever in the class you like.  (This advice holds not only for WCF but for objects that you databind to Xaml elements in Silverlight with intended two-way communication... another topic.)&lt;br /&gt;&lt;br /&gt;Conversely, be very wary of making the proxy static (as I've seen a number of tutorials do)  -- if there is a problem and the proxy's state goes to "fault", you can't recover from that without restarting the application because a faulted proxy cannot become "unfaulted" and a static member ain't going anywhere any time soon.  (I banged my head against the desk several times over this issue the first day I worked on the duplex service.)  If you MUST have only a single proxy for everything, you could always implement some sort of singleton pattern that checks the single proxy instance for validity and recreates it if it is faulted.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-1955739612331194341?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/1955739612331194341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=1955739612331194341' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/1955739612331194341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/1955739612331194341'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/10/duplexes-arent-just-residential-units.html' title='Duplexes aren&apos;t just residential units anymore'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-3136072554642385662</id><published>2008-10-15T15:05:00.000-05:00</published><updated>2008-10-15T15:23:10.415-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='best practices'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='cross-domain policy'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>About testing Silverlight / WCF services</title><content type='html'>Although on the surface it seems convenient to just add the WCF services to the WebSite that you are using to test your Silverlight application (as is done in 90% of the tutorials out there) I've found that decoupling the services into a separate site is a Very Good Idea for a very simple reason.&lt;br /&gt;&lt;br /&gt;When you add the service reference to your Silverlight application, the location of the service is stored in a file called ServiceReferences.ClientConfig as XML (like most *.config files).  When you compile the WebSite that is hosting your Silverlight application, the WebSite doesn't copy the ServiceReferences.ClientConfig file in plain text.  I am presuming it is built into the .xap file somehow. &lt;br /&gt;&lt;br /&gt;So, if the Silverlight application references WCF that exist in the same WebSite as the hosting one, when you deploy the WebSite, you will find a chicken and egg problem.  The website address has now changed from the debugger address (usually http://localhost:####/appname) to something else.  This invalidates the information from the Silverlight project's service configuration, and will result in a great big nothing when the proxy tries to connect to the service.  But, if you change the location of the service before you deploy it, your Silverlight app won't compile.  Hence the chicken and egg problem.&lt;br /&gt;&lt;br /&gt;Luckily, the solution is simple, though requires a little more logistics.&lt;br /&gt;1)  Create a separate website (not the one you are testing your application from) for your Silverlight-enabled WCF and publish it to host in IIS (so you have a static address, even if that address is "localhost").&lt;br /&gt;2)  From your Silverlight application, discover the PUBLISHED site.&lt;br /&gt;3)  Add a clientaccesspolicy.xml file to the ROOT of your PUBLISHED site.  (This means, if like me you stick these in your local IIS under "Default Web Site/SomeVirtualDirectory", you have to put the clientaccesspolicy.xml file in inetpub\wwwroot (or wherever your Default Web Site points).  Putting it in the virtual directory root won't help you one iota.  For a great discussion of getting cross-domain policies in place (as well as non-secure to secure service calls), go &lt;a href="http://timheuer.com/blog/archive/2008/10/14/calling-secure-services-with-silverlight-2-ssl-https.aspx"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Now you can build your application website separately from your WCF services.  Working on your services will require an extra step (publishing) before your Silverlight client can use them, but this isn't too big a deal.&lt;br /&gt;&lt;br /&gt;And, when you are done developing and want to publish your WCF service site to a test or production server, you can do that: just rediscover the service from your Silverlight application at its new location and rebuild all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-3136072554642385662?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/3136072554642385662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=3136072554642385662' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/3136072554642385662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/3136072554642385662'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/10/about-testing-silverlight-wcf-services.html' title='About testing Silverlight / WCF services'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-5318451413575409002</id><published>2008-10-15T09:24:00.000-05:00</published><updated>2008-10-15T09:57:52.739-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='derived UserControls'/><category scheme='http://www.blogger.com/atom/ns#' term='Navigation'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Expression Blend'/><title type='text'>Silverlight Navigation, Expression Blend 2.5  &amp; "base" UserControls</title><content type='html'>Silverlight doesn't natively handle redirection between XAML pages as simply as ASP.NET does.&lt;br /&gt;In ASP.NET, you simply Response.Redirect(url) your way to where you want to go (or Server.Transfer if you want to keep your headers, but that's a topic for another blog).  In Silverlight you have one core App.xaml per application that is the first thing that loads when you hit a page hosting a Silverlight application, and that App.xaml has one and only one child - the "rootVisual".&lt;br /&gt;&lt;br /&gt;In the Application_Startup handler of App.Xaml, by default the rootVisual will be set to the default Page.xaml that was created for you when you created the Silverlight application. &lt;br /&gt;&lt;br /&gt;So - what happens when you want to show AnotherPage.xaml?  You have several options.&lt;br /&gt;&lt;br /&gt;1)  Make a new Silverlight application with a new Page.xaml, sitting on a different ASPX page, and redirect to it.  Survey says - no way, Jose.  Now you have no common application state, and a lot more overhead, and a generally unmaintainable mess.  Skip to the next option...&lt;br /&gt;&lt;br /&gt;2)  Embed all your *.xaml UserControls on Page.xaml and hide / show them as needed using Visibility.Collapsed / Visibility.Visible.  Survey says -  not usually the best way to handle things, unless you have only a very small number of pages, and will never have more.  Having all this content loaded (Collapsed &lt;&gt; Not Loaded) is very heavy, and embedding controls on a page isn't very extensible.  I always err on the side of making something more extensible than we need as long as it doesn't become ridiculous ( I have seen some examples of ridiculous attempts to create extensibility, but that too is for another blog post).&lt;br /&gt;&lt;br /&gt;3)  Create a single "Frame" to host whatever UserControl is currently en vogue, and to control navigating between them.  Survey says - ding ding! We have a winner!  For full disclosure, this is not my brand-spanking-new idea - many other people are doing similar things &lt;a href="http://blogs.msdn.com/dphill/archive/2008/10/07/silverlight-navigation-part-1.aspx"&gt;here&lt;/a&gt; and &lt;a href="http://dotnetslackers.com/Silverlight/re-142111_Page_Navigation_for_Silverlight_2_RC0.aspx"&gt;here&lt;/a&gt; and &lt;a href="http://nerddawg.blogspot.com/2008/06/pages-in-silverlight.html"&gt;here&lt;/a&gt;.  One commonality these projects have is that each "page" uses a base class derived from UserControl that declares common navigation related functions.&lt;br /&gt;&lt;br /&gt;Having a common base page isn't a new concept either - it's a great way to provide access to session information and commonly used properties and methods.  Most of my ASP.NET projects define a BasePage class that inherits from System.Web.UI.Page, and that has functions for exception management, security checks, and other fun things.&lt;br /&gt;&lt;br /&gt;But, in Silverlight there seems to be a catch to this pattern - Expression Blend won't load the derived UserControl.  It throws an error "Invalid XAML - Cannot add content to an object of type BaseUserControl".  It seems to me Blend should be able to detect that the classes being loaded *derive* from UserControl, there's a whole .NET API around Type. &lt;br /&gt;&lt;br /&gt;Maybe this is fixed in the Blend 2 SP1 release / Silverlight RTW.  I'm stuck on Beta 2 though until The Powers That Be authorize the expenditure for the released version of Blend. *twiddles thumbs*&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-5318451413575409002?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/5318451413575409002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=5318451413575409002' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/5318451413575409002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/5318451413575409002'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/10/silverlight-navigation-expression-blend.html' title='Silverlight Navigation, Expression Blend 2.5  &amp; &quot;base&quot; UserControls'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8211114181061311464.post-2081093731778146841</id><published>2008-10-14T17:24:00.000-05:00</published><updated>2008-10-14T17:33:01.722-05:00</updated><title type='text'>Greetings, blogosphere</title><content type='html'>You know, I've been tempted to start a tech blog for years, every time I figured out something really nifty.  But, I never did manage to find that round tuit.  Until now.&lt;br /&gt;&lt;br /&gt;I've spent the last few months neck deep in Silverlight and WCF, and it's been fun and frustrating at the same time.  Often times I've tried to figure out how to do something, failed, googled, discovered 30 links to the same tutorial, experimented and eventually gotten it down.  Here I hope to add to the general knowledge base by sharing what I've done.&lt;br /&gt;&lt;br /&gt;So who am I?  I've been a .NET / SQL Server developer since .NET was in beta and a Java, VB6, ASP developer before that.  I've worked both in consulting and in-house for independent software vendors.  I've focused almost exclusively on web development (not so much with WinForms) but have tried to make database development as big a priority (since I firmly believe in the "garbage in, garbage out" theory.)  I've been fortunate enough to be able to lead almost all of my projects for the last four years or so, and have done a number of "solo" gigs which required me to wear a lot of hats.  So I'm just as comfortable with datagrids as I am with DataSets as I am with databases. &lt;br /&gt;&lt;br /&gt;My topics are likely to revolve around Silverlight, WCF, and general best practices, because those are what is on my mind the most these days.  I hope you enjoy and find them useful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8211114181061311464-2081093731778146841?l=anyedotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anyedotnet.blogspot.com/feeds/2081093731778146841/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8211114181061311464&amp;postID=2081093731778146841' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/2081093731778146841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8211114181061311464/posts/default/2081093731778146841'/><link rel='alternate' type='text/html' href='http://anyedotnet.blogspot.com/2008/10/greetings-blogosphere.html' title='Greetings, blogosphere'/><author><name>Anye</name><uri>http://www.blogger.com/profile/12144293543543807815</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
