Original blog post in danish can be found at my blog: http://blog.soerenlarsen.dk/2009/10/installation-og-konfigurering-af-visual.html∞
Introduction
This is the first post in a series of posts about
C#4.0∞. In this post I will describe how I have installed and configured Visual Studio 2010 Beta 2.
Installation
I have choosen to install Visual C# 2010 Beta 2 (VCS2010B2) to make my code samples in. VCS2010B2 can be downloaded here:
http://www.microsoft.com/express/future/∞
Configuration
I have also installed
Nunit∞, because the express versions of visual studio dosn't include the MS Test framework. Nunit can be downloaded as a msi package here:
http://www.nunit.org/index.php?p=download∞
I have used the following description to tweak Nunit 2.5.2 to support C#4.0 (source:
http://bit.ly/2j4u9U∞)
Find the file nunit-console.exe.config in %PROGRAMFILES%/nunit 2.5.2/bin/net-2.0 and add the following:
In node <configuration> add:
<startup>
<requiredRuntime version="v4.0.20506" />
</startup>
and in node <runtime> add:
<loadFromRemoteSources enabled="true" />
I have also created a shortcut to run unit tests in Visual Studio. First I have enabled expert settings in the menu item tools->settings.
Then I have created an external tool by using the menu item tools->external tools. Here is a description of my configuration:
Command: %PROGRAMFILES%\NUnit 2.5.2\bin\net-2.0\nunit-console.exe
Arguments: $(TargetName).dll /nologo /nodots
Initial directory: $(ProjectDir)/bin/release
I have also selected a keyboard shortcut for running the unit tests. To do this I have opened the menu item tools->options and selected the item environment->keyboard settings
Here I have searched for the command "Tools.ExternalCommand1" and assigned Alt-R as my keybord shortcut for this command.
Hello world
I have created a project with the following classes to test my configuration
using NUnit.Framework;
using HelloWorldBLL;
namespace HelloWorldTest
{
[TestFixture()]
public class HelloWorldTest
{
[Test]
public void WhenCallHallo_HelloWorldReturns()
{
string actual = HelloWorld.SayHallo();
string expected = "Hello World";
Assert.That(actual == expected);
}
}
}
namespace HelloWorldBLL
{
public class HelloWorld
{
public static string SayHallo()
{
return "Hello World";
}
}
}
ProcessModel: Default DomainUsage: Single
Execution Runtime: net-4.0.21006.1
Tests run: 1, Errors: 0, Failures: 0, Inconclusive: 0, Time: 0,082 seconds
Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
The result of the unit test shows that my configuration is correct, and I can now begin to use Visual Studio.
Next post:
Dynamics in C#4.0
There is one comment on this page. [Display comment]