Hosted source control and project management with Subversion and Team Foundation Server

I have been using Subversion for many years both professionally and on open source projects (mainly Razor Image Viewer). Initially, I had Subversion running as a service on my local computer but the more I thought about a strategy for backing up my work, the more it made sense to use a hosted environment. The $25 dollars a year it costs me for a hosted source control service wouldn’t even cover the electricity for my own server.

I am currently using a hosted Subversion and TRAC with ProjectLocker. The hosted service allows me to focus on my development and other project without the need to maintain a server or keep it on all the time. I love TRAC’s custom workflows but it doesn’t offer the breadth of capabilities required for application lifecycle management (ALM).

I have used Microsoft’s Team Foundation Server and am more and more impressed by it as it has matured since its initial version in 2005. With the release of Team Foundation Server 2012, there will also soon be a TFS Express solution available to teams of 5 for free. Currently, Microsoft is offering a free web based preview of Team Foundation Service hosted online (under the hood, it’s a farm of Azure VMs). I am using this for a couple projects and will be writing more about this soon.

If you are using Visual Studio 2010 you will need to install a hotfix in order to connect Visual Studio 2010 with the TFS Preview hosted source control. Microsoft’s website makes you jump through a few hoops before directing you to the download page for hotfix KB2581206. Visual Studio 2012 connects properly to the hosted Team Foundation Service out of the box.

To connect Visual Studio 2010 to your TFS Preview repository, the Getting Started with Visual Studio page incorrectly states to use the full project URL https://fabrikamfiber.tfspreview.com/DefaultCollection/FabrikamFiber (to end the URL with your project’s name). The correct URL for your Team Foundation Server is https://fabrikamfiber.tfspreview.com/DefaultCollection, for example. Visual Studio will provide you a list with the projects to which you can connect.

Brian Harry has written more about TFS Express

Deploying an ASP.NET Web Application with SQL CE 4 & Entity Framework without installation

Update – 12/15/2011

As of Visual Studio 2010 SP1, there’s an easier way to do everything below.

In the Solution Explorer, right click the project and select ‘Add Deployable Dependencies…’, select the dependencies you want to include, and click OK.

Visual Studio 2010 - Add Deployable Dependencies

This will generate the folder _bin_deployableAssemblies with the proper DLLs. Now when you build your solution, the DLLs in _bin_deployableAssemblies are copied to the bin folder.

See Scott Hanselman’s post for a more thorough explanation.

Original Post

I have built an ASP.NET project using SQL CE 4.0 and Entity Framework 4.1. When the time came to deploy the web application to our managed environment, I ran into some issues due to some missing references.

Do to the nature of our hosted environment, installing the EntityFramework and SQLCE4 libraries was not an option but I have worked out all of the required steps to get the web application working in the deployed environment.

Referenced Libraries

The following libraries should be referenced in your project.

EntityFramework
System.Data.SqlServerCE
System.Data.SqlServerCE.Entity
System.Web.Providers

Make sure to set the Copy Local property to true.

Manual Copy

The following files should be copied as part of your build script process. These files are placed on your file system when you install the SQL CE 4 package.

sqlceca40.dll
sqlcecompact40.dll
sqlceer40EN.dll
sqlceme40.dll
sqlceoledb40.dll
sqlceqp40.dll

Web.config

On my development box, the machine.config has been modified (when I installed SQL CE 4) to include the SQL CE 4 provider. To use the provider without explicitly installing it on the server, we need to manually add the provider in the Web.config

  <system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SqlServerCe.4.0" />
      <add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    </DbProviderFactories>
  </system.data>

Source control strategy for WordPress sites

My background is more in software and web application development, not website development. So when I started doing a few websites on the side, I wanted to translate some of the tools and processes that I use everyday as a developer to this new role. As I compared the different CMS options, WordPress was the winner in my eyes with a good balance of usability, maintainability, and customizability.

Having chosen WordPress, my attention shifted to finding a version control mechanism for the works in progress. The look and feel for WordPress sites are managed by themes. WordPress allows your to create a child theme based on an existing theme by assigning the ‘template’ property in the header for style.css (the only required file in a child theme). You can read more about creating a child theme here: http://codex.wordpress.org/Child_Themes.

The content is maintained in the WordPress database (MySQL) and WordPress has a good mechanism for managing historical versions. The parent theme (in my case the new Twenty Eleven theme that came with WordPress 3.2) can be downloaded at any time, there’s no point in adding it to version control. Developing the child themes, I now have my handful of modified files under source control along with a simple FTP upload that serves as my deployment. Branching also works because I can deploy the branch to a 2nd theme folder (lets say ‘twentyeleven_custom_branch’) and preview the site with the new theme without actually activating the updated theme.

Subversion Error Message on Windows 7/Windows 2008 Server

Some times when I am performing a Subversion task (update, commit, check out) I get an error message stating that files can’t be moved or deleted. A subsequent boot of my machine causes CHKDSK to run (this is what concerned me).

The error message looks like this:

Error: Can't move
Error: '[...]\.svntmpentries'
Error: to
Error: '[...]\.svnentries':
Error: The file or directory is corrupted and unreadable.

This is a known issue with Windows 7 and you can http://support.microsoft.com/kb/982927/en-us”>download a Hot Fix to fix it.

This issue is also addressed in Service Pack 1 for Windows 7 and Windows Server 2008.

Here is a good post on the issue: http://serverfault.com/questions/72561/64-bit-tortoisesvn-on-windows-7-says-file-or-directory-is-corrupted-and-unreadab