DCSIMG
March 2009 - Posts - Shai Raiten's Blog

Shai Raiten's Blog

It's all about code...

March 2009 - Posts

The "BuildShadowTask" task failed

The "BuildShadowTask" task failed

When Running tests Team System you got this error -

------------------------------------------------------------------------------------------------------

Error 8 The "BuildShadowTask" task failed unexpectedly.

System.NullReferenceException: Object reference not set to an instance of an object.

   at Microsoft.VisualStudio.TestTools.BuildShadowReferences.BuildShadowTask.Execute()

   at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) APITestProject

------------------------------------------------------------------------------------------------------

I got help from this MSDN Post

The BuildShadowTask is a component used by the Microsoft.TeamTest.targets used to build the private accessor DLL,
that a unit test uses to get at private and protected members of a test target.

It in turn calls the Publicize.exe executable to do the actual work.

To test “Internal” , “Private” or “Friend” methods you need to add Accessor to your TestProject.

image

 

Than Team System will add Accessor file with the name of the project you are testing.

 

image

Remove this file from the Test References folder and your tests will start working.

Good Luck

How To Add File Upload To Team System Web Test

How To Add File Upload To Team System Web Test

May times people asks me how can I Upload File with Web Test, The first thing is to record the Web Test using “Web Test Recorder” or Fiddler.

But when running the Web Test its fails in the Upload section.

Why?

Before understanding the problem let get familiar with “File Upload Parameter”     image

Right click on the required request and select “Add File Upload Parameter”

image

Then you can add the field name and the file location.

So why file upload fails?

Have a look at a short web test I record inside blogs.microsoft.co.il blogs, I upload a photo and only the file name is there.

When running the web test team system cannot file your file.

image

Add the full path of the file.

image

And Now your web test will work just fine.

Running Unit Tests End With - “The specified module could not be found”

Running Unit Tests End With - “The specified module could not be found”

“The specified module could not be found. (Exception from HRESULT: 0x8007007E)”

Some times your test relay on additional file that need to be in the same folder where Team System running the Test.

Those files can’t be add into the GAC and you can’t copy them manually each time.

So What Do Do?

We need to use Deployment settings
Deployment settings specify deployment location and any file to be deploy in the addition to the target assemblies

Open Test Configuration – Right click on Test Menu –> “Edit Test Run Configuration” –> “Local Test Configuration”

image

Select “Deployment” and check “Enable deployment”.

Add Folder/File to be deploy with your test.

image

Take Notice - If the deployment item are big (size) this will effect the run speed.

TFS Check-in Validation Tool – V 1.0.0.75

TFS Check-in Validation Tool

There is a new version available in CodePlex

Project Description

The TFS Check-in Validation Tool extends TFS Team Build 2008 by enabling buddy build queuing (pre-checkin), validating checkins using shelvesets, and build agent pooling, all from the VS 2008 IDE.

BB-67.jpg

Buddy Build Process Flow

BB-process-flow.jpg

TFS API Part 18: More Basic Stuff On Workspaces

TFS API Part 18: More Basic Stuff On Workspaces

In my last post I showed how to TFS API Part 17: Get WorkSpaces Information

In this post I’ll show to go couple of basic actions on you workspace.

Demo Project

image

First add reference for
     Microsoft.TeamFoundation
     Microsoft.TeamFoundation.Client
     Microsoft.TeamFoundation.Common.dll
     Microsoft.TeamFoundation.VersionControl.Client.dll

located in - C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\

Step 1 – Connect TFS + Create VersionControlServer Object

First I create a Domain Project Picker to get Team Foundation Server instance, and after getting tfs instance create new object type VersionControlServer.

DomainProjectPicker dp = new DomainProjectPicker(DomainProjectPickerMode.None);

dp.ShowDialog();

if (dp.SelectedServer != null)

{

    tfs = dp.SelectedServer;

    sourceControl = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));

    AddWorkSapces();

}

Step 2 – Get all workspace from local machine.

private void AddWorkSapces()

{

    Workspace[] wss = GetWorkspaces();

 

    foreach (Workspace ws in wss)

    {

        WorkSpaceItem item = new WorkSpaceItem(ws.Name, ws);

        comboBox1.Items.Add(item);

    }

}

* Create WorkSpaceItem

public class WorkSpaceItem

{

    public string Name { get; set; }

    public Workspace WorkSpace { get; set; }

 

    public WorkSpaceItem(string name, Workspace workspace)

    {

        this.Name = name;

        this.WorkSpace = workspace;

    }

    public override string ToString()

    {

        return this.Name;

    }

}

public Workspace[] GetWorkspaces()

{

    try

    {

        return sourceControl.QueryWorkspaces(null, sourceControl.AuthenticatedUser, System.Net.Dns.GetHostName().ToString());

        //You also can get remote workspaces

        //QueryWorkspaces(worspaceName,worksapceOwner,computer)

    }

    catch

    {

        throw;

    }

}

Step 3 – Create Workspace

It’s a very simple action using tfs api, and can set folder and more workspace settings. (see comment)

private void btn_create_Click(object sender, RoutedEventArgs e)

{           

    sourceControl.CreateWorkspace(txt_name.Text);

    //sourceControl.CreateWorkspace(txt_name.Text, Environment.UserName);

    //sourceControl.CreateWorkspace(txt_name.Text, Environment.UserName, "Just Comment");

    //sourceControl.CreateWorkspace(txt_name.Text, Environment.UserName, "Just Comment", new WorkingFolder(serveritem,localitem));

    //sourceControl.CreateWorkspace(txt_name.Text, Environment.UserName, "Just Comment", new WorkingFolder(serveritem, localitem), "Computer Name");

    //sourceControl.CreateWorkspace(txt_name.Text, Environment.UserName, "Just Comment", new WorkingFolder(serveritem, localitem), "Computer Name",FixMappingErrors);

}

Step 4 – Delete Workspace

private void btn_delete_Click(object sender, RoutedEventArgs e)

{

    if (cob_workspace_list.SelectedItem != null)

    {

        WorkSpaceItem item = (WorkSpaceItem)cob_workspace_list.SelectedItem;

        item.WorkSpace.Delete();

 

        AddWorkSapces();

    }

}

Step 5 – Get Pending Changes

private void btn_GetPendingChanges_Click(object sender, RoutedEventArgs e)

{

    if (cob_workspace_list.SelectedItem != null)

    {

        WorkSpaceItem item = (WorkSpaceItem)cob_workspace_list.SelectedItem;

        PendingChange[] changes = item.WorkSpace.GetPendingChanges(); ;

 

        StringBuilder str = new StringBuilder();

        foreach (PendingChange change in changes)

        {

            str.AppendLine(string.Format("File name:{0},Change type:{1}",change.FileName,change.ChangeType.ToString()));

        }

        MessageBox.Show(str.ToString());

    }

}

 

See more action in the Demo Project

image

Scrum Sprint Monitor on CodePlex

Scrum Sprint Monitor on CodePlex

bharry's just post about new tool for Scrum Users.

Project Description
Scrum Sprint Monitor is a screen saver designed to provide a birds-eye view on the team performance and the status of the current sprint on a large LCD monitor. It is a tool designed to help teams who are adopting Agile methodologies, such as Scrum or Lean development.

You can download from CodePlex

Screenshot

Done: Team System User Group – Web Test & Load

Done: Team System User Group – Web Test & Load

First I want to say Thanks to each and every one that arrive to this meeting.

Around 50 people arrive to the meeting and for 80% this was the first time in Team System User Group.

There is no doubt that Web & Load Testing in Team System is a very HOT subject.

Hope to see you all in the next meeting!

Thanks Again.

 

How to use My Demo:

1. Download Team Suite 90-Day Trial.

2. Download and install - Job Site Starter Kit
Download the Job Site Starter Kit (ASP.NET 3.5)

Install "Job Site" on your IIS as new Web Site and call it - JobSeeker

3. Install UKVSTS - Home Web Test Plug-in - Download

4. Download and Open JobSiteTestProject.zip ,extract MyData,csv to drive D.

***Create two JobSeeker users and place them inside MyData.csv.

5. Open JobSeeker.sln and Enjoy!

 

ScreenCasts

Team System – How to Create Web Test\Coded Web Test - Screencast [HE]

Team System – How to Create Data Binding Web Test - Screencast [HE]

Team System – How to add Validation and Extraction Rules to a Web Test - Screencast [HE]

Team System – How to Create Custom Validation Rule [HE] – Screencast

Team System – How to Create Custom Extraction Rule [HE] - Screencast

 

Resources

  1. http://www.msdn-pulse.com – All about Microsoft community – Event, Blogs and more…
  2. http://www.teamsystemlive.com – Ask the expert, every Wednesday as 20:00
  3. http://www.tsug-ve.com/ – Team System User Group in Second Life.

TFS API Part 17: Get WorkSpaces Information

TFS API Part 17: Get WorkSpaces Information

In this post I’ll show how to obtain local workspaces information.

Download Demo

.image

First add reference for
     Microsoft.TeamFoundation
     Microsoft.TeamFoundation.Client
     Microsoft.TeamFoundation.Common.dll
     Microsoft.TeamFoundation.VersionControl.Client.dll

located in - C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\

Step 1 – Connect TFS + Create VersionControlServer Object

First I create a Domain Project Picker to get Team Foundation Server instance, and after getting tfs instance create new object type VersionControlServer.

DomainProjectPicker dp = new DomainProjectPicker(DomainProjectPickerMode.None);

dp.ShowDialog();

if (dp.SelectedServer != null)

{

    tfs = dp.SelectedServer;

    sourceControl = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));

    AddWorkSapces();

}

Step 2 – Get all workspace from local machine.

private void AddWorkSapces()

{

    Workspace[] wss = GetWorkspaces();

 

    foreach (Workspace ws in wss)

    {

        WorkSpaceItem item = new WorkSpaceItem(ws.Name, ws);

        comboBox1.Items.Add(item);

    }

}

* Create WorkSpaceItem

public class WorkSpaceItem

{

    public string Name { get; set; }

    public Workspace WorkSpace { get; set; }

 

    public WorkSpaceItem(string name, Workspace workspace)

    {

        this.Name = name;

        this.WorkSpace = workspace;

    }

    public override string ToString()

    {

        return this.Name;

    }

}

public Workspace[] GetWorkspaces()

{

    try

    {

        return sourceControl.QueryWorkspaces(null, sourceControl.AuthenticatedUser, System.Net.Dns.GetHostName().ToString());

        //You also can get remote workspaces

        //QueryWorkspaces(worspaceName,worksapceOwner,computer)

    }

    catch

    {

        throw;

    }

}

Step 3 – Display workspace details.

if (comboBox1.SelectedItem != null)

{

    WorkSpaceItem item = (WorkSpaceItem)comboBox1.SelectedItem;

    info.Text = Convert.ToString(item.WorkSpace);

}

 

Download Demo

Email Reporter: VSTS 2008 Load Test Plug-in

Email Reporter: VSTS 2008 Load Test Plug-in

Microsoft’s Visual Studio Team System Test Edition provides a powerful platform to perform high volume load testing. It also provides high end flexibilities to write and utilize external plug-in for extended functionalities.

"Email Reporter: VSTS 2008 Load Test Plug-in" enables users to send the load test reports to one or more pre-configured email addresses automatically, once a VSTS Load Test is completed. This open-source load test plug-in also provides supports for customization by which you can customize the reported performance data.

You can download it from here - http://code.msdn.microsoft.com/erep

image

Unhook The Link Between Microsoft Project and TFS

Unhook The Link Between Microsoft Project and TFS

Some times you need to bind the project file with another TFS or if you made some mapping changes and need to rebind this connection.

There is no easy way to unhook the the binding between Ms Project and TFS:

  1. Close Microsoft Project
  2. Right click on the mpp file and choose Properties.
  3. Choose the Custom tab in the Properties window.
  4. Choose any Property listed there named "VS  Team System Data Do Not Edit" and click Remove.
  5. Click Apply or Ok.
  6. Open the mpp file, and you will get a message saying its not associated with any TFS server. Click Ok and Save it.
  7. You will not get the error message every time you open the mpp file as long as you save it once after the message is received.

If you are using Ms Project Server you need to perform those steps before:

  1. Close MS Project.
  2. Disable the TFS addin by going to HKLM\Software\Microsoft\Office\MS Project\Addins\TfcOfficeShim.Connect
    and change the ‘LoadBehavior’ from ‘3’ to ‘0’.
  3. Open your project from Project server
  4. Go to step 3 in the instruction above.

2

Oracle Support For Visual Studio Team Edition Database Edition

Oracle Support For Visual Studio Team Edition Database Edition

Quest Software announced released Oracle Support on the Feb 24, 2009 that it will offer Oracle support for Microsoft Visual Studio Team System (VSTS) 2010!
Quest will produce an Oracle Database Schema Provider (DSP) which will integrate Oracle with Visual Studio Database Edition and allow Oracle Developers using Visual Studio Team System to perform offline design, development and change management for Oracle databases, similarly to how Visual Studio Team System works with Microsoft® SQL Server™ databases

See Team Fuze site for more information

This is Why Load Testing Is Important Not Just Before Release

This is Why Load Testing Is Important Not Just Before Release

After a short conversation with one of my customers he told me that a month ago he invited a “Load Expert”  to perform load testing just before the company release the product.
After the “Load Expert” exam the system he said every thing will be all right, 30 people is nothing I’m 99% sure nothing will happen.

the customer asked him to perform the load test any way just to be sure… and the test passed just fine!

Then I got a call from the customer and he asked me to perform a load testing on their system.

Hey told me that he wants a second opinion, I exam the system and I found the major scenarios want to test.

After running the Load Test (Using Team System Team Edition – Obvious) we saw that even 30 users on their system cause very very very bad behavior.

Diving into the little details, me and the developers found couple of major problems (Security,Performance and more)

 

The story ends with – 2 month delay of the release.

Team System Team Edition Load Summery

1