<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Blah, Blah, Blah, Blog</title><link>http://www.foxwiz.com:80/blog</link><description>Blah, Blah, Blah, Blog</description><item><title>Orchard Publishing SNAFU</title><link>http://www.foxwiz.com:80/blog/orchard-deployment-snafu</link><description>&lt;p&gt;I recently spent several hours over the course of a couple of days trying to figure out why my first Orchard deployment was failing.&lt;/p&gt;
&lt;p&gt;To create an Orchard CMS site, I downloaded and installed &lt;a target="_blank" title="Download Webmatrix" href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5b9510a1-bc42-4323-90ab-adf4daaaa2f0"&gt;WebMatrix&lt;/a&gt;, a free web development tool designed to aid anyone in creating a website (painlessly, in just a couple of minutes).&lt;/p&gt;
&lt;p&gt;Upon  startng WebMatrix, the four options shown below are available.    Orchard  CMS was one of 120 website frameworks that were available from    the Web  Gallery when I selected the "Site From Web Gallery" option.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/Media/Default/Blogs/GettingStartedWithCMS/Image1.png" height="393" width="720" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Opening Screen in WebMatrix&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/Media/Default/Blogs/GettingStartedWithCMS/Image2.png" height="561" width="757" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Web Gallery offerings for website templates/frameworks&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;After  pressing "Next" and following the directions, I quickly had   the shell  of the new FoxWiz Solutions site installed and was ready to   start trying  to learn how to actually create some viable content.&lt;/p&gt;
&lt;p&gt;As I stated in another blog , it took me several hours before I started to   really "get Orchard",  but once I did, I was able to enable and configure   modules for the basic  site pages &amp;amp; navigation and to implement a   significant amount of the  core functionality that I felt I would need for the site.   Of course, I did some  experimenting, started to sift through some   source code, and began to get  a feel for what Orchard was all about   under the hood. Additionally, I  played with Themes and "rewound the   tape" with respect to CSS. This  allowed me to modify an existing theme   (from &lt;a target="_blank" href="http://www.continuum.tv"&gt;continuum - rich media lab&lt;/a&gt;) to meet my needs with respect to "look and feel".&lt;/p&gt;
&lt;p&gt;Finally, I was ready to publish the Orchard site to see how it reacted in the real world. I came across a &lt;a target="_blank" title="Deploying an Orchard site using WebMatrix" href="http://www.youtube.com/watch?v=r5XCKylOdbI&amp;amp;feature=related"&gt;great video&lt;/a&gt; that I recommend you watch if you have questions about publishing the    site. It's comprehensive and easy to follow. Everything works perfectly    for the presenter and he shows how absolutely simple deployment is.&lt;/p&gt;
&lt;p&gt;Unless you're me....&lt;/p&gt;
&lt;p&gt;I  followed along with the presenter and did everything he did (even   to  the extent that I selected the same hosting company for my   deployment).  Since then, I've opted to go with &lt;a target="_blank" title="Awesome.net Hosting Provider" href="http://www.awesome.net/"&gt;Awesome.net&lt;/a&gt; who are also one of the three options in his demo. It's been a long    time since I have been as impressed by any company as I was with the    support staff of this hosting company. Despite the fact that I was    taking advantage of their free cloud offering to test a beta product,    they bent over backwards to provide some of the most incredible customer    service ever. I can't recommend them any higher...but, I digress.&lt;/p&gt;
&lt;p&gt;At  the point in the presentation where the speaker is wrapping up   and  basically saying, "Now wasn't that a piece of cake?" I was staring   at  the stack trace below wondering why nothing ever goes as planned.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
Unable to publish. Unable to invoke or execute Web Deploy provider: iisApp. The provider is not enabled or was unable to execute commands on the server. Contact your server administrator for assistance.
Error detail:
(5/19/2011 8:17:17 PM) An error occurred when the request was processed on the remote computer.
   at Microsoft.Web.Deployment.StatusThreadHandler.CheckForException()
   at Microsoft.Web.Deployment.PackageSerializer.CheckForErrorOrCancel()
   at Microsoft.Web.Deployment.PackageSerializer.SerializeSingleObject(DeploymentObject obj, Int32 parentId)
   at Microsoft.Web.Deployment.PackageSerializer.SerializeChildrenDepthFirst(SerializeObjectContext objectContext)
   at Microsoft.Web.Deployment.PackageSerializer.SerializeChildren(SerializeObjectContext objectContext)
   at Microsoft.Web.Deployment.PackageSerializer.SerializeChildrenDepthFirst(SerializeObjectContext objectContext)
   at Microsoft.Web.Deployment.PackageSerializer.SerializeChildren(SerializeObjectContext objectContext)
   at Microsoft.Web.Deployment.PackageSerializer.SerializeChildrenDepthFirst(SerializeObjectContext objectContext)
   at Microsoft.Web.Deployment.PackageSerializer.SerializeChildren(SerializeObjectContext objectContext)
   at Microsoft.Web.Deployment.PackageSerializer.SerializeChildrenDepthFirst(SerializeObjectContext objectContext)
   at Microsoft.Web.Deployment.PackageSerializer.SerializeChildren(SerializeObjectContext objectContext)
   at Microsoft.Web.Deployment.PackageSerializer.SerializeChildrenSyncFirst(SerializeObjectContext objectContext)
   at Microsoft.Web.Deployment.PackageSerializer.SerializeChildren(SerializeObjectContext objectContext)
   at Microsoft.Web.Deployment.PackageSerializer.SerializeChildrenSyncFirst(SerializeObjectContext objectContext)
   at Microsoft.Web.Deployment.PackageSerializer.SerializeChildren(SerializeObjectContext objectContext)
   at Microsoft.Web.Deployment.PackageSerializer.SerializeChildrenSyncFirst(SerializeObjectContext objectContext)
   at Microsoft.Web.Deployment.PackageSerializer.SerializeChildren(SerializeObjectContext objectContext)
   at Microsoft.Web.Deployment.PackageSerializer.Serialize(DeploymentObject obj)
   at Microsoft.Web.Deployment.AgentClientProvider.RemoteDestSync(DeploymentObject sourceObject, DeploymentSyncContext syncContext)
   at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable)
   at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
   at Microsoft.Web.Deployment.DeploymentObject.SyncTo(String provider, String path, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
   at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentWellKnownProvider provider, String path, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
   at Microsoft.WebMatrix.Deployment.MsDeployWorker.Execute(Boolean pullback)
Attempted to perform an unauthorized operation. iisApp http://go.microsoft.com/fwlink/?LinkId=178034&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In addition to the stack trace that was served when I attempted to   publish, there was another symptom that raised it's head. I can't   display that error here because I've already resolved the issue but, I   can describe it.&lt;/p&gt;
&lt;p&gt;During the video, the presenter describes how to  use WebMatrix to  add a connection string to the site configuration file  (web.config). He  also walks us through how to change the connection  information in the  website settings so that the remote, hosted SQL  Server database can be  created during the deployment. Well, when I  completed loading the  publishing settings from the file that is obtained  from the hosting  company (see video), instead of just a single database  connection, my  deployment settings displayed two databases; one for the  local database  and one for the remote database. The only way to resolve  that issue  was to comment out the connection string in the  configuration file.  When I did that, my screen looked like his screen.&lt;/p&gt;
&lt;p&gt;I  contacted the support team at Awesome.net and they immediately got   involved in trying to resolve the issue. Towards this end, they   attempted (successfully) to deploy an Orchard site using the settings   that I'd retrieved from them when I defined the hosted site. To me, this  pointed to a versioning issue. I suspected that,  perhaps, I didn't  have the correct version of WebMatrix (despite the  fact that I'd just  downloaded it from Microsoft). The version I had was  "1"; no minor  version, no build number. Just plain "1". From what I could determine  this was the latest and  greatest (and only) version.&lt;/p&gt;
&lt;p&gt;When I looked at Orchard, I found, though, that  there was a more  current version. I was running version 1.0 but the current version was  1.1.30. Why WebMatrix  installed an older version than the most current  is a mystery to me and  hopefully, that will be resolved in the future.  In defense of the Orchard team, the dashboard does alert the user about  the version currency, but I obviously didn't pay attention to it. As  soon as I followed the &lt;a target="_blank" title="Upgrading Orchard" href="http://orchardproject.net/docs/Upgrading-a-site-to-a-new-version-of-Orchard.ashx"&gt;instructions on how to facilitate the upgrade&lt;/a&gt;, my issue was resolved and my deployment was as painless as that in the video.&lt;/p&gt;
&lt;p&gt;&lt;img src="/Media/Default/Blogs/GettingStartedWithCMS/Image3.png" height="214" width="471" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Orchard CMS version information from the Dashboard&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps someone!&lt;/p&gt;
&lt;p&gt;~D&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description><pubDate>Fri, 16 Dec 2011 02:01:00 GMT</pubDate><guid isPermaLink="true">http://www.foxwiz.com:80/blog/orchard-deployment-snafu</guid></item><item><title>A Facelift Using Orchard CMS</title><link>http://www.foxwiz.com:80/blog/getting-started-with-orchard-cms</link><description>&lt;p&gt;Okay. I've finally started to upgrade the FoxWiz Solutions website after almost 12 years of no maintenance whatsoever. I'm sure that many folks to whom I've given my email address have come out to the site and been extremely underwhelmed by what they saw. Truth is, web development has never been my forte. Actually, I find it tedious and don't really have the passion for it that I have for desktop applications. That's a nice way of saying I hate to develop web UIs.&lt;/p&gt;
&lt;p&gt;Client-side scripting? Code behind? Flash or no Flash? CSS that works in IE but not in Mozilla (or the reverse)? Use tables? Don't use tables? AJAX? Managing state in a stateless model? Not to mention the complexities associated with debugging. Just too many moving parts for my tastes. Also, despite the evolution of the tools, I've never seen a web interface that delivers the same rich, performant user-experience that a Winform or WPF application delivers. Then again, I haven't kept up on the most recent advances so I'm not going to be one to judge. I have colleagues who are apparently doing some pretty incredible things with Silverlight. I'm just not one of them. After all, there's plenty of work for a guy like me who enjoys architecting a robust set of services or designing the ultimate OLTP or OLAP data model.&lt;/p&gt;
&lt;p&gt;Still, the site needed to be updated. Everytime I felt like I was ready to immerse myself into revamping it, something else would come up to divert my attention; like taking a nap or doing laundry.&lt;/p&gt;
&lt;p&gt;Finally, like many folks, I figured I would just farm the work out to someone who actually &lt;em&gt;likes &lt;/em&gt;doing web development. After all, there are multitudes of web shops where young webmasters churn out robust sites using the magic in their toolboxes. All I needed was a simple site that would allow me to start blogging about what I think I know, share some of my experiences, and allow me to continue to make some developer tools and products available to folks who will hopefully throw a little cash my way. How hard could that be??? At a minimum, I would have a code base that I could alter and evolve to fit my needs.&lt;/p&gt;
&lt;p&gt;So, I approached a colleague and asked for his help/recommendations. He's a younger guy who stays on the cutting edge of the changes in the toolkits and basically told me he could set something up for me in "no time". And, he did. Now, mind you, I was expecting a VS solution containing the typical ASPX and HTML files and the like. I expected everything would work and I could go in behind him and make any changes I wanted and integrate some of the services that the site would need to work with.&lt;/p&gt;
&lt;p&gt;What I received a couple days later was a site built on top of &lt;a title="Orchard Project" href="http://www.orchardproject.net/"&gt;Orchard CMS&lt;/a&gt;. I don't do enough Sharepoint administration to know whether the comparison is accurate, but for my money, Orchard seems like an open-source "Sharepoint Light". That's not what I was expecting, so I didn't think it was what I wanted/needed. Now, I would have to figure out how to manipulate widgets and modules and content types and the like in order to make the site serve my needs. Also, I would have to guess what the code was doing behind the scenes in order to connect different moving parts to achieve my end goals. As if I have time for all of that, right?&lt;/p&gt;
&lt;p&gt;I thanked my friend and stashed the code away and went on with life and work while the old site remained up and running and serving as an eyesore on the internet.&lt;/p&gt;
&lt;p&gt;Now, I have a lot of respect for the friend who gave me the original Orchard site. He really does keep his finger on the pulse of current development patterns and practices. Finally, I decided to commit myself to a few hours of trying to understand what he had given me and why he was so impressed by it. There had to be a reason...&lt;/p&gt;
&lt;p&gt;After the first couple of hours of trying to figure out how to configure the product, I called my friend and told him that it would surely make sense from a productivity perspective for me to just build the site the old fashioned way because I felt like I was wasting a lot of time. Something in the way that he agreed with me made me decide to keep going.&amp;nbsp; After another couple of hours of reviewing the extremely limited information about this beta product and building a site on my own, I started to have those "Ah Ha!" moments that we all hope for. Suddenly, it all (&lt;em&gt;well, not all, but some of it&lt;/em&gt;) started to make sense. Orchard is a platform that is not unlike the frameworks that many of us have developed over the course of our careers. (I have been using mine, RapidApp, since the early 80s. It's never been released for sale or share because I've never had the time to document the 100s of thousands of lines of code that enable me to rapidly churn out my solutions).&lt;/p&gt;
&lt;p&gt;A strength of Orchard lies in the many different modules that are available and continue to be developed to plug into the platform. Like this blogging module, for example. To add blogging to the site, I literally went into the site dashboard (control panel) and enabled the Blog module. Voila, I'm blogging! The full source code for that module is contained in the VS solution that comprises this site giving me complete access to understand what is going on under the hood. This is great! (Especially when one considers that there is a bug in the Blog module that caused me to have to restart this post twice before I realized there was an issue that was not caused by the man in front of the keyboard. Presumably, I'll be able to debug later, fix the issue, and report it to the cooperative that is managing this open source project.).&lt;/p&gt;
&lt;p&gt;So, I think I can safely state that I'm sold...so far. There are still some lingering questions as to how I'm going to integrate with PayPal and my WCF services, but I'm sure that's just going to come down to my becoming more familiar with the platform. I'm guessing that when I know what a widget is and what the difference between a Container and a Containable Part is, I'll be well on my way to having a hold on this very powerful product. The biggest challenge will be finding documentation that can help a newbie out. As I stated before, the documentation and information is extremely weak. I guess that's to be expected considering the beta status of the product. There are lots of modules out there but rarely any instructions on how to configure the modules so that they can be used. I'm sure that will change. I plan to continue exploring the product as a naive beginner and will share my experiences here. If not so that someone else can benefit from my experiences, then as a reference for me when I build my next site on Orchard CMS.&lt;/p&gt;
&lt;p&gt;~D&lt;/p&gt;</description><pubDate>Sun, 25 Sep 2011 03:16:26 GMT</pubDate><guid isPermaLink="true">http://www.foxwiz.com:80/blog/getting-started-with-orchard-cms</guid></item><item><title>Identifying ADO.NET Constraint Exceptions</title><link>http://www.foxwiz.com:80/blog/resolving-data</link><description>&lt;p&gt;ADO.NET constraint violations can occur as a result of a number of reasons including invalid foreign key references between a parent and child table (meaning orphans exist in the child table) and null violations when a value isn't provided for a column that prohibits null values.&lt;/p&gt;
&lt;p&gt;For me, the latter happens from time to time when a field in a strongly-typed dataset has been named incorrectly and will never be populated or the field is not returned by the fetch statement that fills that table. Often times, it can be a bit of a pain to determine which record or records caused the ConstraintException. I use the following dataset extension method to retrieve a friendly list of those violations. Typically my strongly typed dataset will raise an event from the catch block to allow the list of messages to be served to the consumer. At a minimum, a breakpoint in the catch makes reviewing and rectifying the situation relatively painless.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
/// &amp;lt;summary&amp;gt;
/// Extracts a list of row error messages from a datatable.
/// &amp;lt;/summary&amp;gt;
/// &amp;lt;param name="dt"&amp;gt;Reference to the DataTable being interrogated&amp;lt;/param&amp;gt;
/// &amp;lt;returns&amp;gt;List of error messages&amp;lt;/returns&amp;gt;
public static List&amp;lt;string&amp;gt; GetConstraintExceptionMessages(this DataTable dt)
{
	List&amp;lt;string&amp;gt; rowErrorMessages = new List&amp;lt;string&amp;gt;();
	rowErrorMessages.AddRange(dt.Rows.Cast&amp;lt;DataRow&amp;gt;()
		.Where(r =&amp;gt; r.HasErrors)
		.Select(r =&amp;gt; string.Format("{0} [{1}]", r.RowError, r.GetType().ToString())));

	return rowErrorMessages;
}


/// &amp;lt;summary&amp;gt;
/// Extracts a list of row error messages from a dataset.
/// &amp;lt;/summary&amp;gt;
/// &amp;lt;param name="ds"&amp;gt;Reference to the DataSet being interrogated&amp;lt;/param&amp;gt;
/// &amp;lt;returns&amp;gt;List of error messages&amp;lt;/returns&amp;gt;
public static List&amp;lt;string&amp;gt; GetConstraintExceptionMessages(this DataSet ds)
{
	List&amp;lt;string&amp;gt; rowErrorMessages = new List&amp;lt;string&amp;gt;();
	foreach (DataTable dt in ds.Tables)
		rowErrorMessages.AddRange(dt.GetConstraintExceptionMessages());

	return rowErrorMessages;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Usage:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
DataSet ds = new DataSet() ;
try
{
	ds.EnforceConstraints = false;

	//Fill the dataset and perform any additional operations

	ds.EnforceConstraints = true;
}
&lt;strong&gt;
catch (System.Data.ConstraintException)
{
	List&amp;lt;string&amp;gt; errorMessages = ds.GetConstraintExceptionMessages();
	throw;
}
&lt;/strong&gt;
catch (Exception)
{
	throw; //non constraint exception
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I've been a big fan of extension methods (over static helper classes) since they were introduced because there's no need to try to remember which helper contains the needed functionality. Instead, the extension method acts as a form of encapulation through its association to the type for which it was written.&lt;/p&gt;
&lt;p&gt;~D&lt;/p&gt;</description><pubDate>Thu, 26 May 2011 02:36:10 GMT</pubDate><guid isPermaLink="true">http://www.foxwiz.com:80/blog/resolving-data</guid></item></channel></rss>
