April 2008 - Posts - Ahmed Salijee

Ahmed Salijee

April 2008 - Posts

Practice your demos - and a little resolution to MissingMethodException

Last week during the VSTS event, I had some challenges when I tried to run my unit tests. I kept on getting an error to the effect that it could not find my method (a MissingMethodException) in the Helper assembly I created. I tried to clean the build and also rebuild it - the rebuild did not give any errors. I tried to remove the reference to the Helper assembly from my test project and put it back again. No luck. After awhile I gave up for this project and just created a new one - I got no errors. Wierd!

None the less, I was checking out the eval forms and noticed some attendees told me to practice my demos. A valid comment from someone sitting in the audience. Except in this case, I have practiced this demo (or at least variations of this demo) at least 20 times, if not more. The reason being that I used a similar demo for the launch events - and I did not get any errors at those events, thankfully. Sometimes, stuff just happens!

Getting back to the problem. I looked at it again today, without 100 for company. I decided to search for all Helper.dll files in the directory and remove it. After doing this my error went away. I put certain copies of the dll back and my errors reappeared. For some strange reason, it appears that the dlls from my release build were affecting my debug build. The release dll's were a bit older and probably did not have the method the tests wanted. Why it tried to pickup the release dll, I still have no idea. This is just my theory and I need to probably verify with something like filemon that it was picking up the wrong dll.

Another way of resolving this appears to do both a release and debug build - or alternatively doing a full clean of the release build.

 

Note - just did another test where I did the following:

Selected release build - removed ValidEmail function, compiled Helper.dll  - no errors

Selected debug build - added ValidEmail Function, compiled solution. no errors. Tried to run the unit test - got an error that ValidEmail does not exist

Selected release build - do a clean

Selected debug build - run test. All ok!

Shelveset and Workspace Questions

1) Can another user edit and save another user's shelveset.

No. You would need to save any changes in a new shelveset

2) Can I create 2 workspaces for 1 project.

Yes. I tried to demo this at the CPT event, but got an error that the workspace already exists. The reason for this error is below: (the comment comes from a response in an internal alias).

Local paths can only be mapped to a single workspace, and a path in one workspace cannot be under another workspace’s local path.  For example, if c:\x\y\z is mapped in workspace A, then no other workspace can map c:\x\y or c:\x or c:\ because that would result in c:\x\y\z being in more than one workspace.”

Later that evening (during a powercut) I tried to map to a different folder and it worked fine.

VSTS Resources

At the VSTS event I promised to post the various links to resources.

 

Documents etc

ALM Assessment

VSTS Installation Guide

VSTS Admin Guide

VSTS Guidance - more specifically P&P Team Development with TFS Guide. Performance Testing Guide documents available here. Branching guidance is here

Whitepaper on Requirements Management

Sarbanes Oxley and VSTS Whitepaper

 

Downloads

VSTS VPC - includes a bunch of labs

TFS PowerTools. Also see here for TFS05. Also looks like a new powertools version just got released. See here for more information.

MSSCCI Provider (08 version) - can be used to connect VB6/VS03 (and other third party IDEs) to TFS. TFS05 Version

TFS Admin Tool - can be used to  manage permissions across Sharepoint, Reporting Services and TFS.

 

Other

TeamPrise - use TFS from Eclipse.

Tools from Attrice - really nice.

TFS Widgets list - has lots more additional links.

.NET 3.5 Enhancements Training Kit

If you want to learn about the new stuff including ADO.NET Data Services,   ADO.NET Entity Framework, ASP.NET AJAX History,   ASP.NET Dynamic Data, ASP.NET MVC and ASP.NET Silverlight controls then check out the training available for download from here

I have a web application - Why do I need to "convert to web application"

I had the following scenario.

  • Created a new Web Application (which by the way is different to a Web Site Project).
  • Had an existing Web Site Project.
  • Copied files from the Web Site Project to the Web Application.
  • Got a bunch of errors along the lines of the control does not exist in current context.

 

Resolution

From the Web Application, right click and run "Convert to Web Application". This may seem strange - it did for me - as my project was already a Web Application but it turns out that running this command does some additional magic. As pointed out at Walkthrough: Converting a Web Site Project to a Web Application Project in Visual Studio 2005

One difference between a Visual Studio 2005 Web site project and a Visual Studio 2005 Web application project is that the Visual Studio 2005 Web site project model dynamically generates the tool-generated partial class and does not persist it on disk. However, the Visual Studio 2005 Web application project model saves this partial class on disk within files that have a .designer.cs file name extension. Also, the Web application project model compiles the partial class using the in-memory Visual Studio compilers when a build occurs.

and it explains what the conversion process does

This conversion process causes Visual Studio 2005 to recursively examine every page, user-control, and master-page in the project, and to automatically generate a .designer.cs file for each. Visual Studio also changes the .aspx or .ascx files to use the codeBehind attribute instead of the codeFile attribute. This command will also rename the App_Code file to Old_App_Code.

After running the command, the designer files were generated and my errors went away.

My custom tasks/targets are not getting downloaded in TFS 2008 - error MSB4019

I am prepping for next weeks VSTS session. Check here for more on the event. As part of that, I wanted to take an older demo from TFS05 to TFS08. This demo used a custom task and target that I downloaded. My Tfsproj file was sitting in subfolder (ProjectX) under TeamBuildTypes (in TFS08 you can you put it elsewhere). Under ProjectX I created a subfolder "Includes" and put the targets and related assemblies in this folder. I referenced the target from the tfsproj file.

I defined a build, using Team Build, but when the build got executed I got an error MSB4019, which indicated that the targets file could not be found. When browsing through the folder structure, this error made perfect sense as the directory "Includes" was downloaded but not the files inside it. I tried to setup a workspace mapping to download these files but it seems like the sources only get downloaded later. After some hunting and frustration, I found this forum post which pointed to this blog entry from Aaron Hallberg (if you are using Team Build, Aaron's blog is a must read). The resolution as mentioned in that post was to add the following line

<add key="ConfigurationFolderRecursionType" value="Full" />

to the TfsBuildService.exe.config file.

After doing this my tasks were downloaded and I learnt a bit more on how Team Build works.

Introduction to VSTS Event

We have a few requests from customers interested in what VSTS is all about. We have arranged the following event in JHB and CPT for later this month.

Introducing Visual Studio Team System – An End-To-End Walkthrough


Microsoft Visual Studio Team System is an integrated Application Life Cycle Management (ALM) solution comprising tools, processes, and guidance to help all members of a development team improve their skills and work effectively together. It provides an integrated set of tools for architecture, design, development, database development and testing of applications. Team members can continuously collaborate and utilize a complete set of tools and guidance at every step of the application life cycle.

This session will detail a sample end-to-end software development lifecycle scenario, which will demonstrate the features of the various client editions. We will also spend time in the scenario on the functionality provided by Team Foundation Server including work item tracking, project management, source control, build management and reporting.


Level – 200.
Audience - Developers, Developer Managers and Project Managers

 

You can register here for the JHB event. - 24 April

For CPT click here. - 21 April

 

Space is limited - more so in Cape Town so book soon.