Skip to content

Before you open the solution

danludwig edited this page Aug 18, 2012 · 8 revisions

This project is intended to be developed using Visual Studio 2010 or higher. There are a few known issues developing with Visual Web Developer / Visual Studio Express.

Solution Files

There are 2 solution files in the project, ucosmic.sln and AppHarbor.sln. All code development is done using the ucosmic.sln file. The AppHarbor.sln file is used only for deployments to AppHarbor, to perform some web.config transformations and keep the user acceptance tests from executing. You should never need to open the AppHarbor.sln file.

Before you open the ucosmic.sln file for the first time, take some time to follow these steps and prepare your system. Otherwise, some projects may not fully load.

Get the Microsoft Web Platform Installer

If you do not already have it, get it here and install it. If you are not sure whether you have it, click the Windows start orb and type "Web Platform". It should appear in the search results. You will need this for the next couple of steps.

Install Visual Studio 2010 SP1

Start up the Web Platform Installer, type "sp1" into the search box on the top right of the window, and hit enter. In the results, find "Visual Studio 2010 SP1". If you already have it installed, skip to the next step. Otherwise, install it. This install takes a while, and you will have to stand by the computer to reboot it.

Install ASP.NET MVC 3 (Visual Studio 2010)

Start up the Web Platform Installer, type "mvc" into the search box on the top right of the window, and hit enter. In the results, find "ASP.NET MVC 3 (Visual Studio 2010)". If you already have it installed, skip to the next step. Otherwise, install it.

Install IIS Express

Start up the Web Platform Installer, type "iis express" into the search box on the top right of the window, and hit enter. In the results, find "IIS 7.5 Express" or "IIS 8.0 Express". If you already have it installed, skip to the next step. Otherwise, install it.

Install Windows Azure SDK & Libraries

Start up the Web Platform Installer, type "azure" into the search box on the top right of the window, and hit enter. In the results, find 2 items named Windows Azure SDK for .NET and Windows Azure Libraries for .NET. The versions may change over time, but UCosmic keeps up with the latest Azure software. If you already have these installed, skip to the next step. Otherwise, install them.

Install SpecFlow

If you don't have SpecFlow installed, install it. Since version 1.9, you can download SpecFlow as a Visual Studio extension. Click Tools > Extension Manager, search online for SpecFlow, download and install it.

Install or Update NuGet

Open Visual Studio and click Tools > Extension Manager. In the Online Gallery, search for "nuget". If you do not have the latest version, try to update. If you receive any error messages, you will have to remove NuGet using the Uninstall a Program link from the windows control panel. After rebooting, restart visual studio and make sure NuGet is no longer installed. If it is still installed, restart Visual Studio as an administrator to completely remove it. You can then re-add it using the Extension Manager.

Other helpful Visual Studio Tools

If you open the ucosmic.sln solution file in Visual Studio now, all projects should load. However, there are a few other VS extensions that will help you a lot with this project. Take the time to download them now, they're all free.

Spell Checker

You can find this by searching for "spell checker" in the Visual Studio Extensions Online Gallery.

SlowCheetah - XML Transforms

You can find this by searching for "cheetah" in the Visual Studio Extensions Online Gallery.

JScript Extensions

Search using the term "javascript" in the Visual Studio Extensions Online Gallery, and then look for "Web Standards Update for Microsoft Visual Studio 2010 SP1". Download and install this. It will give VS editors better support for CSS3 and javascript.

Git Source Control Provider

If you are already used to using git source control with Visual Studio, you may already love or hate this tool. However if you are not used to using git, you should at least give it a try. Search online in the Extensions Manager for "git" and you should find it.

Tell Visual Studio to Squash Trailing Whitespace

Trailing whitespace is annoying at best. We have enough problems to worry about, and it's easy to forget to CTRL + K + D (or Edit -> Format Document) before saving a file every time. Even if we do, there are some trailing whitespace issues that this function skips. Fortunately there is a macro we can add to Visual Studio that will automatically remove all trailing whitespace from a document each time we save. Follow these instructions to enable this before you begin developing:

  1. Open Visual Studio.
  2. In the menu select Tools -&gt Macros -%gt; Macros IDE.
  3. Expand "My Macros" and double click the EnvironmentEvents module.
  4. Paste the following code just below the Automatically generated code region, before the End Module line:

' http://codeimpossible.com/2012/04/02/Trailing-whitespace-is-evil-Don-t-commit-evil-into-your-repo-/
Private Sub DocumentEvents_DocumentSaved(ByVal document As EnvDTE.Document) _
Handles DocumentEvents.DocumentSaved
Dim fileName As String
Dim result As vsFindResult
Try
' Remove trailing whitespace
result = DTE.Find.FindReplace( _
vsFindAction.vsFindActionReplaceAll, _
"{:b}+$", _
vsFindOptions.vsFindOptionsRegularExpression, _
String.Empty, _
vsFindTarget.vsFindTargetFiles, _
document.FullName, _
"", _
vsFindResultsLocation.vsFindResultsNone)
If result = vsFindResult.vsFindResultReplaced Then
' Triggers DocumentEvents_DocumentSaved event again
document.Save()
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly, "Trim White Space exception")
End Try
End Sub

Finally, save and close the Visual Studio Macros IDE. From now on, when you save a file from Visual Studio, all trailing whitespace should be squashed.

<< Back to Wiki Home | Next: Before you run the solution >>