VS

Introduction

This page will hold basic instructions for using Visual Studio.  Creating this page allows me to show basic steps with which some user will be unfamiliar without cluttering up the main article.

Contents

Using C#

Installing Visual Studio Versions

Using C#

The following section contains the individual steps

Download the LinqToLdap assembly

Start by going to http://linqtoldap.codeplex.com/releases/view/76722 and downloading version 2.0.2:

save it, scan it and unblock it.  Extract the files and stick them somewhere useful.  I usually have a Libraries folder at the Visual Studio 2010 level:

C:\Documents and Settings\me\My Documents\Visual Studio 2010\Libraries\LinqToLdap

This is just the built assembly plus .xml and .pdb files:

Download and build the latest LinqToLdap source code

Navigate to http://linqtoldap.codeplex.com/ and click on Source Control:

Click on Download under Latest Version on the right-hand side.

Accept the licence, or not.  But you can’t proceed if not.  It’s up to you.  🙂

Wait for a while:

Select Save (your version number – the ‘11038’, below – will probably be different):

When the download is complete:

click Open Folder.  Scan for nasty stuff.

Open the Zip file’s Properties:

Click Unblock and apply the change, otherwise each of your files will be marked as from another computer and Visual Studio will complain.  Close the Properties window.

Extract the contents to a suitable folder:

On the “Welcome to the Compressed (zipped) Folders Extraction Wizard” screen, click Next.

Browse to the target folder.  My examples will assume you’ve used your equivalent of:

C:\Documents and Settings\Me\My Documents\Visual Studio 2010\Source Code\LinqToLdap\LinqToLdap-11038

and click Next.

Ensure “Show extracted files” is ticked and click Finish.

In the open folder window, navigate in to .\Trunk\LinqToLdap and locate LinqToLdap.csproj.  Right-click on it and select Open to open with Visual Studio.

To build the Debug version (probably the more useful), in Visual Studio, right-click on the Solution  and select Build Solution (this is F6 in Visual C# 2010 Express):

If the Solution Explorer isn’t visible, in Visual C# 2010 Express, select View -> Other Windows -> Solution Explorer which is Ctrl + W, S (i.e. hold control, press W, keep control pressed, press S).

After a moment or two, you should see “Build succeeded” in the VS status bar:

Aside: to build the Release version, right-click on the Solution and select Configuration Manager.

Change the Active solution configuration to Release and click Close.  Then Build the solution.

Use Windows Explorer to navigate to .\Trunk\LinqToLdap\bin\Debug  (or \Release, if you chose the release version).  You should see the built assembly and support files:

.

This is now ready to use in your projects.  When you want to use it, follow the same instructions as in Adding a reference to LinqToLdap but navigate to this folder, instead.

Creating a C# Console Application project

Start Visual Studio (I’m using Microsoft Visual C# 2010 Express for this example).

Select File > New Project…:

Select Console Application – Visual C# and enter a name for the project in the Name field:

Click OK.  You’ll be presented with a view on Program.cs:

Now, you’re ready to start writing code.

Creating a C# Class Library Project

Start Visual Studio (I’m using Microsoft Visual C# 2010 Express for this example).

Select File > New Project…:

Select Class Library and give the project a name.  This name will be the default name of the assembly.

Click OK.

This time, you’ll be presented with a view of a class file called Class1.cs.  I normally delete this.

You’re now ready to start adding classes to your class library.

Adding a class file to a C# project

Right-click on the project name (BlogOuTest1, in this case) and select Add > Class …

Enter the class name such that the new file will be called (e.g. OrganizationalUnitObject.cs) and click Add:

Visual Studio should now open a window on OrganizationalUnitObject.cs.

Adding a class file to a folder in a C# project

Right-click on the folder name ClassMaps, in this case) and select Add > Class …

Enter the class name such that the new file will be called (e.g. OrganizationalUnitObject.cs) and click Add:

Visual Studio should now open a window on OrganizationalUnitObject.cs.

Adding a reference to LinqToLdap

To do this, right-click on References and select Add Reference…

Select the Browse tab and locate your copy of LinqToLdap.dll.  I usually keep pre-built assemblies in a folder call Libraries in my Visual Studio 2010 folder:

C:\Documents and Settings\me\My Documents\Visual Studio 2010\Libraries\LinqToLdap

Click OK.

You should now see LinqToLdap at the top of your list of References:

Now, it’s time to write some code.

Adding a reference to System.DirectoryServices.Protocols

To do this, right-click on References and select Add Reference:


If your project is being built with the Client Profile, the default for Console Programs (check the Project Properties to confirm):

you’ll find this (I’ve expanded the window so you can see the difference in the paths):

If your project is being built with the Full Profile:

you’ll find this:

Select the System.DirectoryServices.Protocols entry and click OK and you’ll see an new entry in your References:

You’re now ready to make use of S.DS.P.

Installing Visual Studio Versions

Installing Visual C# 2010 Express

If you don’t already have the Microsoft Windows Installer 4.5 Update and the Microsoft .Net Framework 4.0 installed already, you’ll probably have to restart twice, during the installation.  For this installation, I haven’t pre-installed either.  If you do decide to pre-install the .Net Framework 4.0, make sure you get the full product, not the Client-Profile version.

Navigate to: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-csharp-express

Select Install Now – English (or change the language as appropriate using the dropdown).

For now, avoid the trial and select Install Visual C# 2010 Express (English).

You’ll get the usual download warning:

Click Run.

Then, you see another secrutiy warning:

Click Run, again.  You can close the browser pop-up and browser window now, if you want.

Then, the installer starts:

Click Next.

Next, you ‘ll see the licence terms:

Accept the terms and click Next.

Then, you’re offered the opportunity to install Silverlight and SQL Server 2008 Express SP1:

We won’t need SQL Server for now, so I’ve declined it, here.  I use Silverlight, so I’ve accepted it.  Click Next.

Now, you’re shown the default destination folder and the items to be installed.

and

Click Next to start the installation.

Now, you can see the installer’s progress:

Here’s the first restart, after the installation of Microsoft .NET Framework 4:

Click Restart Now.

And the second, after the installation of Microsoft Windows Installer 4.5 Update (x86) – Windows XP:

Click Restart Now.

After a while, the installation should finish:

Click Exit.

You don’t have to do this now, but you might as well: navigate to Help > Register Product:

A window appears:

Click Obtain a registration key online.

The browser opens on the Microsoft Profile Center.  Sign in with your Windows Live ID.   Fill the blanks and click Continue.  You’ll get a new page/pop-up with your key:

Copy your key and paste it into the above window.  Click Register Now and you’re finished.

The key will also be emailed to the address you submitted along with some introductory information.

Installing Visual Basic 2010 Express

Navigate to: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-basic-express

If you don’t already have the Microsoft Windows Installer 4.5 Update and the Microsoft .Net Framework 4.0 installed already, you’ll probably have to restart twice, during the installation. For this installation, I haven’t pre-installed either. If you do decide to pre-install the .Net Framework 4.0, make sure you get the full product, not the Client-Profile version.

Navigate to: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-csharp-express

Select Install Now – English (or change the language as appropriate using the dropdown).

For now, avoid the trial and select Install Visual C# 2010 Express (English).

You’ll get the usual download warning:

Click Run.

Then, you see another secrutiy warning:

Click Run, again. You can close the browser pop-up and browser window now, if you want.

Then, the installer starts:

and then

Click Next.

Next, you ‘ll see the licence terms:

Accept the terms and click Next.

Then, you’re offered the opportunity to install Silverlight and SQL Server 2008 Express SP1:

We won’t need SQL Server for now, so I’ve declined it, here. I use Silverlight, so I’ve accepted it. Click Next.

Now, you’re shown the default destination folder and the items to be installed.

and

and

Click Next to start the installation.

Now, you can see the installer’s progress:

Here’s the first restart, after the installation of Microsoft .NET Framework 4:

Click Restart Now.

And the second, after the installation of Microsoft Windows Installer 4.5 Update (x86) – Windows XP:

Click Restart Now.

After a while, the installation should finish:

Click Exit.

You don’t have to do this now, but you might as well: navigate to Help > Register Product:

A window appears:

Click Obtain a registration key online.

The browser opens on the Microsoft Profile Center. Sign in with your Windows Live ID. Fill the blanks and click Continue. You’ll get a new page/pop-up with your key

.  Copy your key and paste it into the above window. Click Register Now and you’re finished.

The key will also be emailed to the address you submitted along with some introductory information.

Installing Visual Studio LightSwitch 2011

Mount the ISO (or insert the DVD) for Visual Studio LightSwitch 2011.  Wait for (or initiate) AutoPlay:

.

Click Accept:

.

Click Customize (I always like to know what an installer is doing):

.

Click Install:

.

It will install a number of components, depending on your existing configuration and may require several restarts:

.

Installation will should resume automatically:

 

and then:

and further restarts may be required:

and more components:

and another restart:

and so on:

until you reach:

.

You should consider clicking Launch at this point because initial configuration can take a few minutes:

and then you are ready to start:

Hurrah!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: