Steve Smith's Blog

Musings on Software and the Developer Community

ASP.NET MVC 2 and Windows Azure

If you upgrade an Azure web instance to use ASP.NET MVC 2, make sure you mark the System.Web.Mvc reference as Copy Local = true.  Otherwise, your deployment will fail.  And you won’t get any good feedback from Windows Azure as to the cause of the problem.  So you’ll start searching the web for help, and perhaps you’ll stumble on this post, and you’ll realize that you didn’t set Copy Local = true on your System.Web.Mvc assembly reference in your ASP.NET MVC 2 web instance.  And...

ASP.NET MVC 2 and Windows Azure →

Posted on Wednesday, 17 March 2010         No Comments

Simple Branching and Merging with SVN

It’s a good idea not to do too much work without checking something into source control.  By “too much work” I mean typically on the order of a couple of hours at most, and certainly it’s a good practice to check in anything you have before you leave the office for the day.  But what if your changes break the build (on the build server – you do have a build server don’t you?) or would cause problems for others on your team if they get the latest code?  The solution with Subversion...

Simple Branching and Merging with SVN →

Posted on Tuesday, 16 March 2010         No Comments

Fix: SqlDeploy Task Fails with NullReferenceException at ExtractPassword

Still working on getting a TeamCity build working ( see my last post ).  Latest exception is: C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets(120, 5): error MSB4018: The "SqlDeployTask" task failed unexpectedly. System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Data.Schema.Common.ConnectionStringPersistence.ExtractPassword(String partialConnection, String dbProvider) at Microsoft.Data...

Fix: SqlDeploy Task Fails with NullReferenceException at ExtractPassword →

Posted on Wednesday, 10 March 2010         1 Comment

Could Not Load Type Microsoft.Build.Framework.BuildEventContext

Setting up a TeamCity build and got this error: C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets(80, 5): error MSB4018: The "SqlSetupDeployTask" task failed unexpectedly. System.TypeLoadException: Could not load type 'Microsoft.Build.Framework.BuildEventContext' from assembly 'Microsoft.Build.Framework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. at Microsoft.Build.BuildEngine.TaskExecutionModule.SetBatchRequestSize...

Could Not Load Type Microsoft.Build.Framework.BuildEventContext →

Posted on Wednesday, 10 March 2010         2 Comments

Fix: Can’t Change or Remove Visual Studio 2008 from DVD

If you installed Visual Studio 2008 on a 64-bit operating system, you may have trouble when you try ad add or remove functionality by inserting the disk (or remounting the ISO image).  I believe this is because of the path used to install the 32-bit Visual Studio program.  When you run the setup.exe off of the disk, you get this: Clicking on Change or Remove Visual Studio 2008 brings up this dialog: But not long after it appears, it disappears to be replaced with: Microsoft Visual Studio...

Fix: Can’t Change or Remove Visual Studio 2008 from DVD →

Posted on Monday, 08 March 2010         1 Comment

Open Visual Studio Files As Administrator

Working with IIS as your web server, or working with Azure projects, are two examples of situations in which Visual Studio (2008+) needs to be running as Administrator (on Windows Vista or Windows 7).  If you don’t run it as such, you may be faced with a dialog like this one (for Azure): Now of course if you have Visual Studio pinned to your taskbar or start menu, you can launch it as admin by right-clicking and selecting Run As Administrator, as Jeff Blankenburg shows here .  That’s great...

Open Visual Studio Files As Administrator →

Posted on Wednesday, 03 March 2010         1 Comment

Eliminate Repetition with Action<T>

Yesterday I was looking at some old code and refactoring it to clean it up (in this case I wasn’t the original author, but I’ve written code just like this).  The application in question was a simple process that had to run once per month, on demand, and so was coded up as an EXE application.  As it ran, it provided updates on its progress, so it looked something like this: static void Main( string [] args) { Console.WriteLine( "Starting Application @ " + DateTime.Now); var parser...

Eliminate Repetition with Action<T> →

Posted on Tuesday, 02 March 2010         2 Comments

SQLite Error IDbCommand and IDbConnection implementation in the assembly System.Data.SQLite could not be found.

I just ran into a problem with SQLite and NHibernate, which was giving me this error message: The IDbCommand and IDbConnection implementation in the assembly System.Data.SQLite could not be found. The strange thing was, it worked fine from within Visual Studio, but it died when I used my ClickToBuild.bat file, which calls msbuild and runs my tests from the command line.  A bit of searching led me to a similar problem on StackOverflow , which produced the answer: Use the x64 binaries. I downloaded...

SQLite Error IDbCommand and IDbConnection implementation in the assembly System.Data.SQLite could not be found. →

Posted on Friday, 26 February 2010         No Comments

Untrusted Projects and Blocked Files in Visual Studio

I was just trying to open a project I was emailed as a zip file from a colleague.  VS2010 opens up saying: You should only open projects from a trustworthy source. The project file 'project' may have come from a location that isn’t fully trusted. It could represent a security risk by executing customer build steps when opened in Microsoft Visual Studio that could cause damage to your computer or compromise your private information. Which is fine… but in this case I know the project is OK so...

Untrusted Projects and Blocked Files in Visual Studio →

Posted on Thursday, 25 February 2010         1 Comment

SELECT from a Stored Procedure

Occasionally I find myself wanting to SELECT from a SPROC in SQL Server.  Usually this is because I want to ORDER the results or filter them further with a WHERE clause.  Unfortunately, you can’t just do this: SELECT * FROM ( EXEC mySproc foo, bar) There are several workarounds here, and the appropriate one depends mostly on whether you have any control over the use of the stored procedure, or how it works.  For example, you could choose to use a VIEW instead of a stored procedure...

SELECT from a Stored Procedure →

Posted on Wednesday, 24 February 2010         4 Comments