Tag Archives: Visual Studio

NuGetter Build Process Version 1.0 Released

image

http://nugetter.codeplex.com/

I just released version 1.0 of NuGetter to CodePlex. Build, version, package, push and publish through an automated build in Team Foundation Server 2010.

Summary:

The NuGet project was designed to provide developers with a standardized mechanism for sharing and installing code, assemblies, etc. The creation of the packages is pretty straightforward to do in a manual way but wouldn’t it be nice if it was all automated? And, not just the packaging, the versioning and deploying should be automated as well. This way, you as the developer can create a library, build it, deploy it and immediately test it.

This is the goal of NuGetter.  It is an extension to the Team Foundation Server 2010 build process that will perform all of the necessary versioning, packaging and deployment functions in a customizable and completely repeatable way.

Capabilities:

  • Includes all phases of the build process: compile, version, pre-package, package, push/deploy and publish
  • NuGet Package and deploy features for a simple to an extremely complex library package
  • Single or multiple solution builds
  • Single or multiple configuration builds
  • Manage versioning of the assemblies coordinated or separately from the NuGet package
  • Create a package, create and push a package or create a package and push and publish to a NuGet gallery
  • Build and have immediate access to the package in a test environment through inherent “Push/Deploy” feature
  • Push locations include the NuGet Gallery, a local directory, network share or web site
  • Use in any combination of manual, continuous integration or scheduled builds
  • Ability to execute PowerShell scripts prior to packaging to organize the files (e.g., lib, tools, content) for the NuGet packaging process (pre-packaging)
  • No requirement for NuGet.exe to be installed on the build machine – NuGet.exe can be held in source control and deployed only at the time of the build
  • All of the above is managed through the standard TFS Build Workflow process
  • Remotely store/manage package information such as version numbers, API keys, and NuSpec manifest files
  • Tested with NuGet versions 1.3 and the latest 1.4 release

image

Sample build definition parameters showing amount of detailed control

image

NuGetter TFS Automated Build Process Creates and Publishes NuGet Packages

I just released to CodePlex a project that I have been working on called NuGetter. It works through Team Foundation Server automated build to help you organize the package files, create the package and then push (and even publish) to a nuget gallery.  The gallery can be the official NuGet Gallery, a local drive, network share or internal site.  Below is a description of the project which is still being developed (as of this post it is version 0.9.0.0).

http://nugetter.codeplex.com

Project Description

NuGetter is a TFS 2010 Build Process which provides packaging and deployment management to projects destined for a nuget Gallery.

Current version is 0.9.0.0. It is still undergoing development and testing although in it’s current state it is operating very well.

Capabilities/Features:

  • Build, package, push and publish simple to complex nuget packages – including multi-framework packages
  • Invoke a PowerShell script to organize or “pre-package” your files before the package step
  • Build single or multiple .net solutions as input to the packaging process
  • Deploy or Push to the nuget gallery OR an internal (localized) gallery (local or network drive, UNC share, internal web site)
  • Manage the package version directly (will be connecting the process with TfsVersioning to provide even better management of the project version)
  • Include the process as part of a continuous integration or daily build process and deploy directly to a server for testing
  • NuGet.exe is used but does NOT have to be installed on the build server so managing the server requirements is made easier
  • Manage your API Keys and store them in files OR include as part of the build definition
  • Includes custom activities and build templates to use directly within TFS

All of this is managed via a Team Foundation Server automated build.

MSTest Aggravation and a Solution (For Me Anyway)

I’ve created data driven tests many times in Visual Studio and I’ve used Excel spreadsheets, comma separated value (CSV) files and XML.  I’ve even written a blog post or two on the subject.  No matter how many times I do it though, it seems that I always get stuck at the beginning because the data files don’t get deployed. WTF? You’d think I would remember how to do it.  Apparently, that’s not the case cuz tonight I ran into the same fricken, aggravating error message and just stared at it like I’d never seen it before.

Here’s the error message:

“The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see "Troubleshooting Data-Driven Unit Tests" (http://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library.”  BTW, this was in VS 2010.

Best part is that if you go to that link, it’s not “Troubleshooting Data-Driven Unit Tests”.  It’s titled "Working with Unit Tests” and it’s under VS 2005.  No troubleshooting tips to be found there.  Nothing that helped anyway.

So, I stared at my code and thought, why can’t MSTest find the stupid file and deploy it?!!! It’s not like it’s hidden.  It’s sitting right there in a folder next to the test.

   1:  [DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML", "|DataDirectory|\\WidthTestData.xml", 
   2:              "Row", DataAccessMethod.Sequential)]
   3:          [DeploymentItem("MyProjTest\\TestData\\WidthTestData.xml")]
   4:          [TestMethod]
   5:          public void WhenObjectCreatedShouldValidateWidthValues()
   6:          {
   7:             ...
   8:          }

 

I did searches on the error and came across many frustrated forum messages trying to find out where the RelativePathRoot is because the DeploymentItem attribute file location is supposed to start from “RelativePathRoot” and go from there.  With that problem in mind, I pointed the DeploymentItem path to many, many variations. Project folder\subfolder\file, ..\subfolder\file, ..\..\subfolder\file, etc. None worked.  I even hardcoded the path and that didn’t work.  Hmmm, a clue.

RelativePathRoot wasn’t the problem.  (BTW, if you were wondering, RelativePathRoot is just the folder of the solution that contains your test project.  Maybe that will be useful to someone.)

I decided to use the Test Settings / Deployment option (double click on “Local.testsettings” in Solution Items and you will get the Test Settings dialog) to force deploy the file rather than rely on the DeploymentItem attribute.  When I clicked on the “Deployment” option I saw it immediately (again).  I forgot to check to see if the “Enable deployment” option was checked.  There’s 45 minutes of aggravation I’ll never get back.

image

Once I clicked that option, my data driven tests started working and all was good – for the moment anyway.  So, keep that in mind when you run into that cryptic error message when you’re creating data driven tests. 

One other thing, setting the file to “Copy always” or “Copy if newer” is NOT the answer.  Don’t do it.

And now, back to my regularly scheduled testing…

Accessing TFS 2010 From Visual Studio 2008 & 2005 (IDE)

(Updated to include VS 2005)

You can most definitely access TFS 2010 from the Team Explorer within VS ‘08 and ‘05 BUT there is a very defined installation order and a final update patch to make it all work.  So, below is a description of the installation order of all of the pieces needed to be in place before VS ‘08 can get to a TFS 2010 environment.

You must install the components in the following order.  If you do not, then it most likely will not work – meaning you won’t be able to attach to a TFS Server.  If you do install the components in a different order that does not mean you cannot recover without uninstalling (yea!).  All it means is that, at the end of the day, the components will need to be “layered” as defined below.

Visual Studio 2008

  1. Visual Studio 2008
  2. TFS Team Explorer 2008
  3. Visual Studio 2008 SP1 (installer only) (ISO – Full download)
  4. Visual Studio Team System 2008 Service Pack 1 Forward Compatibility Update for Team Foundation Server 2010 (nice concise naming…NOT!)

Visual Studio 2005

  1. Visual Studio 2005
  2. TFS Team Explorer 2005
  3. Visual Studio 2005 Team Suite SP1
  4. Visual Studio Team System 2005 Service Pack 1 Forward Compatibility Update for Team Foundation Server 2010 (Installer)

So, if, for example, you install VS and then VS SP1 and then Team Explorer you won’t be able to just add the Forward Compatibility Update and have things work.  You will need to re-install VS SP1 so that it is on top of Team Explorer and then the Forward Compatibility Update.  At that point the pieces will be layered in the right order.  Kind of a pain, but that’s how it works.

The description below should be used for 2005 and 2008:

Once the install is done you can add your server and this is how you used to add a server in Team Explorer ‘08 and still is if you are attaching to TFS ‘08:

image

Server name, port and protocol and you are done.

TFS 2010 is different because of the concept of project collections.  You need to add the virtual directory and the collection name in addition to the server, port and protocol.  In Team Explorer 2010 you get this dialog box:

image

which allows you to add everything separately – except for the collection which is done later:

image

In TE ‘08 you add all of the details in the server name text box as a URL including the name of the collection since there isn’t any place else to add it.

image

When you hit OK it will churn for a couple seconds and then should display the new connection in the remaining dialog box:

image

That should be it.  You should have access to the TFS project collection. 

I definitely ran into the layering issue and figured it out with some research along with trial and error.  Hopefully, this helps.

 

Preorder and Save on Visual Studio 2010 Upgrade

Microsoft Visual Studio 2010 Professional will launch on April 12 but you can beat the rush and secure your copy today by pre-ordering at the affordable estimated retail price of $549, a saving of $250.

If you use a previous version of Visual Studio or any other development tool then you are eligible for this upgrade. Along with all the great new features in Visual Studio 2010 (see www.microsoft.com/visualstudio) Visual Studio 2010 Professional includes a 12-month MSDN Essentials subscription which gives you access to core Microsoft platforms: Windows 7 Ultimate, Windows Server 2008 R2 Enterprise, and Microsoft SQL Server 2008 R2 Datacenter.

So visit http://www.microsoft.com/visualstudio/en-us/pre-order-visual-studio-2010 to check out all the new features and sign up for this great offer.

Wanna Play with VSTS/TFS 2010 Beta2

The following virtual images were just released and will give you the ability to try the new capabilities of VSTS and TFS in a safe, preinstalled environment.  You just need to spend a little time doing the downloads – each download page consists of an EXE and several RAR files that will put themselves together into Hyper-V or VPC images.

Download from Microsoft Downloads:

Visual Studio 2010 Beta 2 (Hyper-V)  Got W2K8 with Hyper-V loaded?  This one’s for you.
Visual Studio 2010 Beta 2 (Windows [7] Virtual PC) This one was created specifically to run on Win7 and VPC
Visual Studio 2010 Beta 2 (Virtual PC 2007 SP1)  This is a normal VPC ‘07 SP1 image

All passwords are: P2ssw0rd

Not sure where to start?  How bout this…

Visual Studio 2010 and .NET Framework 4 Training Kit

Topics Include:

  • C# 4.0
  • Visual Basic 10
  • F#
  • Parallel Extensions
  • Windows Communication Foundation
  • Windows Workflow
  • Windows Presentation Foundation
  • ASP.NET 4
  • Windows 7
  • Entity Framework
  • ADO.NET Data Services
  • Managed Extensibility Framework
  • Visual Studio Team System

The Training Kit is pretty extensive and works with Visual Studio 2010 Beta 2 and .NET Framework 4 Beta 2.

All this should keep you busy for a little while anyway.