<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Wandering through the Wilderness - Enterprise</title>
    <link>http://www.julmar.com/blog/mark/</link>
    <description>... a journey through WPF, MVVM and .NET4</description>
    <language>en-us</language>
    <copyright>Mark Smith</copyright>
    <lastBuildDate>Mon, 28 Aug 2006 11:45:13 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>mark@julmar.com</managingEditor>
    <webMaster>mark@julmar.com</webMaster>
    <item>
      <trackback:ping>http://www.julmar.com/blog/mark/Trackback.aspx?guid=ede5f8e9-7d52-413b-8553-99faa147e2bd</trackback:ping>
      <pingback:server>http://www.julmar.com/blog/mark/pingback.aspx</pingback:server>
      <pingback:target>http://www.julmar.com/blog/mark/PermaLink,guid,ede5f8e9-7d52-413b-8553-99faa147e2bd.aspx</pingback:target>
      <dc:creator>Mark</dc:creator>
      <wfw:comment>http://www.julmar.com/blog/mark/CommentView,guid,ede5f8e9-7d52-413b-8553-99faa147e2bd.aspx</wfw:comment>
      <wfw:commentRss>http://www.julmar.com/blog/mark/SyndicationService.asmx/GetEntryCommentsRss?guid=ede5f8e9-7d52-413b-8553-99faa147e2bd</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">One question I get a lot when teaching
the VSTS course is "How can I move tasks or bugs from our existing system into TFS?" 
<br /><br />
The answer is quite simple: write a program that utilizes the Team Systems Object
Model. 
<br /><br />
The Object Model is documented partially in the VSIP SDK -- if you intend to work
with it, I highly recommend you go and grab that SDK from Microsoft, but here is a
simple example of creating a bug in the first Team Project available on the server
named <b>TFSServer</b> (you can imagine the rest which uses ADO.NET to pull your existing
tracking tickets from whatever system you have): 
<br /><br /><style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: large;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style><div class="csharpcode"><pre><span class="lnum"> 1: </span><span class="kwrd">using</span> System;</pre><pre><span class="lnum"> 2: </span><span class="kwrd">using</span> System.Collections;</pre><pre><span class="lnum"> 3: </span><span class="kwrd">using</span> System.Collections.Generic;</pre><pre><span class="lnum"> 4: </span><span class="kwrd">using</span> System.Text;</pre><pre><span class="lnum"> 5: </span><span class="kwrd">using</span> Microsoft.TeamFoundation.Client;</pre><pre><span class="lnum"> 6: </span><span class="kwrd">using</span> Microsoft.TeamFoundation.WorkItemTracking.Client;</pre><pre><span class="lnum"> 7: </span></pre><pre><span class="lnum"> 8: </span><span class="kwrd">namespace</span> EnterWorkItems</pre><pre><span class="lnum"> 9: </span>{</pre><pre><span class="lnum"> 10: </span><span class="kwrd">class</span> Program</pre><pre><span class="lnum"> 11: </span> {</pre><pre><span class="lnum"> 12: </span><span class="kwrd">static</span><span class="kwrd">void</span> Main(<span class="kwrd">string</span>[]
args)</pre><pre><span class="lnum"> 13: </span> {</pre><pre><span class="lnum"> 14: </span> TeamFoundationServer tfs = <span class="kwrd">new</span> TeamFoundationServer(<span class="str">"TFSServer"</span>);</pre><pre><span class="lnum"> 15: </span> WorkItemStore wis = (WorkItemStore) tfs.GetService(<span class="kwrd">typeof</span>(WorkItemStore));</pre><pre><span class="lnum"> 16: </span></pre><pre><span class="lnum"> 17: </span> Project teamProject = wis.Projects[0];</pre><pre><span class="lnum"> 18: </span><span class="kwrd">foreach</span> (WorkItemType
wit <span class="kwrd">in</span> teamProject.WorkItemTypes)</pre><pre><span class="lnum"> 19: </span> Console.WriteLine(wit.Name);</pre><pre><span class="lnum"> 20: </span></pre><pre><span class="lnum"> 21: </span> WorkItemCollection wic = wis.Query(<span class="str">"Project='Test'
AND Type='Bug'"</span>);</pre><pre><span class="lnum"> 22: </span><span class="kwrd">foreach</span> (WorkItem wiEntry <span class="kwrd">in</span> wic)</pre><pre><span class="lnum"> 23: </span> {</pre><pre><span class="lnum"> 24: </span> }</pre><pre><span class="lnum"> 25: </span></pre><pre><span class="lnum"> 26: </span> WorkItemType witBug = teamProject.WorkItemTypes[<span class="str">"Bug"</span>];</pre><pre><span class="lnum"> 27: </span><span class="kwrd">if</span> (witBug != <span class="kwrd">null</span>)</pre><pre><span class="lnum"> 28: </span> {</pre><pre><span class="lnum"> 29: </span> Console.WriteLine(<span class="str">"Adding new
bug to Team Project {0}"</span>, teamProject.Name);</pre><pre><span class="lnum"> 30: </span></pre><pre><span class="lnum"> 31: </span> WorkItem wi = <span class="kwrd">new</span> WorkItem(witBug);</pre><pre><span class="lnum"> 32: </span> wi.Description = <span class="str">"This is a
sample bug which was added through the object model"</span>;</pre><pre><span class="lnum"> 33: </span> wi.Reason = <span class="str">"New"</span>;</pre><pre><span class="lnum"> 34: </span> wi.Title = <span class="str">"You have Bugs!
[Ding]"</span>;</pre><pre><span class="lnum"> 35: </span></pre><pre><span class="lnum"> 36: </span> wi.Save();</pre><pre><span class="lnum"> 37: </span> Console.WriteLine(<span class="str">"Added Work
Item # {0} created by {1}"</span>, wi.Id, wi.CreatedBy);</pre><pre><span class="lnum"> 38: </span> }</pre><pre><span class="lnum"> 39: </span> }</pre><pre><span class="lnum"> 40: </span> }</pre><pre><span class="lnum"> 41: </span>}</pre></div><br /><br />
Breaking this down a bit, the first main piece of code is the connection to the Team
Server itself. This is accomplished on line 14 by creating a new <b>TeamFoundationServer</b> object.
An optional constructor allows for credentials to be provided, otherwise it logs on
as the current principle. 
<br /><br />
Next, we retrieve the <b>WorkItemStore</b>. Almost everything in the object model
is accessed through the <b>IServiceProvider</b> interface which provides a <b>GetService</b> method
where you pass in the <b>System.Type</b> object you want to work with. This is a nice
versioning technique that is utilized in many other Microsoft technologies as well. 
<br /><br />
With the WorkItemStore, you can then query work item type definitions, one of which
is necessary to create a <b>WorkItem</b>. You fill in the details for the Work Item
you want to create and call the <b>Save</b> method (line 36) to commit the changes
to the TFS store. The WorkItem id will then be valid and could be added to the existing
bug tracking system as a forward link to the new information if you wanted.</body>
      <title>Creating TFS Work Items programatically</title>
      <guid isPermaLink="false">http://www.julmar.com/blog/mark/PermaLink,guid,ede5f8e9-7d52-413b-8553-99faa147e2bd.aspx</guid>
      <link>http://www.julmar.com/blog/mark/2006/08/28/CreatingTFSWorkItemsProgramatically.aspx</link>
      <pubDate>Mon, 28 Aug 2006 11:45:13 GMT</pubDate>
      <description>One question I get a lot when teaching the VSTS course is "How can I move tasks or bugs from our existing system into TFS?"  
&lt;br /&gt;
&lt;br /&gt;
The answer is quite simple: write a program that utilizes the Team Systems Object
Model. 
&lt;br /&gt;
&lt;br /&gt;
The Object Model is documented partially in the VSIP SDK -- if you intend to work
with it, I highly recommend you go and grab that SDK from Microsoft, but here is a
simple example of creating a bug in the first Team Project available on the server
named &lt;b&gt;TFSServer&lt;/b&gt; (you can imagine the rest which uses ADO.NET to pull your existing
tracking tickets from whatever system you have): 
&lt;br /&gt;
&lt;br /&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: large;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;div class="csharpcode"&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 4: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Text;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 5: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Microsoft.TeamFoundation.Client;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 6: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Microsoft.TeamFoundation.WorkItemTracking.Client;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 7: &lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 8: &lt;/span&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; EnterWorkItems&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 9: &lt;/span&gt;{&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 10: &lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Program&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 11: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 12: &lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main(&lt;span class="kwrd"&gt;string&lt;/span&gt;[]
args)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 13: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 14: &lt;/span&gt; TeamFoundationServer tfs = &lt;span class="kwrd"&gt;new&lt;/span&gt; TeamFoundationServer(&lt;span class="str"&gt;"TFSServer"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 15: &lt;/span&gt; WorkItemStore wis = (WorkItemStore) tfs.GetService(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(WorkItemStore));&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 16: &lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 17: &lt;/span&gt; Project teamProject = wis.Projects[0];&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 18: &lt;/span&gt; &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (WorkItemType
wit &lt;span class="kwrd"&gt;in&lt;/span&gt; teamProject.WorkItemTypes)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 19: &lt;/span&gt; Console.WriteLine(wit.Name);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 20: &lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 21: &lt;/span&gt; WorkItemCollection wic = wis.Query(&lt;span class="str"&gt;"Project='Test'
AND Type='Bug'"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 22: &lt;/span&gt; &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (WorkItem wiEntry &lt;span class="kwrd"&gt;in&lt;/span&gt; wic)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 23: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 24: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 25: &lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 26: &lt;/span&gt; WorkItemType witBug = teamProject.WorkItemTypes[&lt;span class="str"&gt;"Bug"&lt;/span&gt;];&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 27: &lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (witBug != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 28: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 29: &lt;/span&gt; Console.WriteLine(&lt;span class="str"&gt;"Adding new
bug to Team Project {0}"&lt;/span&gt;, teamProject.Name);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 30: &lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 31: &lt;/span&gt; WorkItem wi = &lt;span class="kwrd"&gt;new&lt;/span&gt; WorkItem(witBug);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 32: &lt;/span&gt; wi.Description = &lt;span class="str"&gt;"This is a
sample bug which was added through the object model"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 33: &lt;/span&gt; wi.Reason = &lt;span class="str"&gt;"New"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 34: &lt;/span&gt; wi.Title = &lt;span class="str"&gt;"You have Bugs!
[Ding]"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 35: &lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 36: &lt;/span&gt; wi.Save();&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 37: &lt;/span&gt; Console.WriteLine(&lt;span class="str"&gt;"Added Work
Item # {0} created by {1}"&lt;/span&gt;, wi.Id, wi.CreatedBy);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 38: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 39: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 40: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 41: &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Breaking this down a bit, the first main piece of code is the connection to the Team
Server itself. This is accomplished on line 14 by creating a new &lt;b&gt;TeamFoundationServer&lt;/b&gt; object.
An optional constructor allows for credentials to be provided, otherwise it logs on
as the current principle. 
&lt;br /&gt;
&lt;br /&gt;
Next, we retrieve the &lt;b&gt;WorkItemStore&lt;/b&gt;. Almost everything in the object model
is accessed through the &lt;b&gt;IServiceProvider&lt;/b&gt; interface which provides a &lt;b&gt;GetService&lt;/b&gt; method
where you pass in the &lt;b&gt;System.Type&lt;/b&gt; object you want to work with. This is a nice
versioning technique that is utilized in many other Microsoft technologies as well. 
&lt;br /&gt;
&lt;br /&gt;
With the WorkItemStore, you can then query work item type definitions, one of which
is necessary to create a &lt;b&gt;WorkItem&lt;/b&gt;. You fill in the details for the Work Item
you want to create and call the &lt;b&gt;Save&lt;/b&gt; method (line 36) to commit the changes to the TFS store.  The WorkItem id will then be valid and could be added to the existing bug tracking system as a forward link to the new information if you wanted.</description>
      <comments>http://www.julmar.com/blog/mark/CommentView,guid,ede5f8e9-7d52-413b-8553-99faa147e2bd.aspx</comments>
      <category>.NET</category>
      <category>Enterprise</category>
    </item>
    <item>
      <trackback:ping>http://www.julmar.com/blog/mark/Trackback.aspx?guid=b883c0c6-1c9e-4d9e-95a0-82c7465b979a</trackback:ping>
      <pingback:server>http://www.julmar.com/blog/mark/pingback.aspx</pingback:server>
      <pingback:target>http://www.julmar.com/blog/mark/PermaLink,guid,b883c0c6-1c9e-4d9e-95a0-82c7465b979a.aspx</pingback:target>
      <dc:creator>Mark</dc:creator>
      <wfw:comment>http://www.julmar.com/blog/mark/CommentView,guid,b883c0c6-1c9e-4d9e-95a0-82c7465b979a.aspx</wfw:comment>
      <wfw:commentRss>http://www.julmar.com/blog/mark/SyndicationService.asmx/GetEntryCommentsRss?guid=b883c0c6-1c9e-4d9e-95a0-82c7465b979a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I was having lunch with an associate a
while back and he mentioned a need to move a work item from one team project to another.
While there isn't any direct support for this from the Team Explorer interface, I
figured it couldn't be too hard to manipulate the underlying database and achieve
the results - it's just SQL Server right? I hadn't actually <b>looked</b> at the schema
mind you, I'm an optimist.<br /><br />
It wasn't quite as simple as I thought - it felt like the database had been designed
by the security group and intentionally obscured for privacy. The TFS database is
fairly generic (so that it can add arbitrary items into the schema for custom project
types) and has been somewhat secured to protect the code itself - the stored procedures
are encrypted and SQL Profiler doesn't give much information on what's happening.<br /><br />
So, I spent a week or so looking at the schema for the Work Item system and a lot
of trial and error. End result is that I got a simple application to move work items
around. This application does a couple of other things as well - lists projects, active
web services, etc. I was mostly playing with the schema and trying to figure things
out. It's just a console application but it does the job.<br /><br /><a href="http://www.julmar.com/samples/TfsCmd.zip">Here's</a> the code, <b><u>use
at your own risk (a.k.a. if it screws up your system, I can't help you)</u></b>. The
source for the simple test project is included so you can see what was done and incorporate
it into your own code base if you like.<br /><br />
The program is fairly easy to use - a binary is included with the release. Issuing
the command with no parameters generates a simple "Help" page --<br /><br /><font face="Courier New"> C:\Work\TfsCmd&gt;<b>tfscmd</b><br />
TfsCmd [command] [/t tfsserver] [/u user] [/p password] [params]<br />
ListProjects - Lists the active projects on the TF server.<br />
TfsCmd ListProjects<br />
ListServices - Displays the web services exposed by the TF server.<br />
TfsCmd ListWebServices<br />
WQL - Execute a WorkItem Query.<br />
TfsCmd Wql [query]<br />
MoveWorkItem - Moves a work item from one Team Project to another<br />
TfsCmd MoveWorkItem [id] [ProjectName]<br /></font><br />
Executing a command will use your logged on user/password (domain credentials) unless
you supply a <b>/u</b> and <b>/p</b> parameter. For example, running the <b>ListProjects</b> command
generates something like:<br /><br /><font face="Courier New"> C:\Work\TfsCmd&gt;<b>tfscmd ListProjects</b><br />
Project Name: Test<br />
Status: WellFormed<br />
Guid: 8c5b175b-b0ef-46bb-9a9e-dde05bb145ac<br />
Process Template: MSF for Agile Software Development - v4.0<br />
Defined Properties: MSPROJ<br /></font><br />
Listing the web services just hits the underlying database to get the information: 
<br /><br /><font face="Courier New"> C:\Work\TfsCmd&gt;<b>tfscmd ListServices</b><br />
BuildStoreService = http://(local):8080/Build/v1.0/BuildStore.asmx<br />
BuildControllerService = http://(local):8080/Build/v1.0/BuildController.<br />
IBISEnablement = http://(local):8080/Build/v1.0/Integration.asmx<br />
LinkingProviderService = http://(local):8080/Build/v1.0/Integration.asmx<br />
IProjectMaintenance = http://(local):8080/Build/v1.0/Integration.asmx<br />
PublishTestResultsBuildService = http://(local):8080/Build/v1.0/PublishT tsBuildService.asmx<br /><br /></font> Moving work items is fairly easy - just provide the work item id (the numeric
identifier) and the new project name - this must match an existing project in your
TFS system. The tool will attempt to match up the iteration to a value in the new
project - if it cannot, it will default to the first iteration available.<br /><br /><br /><font face="Courier New"> C:\Work\TfsCmd&gt;<b>tfscmd MoveWorkItem 1 "Mark's New Project"</b><br />
Work Item #1: "Create Project Definition" is currently located in project "Test Project
(Iteration 0)"<br />
Moving work item to "Mark's New Project (Iteration 0)"<br /><br /></font> If you have the TFS client open, then you should shut it down and reopen it
before modifying the moved work item - the client appears to cache bits of information
and I had some issues with moved items if I didn't clear the cache by closing the
work item window and reopening it.<br /><br />
Have fun! 
</body>
      <title>Moving Work Items from one Team Project to another</title>
      <guid isPermaLink="false">http://www.julmar.com/blog/mark/PermaLink,guid,b883c0c6-1c9e-4d9e-95a0-82c7465b979a.aspx</guid>
      <link>http://www.julmar.com/blog/mark/2006/07/17/MovingWorkItemsFromOneTeamProjectToAnother.aspx</link>
      <pubDate>Mon, 17 Jul 2006 18:05:53 GMT</pubDate>
      <description>I was having lunch with an associate a while back and he mentioned a need to move a work item from one team project to another.  While there isn't any direct support for this from the Team Explorer interface, I figured it couldn't be too hard to manipulate the underlying database and achieve the results - it's just SQL Server right?  I hadn't actually &lt;b&gt;looked&lt;/b&gt; at
the schema mind you, I'm an optimist.&lt;br /&gt;
&lt;br /&gt;
It wasn't quite as simple as I thought - it felt like the database had been designed
by the security group and intentionally obscured for privacy. The TFS database is
fairly generic (so that it can add arbitrary items into the schema for custom project
types) and has been somewhat secured to protect the code itself - the stored procedures
are encrypted and SQL Profiler doesn't give much information on what's happening.&lt;br /&gt;
&lt;br /&gt;
So, I spent a week or so looking at the schema for the Work Item system and a lot
of trial and error. End result is that I got a simple application to move work items
around. This application does a couple of other things as well - lists projects, active
web services, etc. I was mostly playing with the schema and trying to figure things
out. It's just a console application but it does the job.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.julmar.com/samples/TfsCmd.zip"&gt;Here's&lt;/a&gt; the code, &lt;b&gt;&lt;u&gt;use
at your own risk (a.k.a. if it screws up your system, I can't help you)&lt;/u&gt;&lt;/b&gt;. The
source for the simple test project is included so you can see what was done and incorporate
it into your own code base if you like.&lt;br /&gt;
&lt;br /&gt;
The program is fairly easy to use - a binary is included with the release. Issuing
the command with no parameters generates a simple "Help" page --&lt;br /&gt;
&lt;br /&gt;
&lt;font face="Courier New"&gt; C:\Work\TfsCmd&gt;&lt;b&gt;tfscmd&lt;/b&gt;
&lt;br /&gt;
TfsCmd [command] [/t tfsserver] [/u user] [/p password] [params]&lt;br /&gt;
ListProjects - Lists the active projects on the TF server.&lt;br /&gt;
TfsCmd ListProjects&lt;br /&gt;
ListServices - Displays the web services exposed by the TF server.&lt;br /&gt;
TfsCmd ListWebServices&lt;br /&gt;
WQL - Execute a WorkItem Query.&lt;br /&gt;
TfsCmd Wql [query]&lt;br /&gt;
MoveWorkItem - Moves a work item from one Team Project to another&lt;br /&gt;
TfsCmd MoveWorkItem [id] [ProjectName]&lt;br /&gt;
&lt;/font&gt; 
&lt;br /&gt;
Executing a command will use your logged on user/password (domain credentials) unless
you supply a &lt;b&gt;/u&lt;/b&gt; and &lt;b&gt;/p&lt;/b&gt; parameter. For example, running the &lt;b&gt;ListProjects&lt;/b&gt; command
generates something like:&lt;br /&gt;
&lt;br /&gt;
&lt;font face="Courier New"&gt; C:\Work\TfsCmd&gt;&lt;b&gt;tfscmd ListProjects&lt;/b&gt;
&lt;br /&gt;
Project Name: Test&lt;br /&gt;
Status: WellFormed&lt;br /&gt;
Guid: 8c5b175b-b0ef-46bb-9a9e-dde05bb145ac&lt;br /&gt;
Process Template: MSF for Agile Software Development - v4.0&lt;br /&gt;
Defined Properties: MSPROJ&lt;br /&gt;
&lt;/font&gt; 
&lt;br /&gt;
Listing the web services just hits the underlying database to get the information: 
&lt;br /&gt;
&lt;br /&gt;
&lt;font face="Courier New"&gt; C:\Work\TfsCmd&gt;&lt;b&gt;tfscmd ListServices&lt;/b&gt;
&lt;br /&gt;
BuildStoreService = http://(local):8080/Build/v1.0/BuildStore.asmx&lt;br /&gt;
BuildControllerService = http://(local):8080/Build/v1.0/BuildController.&lt;br /&gt;
IBISEnablement = http://(local):8080/Build/v1.0/Integration.asmx&lt;br /&gt;
LinkingProviderService = http://(local):8080/Build/v1.0/Integration.asmx&lt;br /&gt;
IProjectMaintenance = http://(local):8080/Build/v1.0/Integration.asmx&lt;br /&gt;
PublishTestResultsBuildService = http://(local):8080/Build/v1.0/PublishT tsBuildService.asmx&lt;br /&gt;
&lt;br /&gt;
&lt;/font&gt; Moving work items is fairly easy - just provide the work item id (the numeric
identifier) and the new project name - this must match an existing project in your
TFS system. The tool will attempt to match up the iteration to a value in the new
project - if it cannot, it will default to the first iteration available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;font face="Courier New"&gt; C:\Work\TfsCmd&gt;&lt;b&gt;tfscmd MoveWorkItem 1 "Mark's New Project"&lt;/b&gt;
&lt;br /&gt;
Work Item #1: "Create Project Definition" is currently located in project "Test Project
(Iteration 0)"&lt;br /&gt;
Moving work item to "Mark's New Project (Iteration 0)"&lt;br /&gt;
&lt;br /&gt;
&lt;/font&gt; If you have the TFS client open, then you should shut it down and reopen it
before modifying the moved work item - the client appears to cache bits of information
and I had some issues with moved items if I didn't clear the cache by closing the
work item window and reopening it.&lt;br /&gt;
&lt;br /&gt;
Have fun!

</description>
      <comments>http://www.julmar.com/blog/mark/CommentView,guid,b883c0c6-1c9e-4d9e-95a0-82c7465b979a.aspx</comments>
      <category>.NET</category>
      <category>Enterprise</category>
    </item>
    <item>
      <trackback:ping>http://www.julmar.com/blog/mark/Trackback.aspx?guid=e47f09cc-e893-46a6-aa13-7202d4e50986</trackback:ping>
      <pingback:server>http://www.julmar.com/blog/mark/pingback.aspx</pingback:server>
      <pingback:target>http://www.julmar.com/blog/mark/PermaLink,guid,e47f09cc-e893-46a6-aa13-7202d4e50986.aspx</pingback:target>
      <dc:creator>Mark</dc:creator>
      <wfw:comment>http://www.julmar.com/blog/mark/CommentView,guid,e47f09cc-e893-46a6-aa13-7202d4e50986.aspx</wfw:comment>
      <wfw:commentRss>http://www.julmar.com/blog/mark/SyndicationService.asmx/GetEntryCommentsRss?guid=e47f09cc-e893-46a6-aa13-7202d4e50986</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
A colleague of mine, <a href="http://blogs.advantaje.com/blog/kevin/Net/2006/04/15/Using-Config-Files-to-Manage-DataDrivenTesting-in-VSTS.html">Kev
Jones</a>, has posted some information on using a detached SQL Server database
for driving VSTS unit tests which works great if you need a full blown SQL implementation. 
However, if all you want is a simple data feed, you can also use an Excel file, and
as it turns out, it's pretty easy to do.
</p>
        <p>
Let's start by stealing Kev's sample, hopefully he won't mind -- say I have a starship
class with a <strong>FirePhotonTorpedo</strong> method:
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> Enterprise<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">  
private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> torpedosLeft
= 10;<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">  
public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> FirePhotonTorpedo(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> count)<br />
   {<br /></span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">     
if</span> (torpedosLeft &lt; count)<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">        
throw</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> ArgumentException(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"count"</span>);<br /><br />
      torpedosLeft -= count;<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">      //
Instruct bridge officer to "Fire!"</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">     
return</span> torpedosLeft;<br />
   }<br />
}</span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300" size="2">The
equivalent unit test might look something like:</font>
            </span>
          </span>
        </p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Verdana" color="#003300" size="2">
              <p>
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                    <font color="#000000">[TestMethod]</font>
                    <br />
public</span>
                  <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> TestFirePhotonTorpedo()<br />
{<br />
   Enterprise target <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> Enterprise();<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">  
int</span> torpedoCount <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> 5;<br />
   <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> expected <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> 5;<br /></span>
              </p>
              <p>
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">  
int</span> actual <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> target.FirePhotonTorpedo(torpedoCount);<br />
   Assert.AreEqual(expected, actual, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"FirePhotonTorpedo
did not return the expected value."</span>);<br />
}<br /></span>
              </p>
            </font>
          </span>
        </span>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300" size="2">This
code just tests a specific case -- I would also need to write other unit tests for
edge cases and exceptional cases.  I can do this several different ways I could
do this:</font>
            </span>
          </span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300" size="2">1)
Write a unit test for each specific case passing each value and testing the expected
result.<br />
2) Put all the tests into this one unit test function -- asserting each validation
as we go.<br />
3) Pull the input and expected out of a database and run them through
the function.</font>
            </span>
          </span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300" size="2">This
last step, as Kev details can be done from a SQL database - either one reachable by
all the people who might run the unit tests, or as his blog shows from a .MDF file
you check in with the project and then locally attach prior to running the unit tests. 
Hit the link above for the details on that. </font>
            </span>
          </span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300" size="2">So,
to make an Excel data-driven test, the first step is to create an Excel document with
columns for each of our pieces of data.  My sample Excel document has the following
columns:</font>
            </span>
          </span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <table width="100%" border="0">
                <tbody>
                  <tr>
                  </tr>
                  <font face="Verdana" color="#003300" size="2">
                    <td width="20%">
                      <strong>ID</strong>
                    </td>
                    <td width="80%">
A unique number identifying the row so we can use the Random data driven test</td>
                    <tr>
                      <td>
                        <strong>torpedoCount</strong>
                      </td>
                      <td>
The input for our unit test</td>
                    </tr>
                    <tr>
                      <td>
                        <strong>expected</strong>
                      </td>
                      <td>
The expected result coming out of the function</td>
                    </tr>
                    <tr>
                      <td>
                        <strong>shouldFail</strong>
                      </td>
                      <td>
Whether the function will throw an exception.</td>
                    </tr>
                  </font>
                </tbody>
              </table>
            </span>
          </span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300" size="2">I
can then enter a single test on each row of the given worksheet.  Here's
a screen shot --</font>
            </span>
          </span>
        </p>
        <p>
          <img src="http://www.julmar.com/blog/mark/content/binary/datadriven-excel1.JPG" border="0" />
        </p>
        <p>
You can create multiple "tables" by adding additional sheets to the worksheet. 
Each sheet can be named as appropriate; I'm naming this one "TorpedoData".
</p>
        <p>
Now, I need to add the appropriate attribute to my test case to indicate that it should
pull the data from a data source and run the method once per row found.  The
key is that <em>any</em> ADO.NET data source can be used.  Here I will specify
my Excel file which is named "UnitTests.xls" and indicate that the table itself is
a particular sheet within the Excel document "TorpedoData":
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300" size="2">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                    <font color="#000000">[TestMethod]<br /></font>
                  </span>
                </span>
              </font>
            </span>
          </span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300" size="2">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                    <font color="#000000">
                      <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                        <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                          <font face="Verdana" color="#003300" size="2">
                            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                                <font color="#000000">[DeploymentItem(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Tests.xls"</span>)] <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
Copies the file to the deployment directory</span></font>
                              </span>
                            </span>
                          </font>
                        </span>
                      </span>
                    </font>
                  </span>
                </span>
              </font>
            </span>
          </span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300" size="2">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                    <font color="#000000">
                      <br />
                    </font>
                    <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">[DataSource(<br /><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"System.Data.OleDb"</span>, <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
The provider</span><br /><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=<strong>'Tests.xls'</strong>;Persist Security Info=False;Extended Properties='Excel
8.0'"</span>,<br /><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"TorpedoData$"</span>,      <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
The table name, in this case, the sheet name with a '$' appended.</span><br />
DataAccessMethod.Sequential)]  </span>
                    <br />
public</span>
                  <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> TestFirePhotonTorpedo()<br />
{</span>
              </font>
            </span>
          </span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300" size="2">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <br />
                </span>
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">}<br /></span>
              </font>
            </span>
          </span>
        </p>
        <p>
I also need to update the test case itself to use the data -- we do that through the
TestContext.DataRow property that gives us access to the current row of data from
our data source:
</p>
        <p>
          <font face="Courier New">
            <font color="#0000ff">public</font>
            <font color="#000000">
            </font>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font size="2">void</font>
            </span>
          </font>
          <font face="Courier New" color="#000000"> TestFirePhotonTorpedo()<br />
{</font>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <br />
                  <font size="2">   Enterprise target <font color="#000000"><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> Enterprise();<br />
   </font></font>
                </span>
              </font>
            </span>
          </span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <font size="2">
                    <font color="#000000">
                      <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                        <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> torpedoCount <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> Convert.ToInt32(TestContext.DataRow[<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"torpedoCount"</span>]);<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   int</span> expected <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> Convert.ToInt32(TestContext.DataRow[<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"expected"</span>]);<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">  
bool</span> shouldFail <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> (<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">bool</span>)TestContext.DataRow[<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"shouldFail"</span>];<br /><br />
   TestContext.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Running
test with TorpedoCount={0}, ExpectedCount={1}, ShouldFail={2}"</span>,<br />
            torpedoCount, expected,
shouldFail);<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">  
try</span><br />
   {<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">     
int</span> actual <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> target.FireTorpedos(torpedoCount);<br />
      Assert.AreEqual(expected, actual, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"FireTorpedos
did not return the expected value."</span>);<br />
   }<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">  
catch</span> (Exception ex)<br />
   {<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">     
if</span> (!shouldFail)<br />
         Assert.Fail(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>.Format(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"FireTorpedo
threw exception {0}"</span>, ex.Message));<br />
   }<br /></span>
                    </font>
                  </font>
                </span>
              </font>
            </span>
          </span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <font size="2">
                    <font color="#000000">
                      <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">}</span>
                    </font>
                  </font>
                </span>
              </font>
            </span>
          </span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font>
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <font size="2">
                    <font size="2">
                      <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                      </span>
                    </font>
                  </font>
                </span>
              </font>
            </span>
          </span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <font size="2">
                    <font color="#000000">
                      <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                        <font face="Verdana" color="#003300" size="2">So,
here we will grab the data from the current row, converting it as necessary to the
appropriate types, output a test line just to prove that we executed the method more
than once and then run the test.  The test will compare the result with the expected
database result and output a failure if they aren't the same.  If an exception
is thrown, then the <strong>shouldFail </strong>must be true or that will be considered
a failure.</font>
                      </span>
                    </font>
                  </font>
                </span>
              </font>
            </span>
          </span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <font size="2">
                    <font color="#000000">
                      <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                        <font face="Verdana" color="#003300" size="2">This
approach allows me to run through different scenarios very easily and I can just store
the Excel worksheet right with my unit tests - make sure it's deployed to the target
deployment directory (either through a <strong>DeploymentItem</strong> attribute,
or through the test run configuration).  The size of my table here is about 14K,
compared to the equivalent .MDF file which is over 2M for the same data.  If
I didn't want to hardcode the filenames and such, I can also use an <strong>app.config</strong> file
for the unit test and put the information there - just as Kev details.</font>
                      </span>
                    </font>
                  </font>
                </span>
              </font>
            </span>
          </span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" color="#003300">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <font size="2">
                    <font color="#000000">
                      <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                        <font face="Verdana" color="#003300" size="2">Cool
stuff indeed.</font>
                      </span>
                    </font>
                  </font>
                </span>
              </font>
            </span>
          </span>
        </p>
      </body>
      <title>Using Excel for VSTS Data Driven Testing</title>
      <guid isPermaLink="false">http://www.julmar.com/blog/mark/PermaLink,guid,e47f09cc-e893-46a6-aa13-7202d4e50986.aspx</guid>
      <link>http://www.julmar.com/blog/mark/2006/05/01/UsingExcelForVSTSDataDrivenTesting.aspx</link>
      <pubDate>Mon, 01 May 2006 16:55:40 GMT</pubDate>
      <description>&lt;p&gt;
A colleague of mine, &lt;a href="http://blogs.advantaje.com/blog/kevin/Net/2006/04/15/Using-Config-Files-to-Manage-DataDrivenTesting-in-VSTS.html"&gt;Kev
Jones&lt;/a&gt;, has posted some information on using a detached&amp;nbsp;SQL Server database
for driving VSTS unit tests which works great if you need a full blown SQL implementation.&amp;nbsp;
However, if all you want is a simple data feed, you can also use an Excel file, and
as it turns out, it's pretty easy to do.
&lt;/p&gt;
&lt;p&gt;
Let's start by stealing Kev's sample, hopefully he won't mind -- say I have a starship
class with a &lt;strong&gt;FirePhotonTorpedo&lt;/strong&gt; method:
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; Enterprise&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;
private&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; torpedosLeft
= 10;&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;
public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; FirePhotonTorpedo(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; count)&lt;br&gt;
&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
if&lt;/span&gt; (torpedosLeft &amp;lt; count)&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
throw&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; ArgumentException(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"count"&lt;/span&gt;);&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; torpedosLeft -= count;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//
Instruct bridge officer to "Fire!"&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
return&lt;/span&gt; torpedosLeft;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
}&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;The
equivalent unit test&amp;nbsp;might look something like:&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font color=#000000&gt;[TestMethod]&lt;/font&gt;
&lt;br&gt;
public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; TestFirePhotonTorpedo()&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp; Enterprise target &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; Enterprise();&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;
int&lt;/span&gt; torpedoCount &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; 5;&lt;br&gt;
&amp;nbsp;&amp;nbsp; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; expected &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; 5;&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;
int&lt;/span&gt; actual &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; target.FirePhotonTorpedo(torpedoCount);&lt;br&gt;
&amp;nbsp;&amp;nbsp; Assert.AreEqual(expected, actual, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"FirePhotonTorpedo
did not return the expected value."&lt;/span&gt;);&lt;br&gt;
}&lt;br&gt;
&lt;/p&gt;
&lt;/span&gt;&gt;&lt;/span&gt;&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;This
code just tests a specific case -- I would also need to write other unit tests for
edge cases and exceptional cases.&amp;nbsp; I can do this several different ways I could
do this:&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;1)
Write a unit test for each specific case passing each value and testing the expected
result.&lt;br&gt;
2) Put all the tests into this one unit test function -- asserting each validation
as we go.&lt;br&gt;
3) Pull the&amp;nbsp;input and&amp;nbsp;expected&amp;nbsp;out of a database and run them through
the function.&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;This
last step, as Kev details can be done from a SQL database - either one reachable by
all the people who might run the unit tests, or as his blog shows from a .MDF file
you check in with the project and then locally attach prior to running the unit tests.&amp;nbsp;
Hit the link above for the details on that.&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;So,
to make an Excel data-driven test, the first step is to create an Excel document with
columns for each of our pieces of data.&amp;nbsp; My sample Excel document has the following
columns:&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; 
&lt;table width="100%" border=0&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;font face=Verdana color=#003300 size=2&gt; 
&lt;td width="20%"&gt;
&lt;strong&gt;ID&lt;/strong&gt;&lt;/td&gt;
&lt;td width="80%"&gt;
A unique number identifying the row so we can use the Random data driven test&lt;/td&gt;
&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;torpedoCount&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
The input for our unit test&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;expected&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
The expected result coming out of the function&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;shouldFail&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
Whether the function will throw an exception.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;I
can then enter&amp;nbsp;a single test on each&amp;nbsp;row of the given worksheet.&amp;nbsp; Here's
a screen shot --&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&gt;&lt;img src="http://www.julmar.com/blog/mark/content/binary/datadriven-excel1.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
You can create multiple "tables" by adding additional sheets to the worksheet.&amp;nbsp;
Each sheet can be named as appropriate; I'm naming this one "TorpedoData".
&lt;/p&gt;
&lt;p&gt;
Now, I need to add the appropriate attribute to my test case to indicate that it should
pull the data from a data source and run the method once per row found.&amp;nbsp; The
key is that &lt;em&gt;any&lt;/em&gt; ADO.NET data source can be used.&amp;nbsp; Here I will specify
my Excel file which is named "UnitTests.xls" and indicate that the table itself is
a particular sheet within the Excel document "TorpedoData":
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font color=#000000&gt;[TestMethod]&lt;br&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font color=#000000&gt;[DeploymentItem(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Tests.xls"&lt;/span&gt;)] &lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
Copies the file to the deployment directory&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font color=#000000&gt;
&lt;br&gt;
&lt;/font&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;[DataSource(&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"System.Data.OleDb"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
The provider&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=&lt;strong&gt;'Tests.xls'&lt;/strong&gt;;Persist Security Info=False;Extended Properties='Excel
8.0'"&lt;/span&gt;,&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"TorpedoData$"&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
The table name, in this case, the sheet name with a '$' appended.&lt;/span&gt;
&lt;br&gt;
DataAccessMethod.Sequential)]&amp;nbsp; &lt;/span&gt;
&lt;br&gt;
public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; TestFirePhotonTorpedo()&lt;br&gt;
{&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;
&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;}&lt;br&gt;
&lt;/p&gt;
&gt;&gt;&gt;&gt; 
&lt;p&gt;
I also need to update the test case itself to use the data -- we do that through the
TestContext.DataRow property that gives us access to the current row of data from
our data source:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;public&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font size=2&gt;void&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Courier New" color=#000000&gt; TestFirePhotonTorpedo()&lt;br&gt;
{&lt;/font&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;
&lt;br&gt;
&lt;font size=2&gt;&amp;nbsp;&amp;nbsp; Enterprise target &lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; Enterprise();&lt;br&gt;
&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font size=2&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; torpedoCount &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; Convert.ToInt32(TestContext.DataRow[&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"torpedoCount"&lt;/span&gt;]);&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;int&lt;/span&gt; expected &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; Convert.ToInt32(TestContext.DataRow[&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"expected"&lt;/span&gt;]);&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;
bool&lt;/span&gt; shouldFail &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; (&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;bool&lt;/span&gt;)TestContext.DataRow[&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"shouldFail"&lt;/span&gt;];&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp; TestContext.WriteLine(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Running
test with TorpedoCount={0}, ExpectedCount={1}, ShouldFail={2}"&lt;/span&gt;,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; torpedoCount, expected,
shouldFail);&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;
try&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
int&lt;/span&gt; actual &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; target.FireTorpedos(torpedoCount);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Assert.AreEqual(expected, actual, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"FireTorpedos
did not return the expected value."&lt;/span&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;
catch&lt;/span&gt; (Exception ex)&lt;br&gt;
&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
if&lt;/span&gt; (!shouldFail)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Assert.Fail(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;.Format(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"FireTorpedo
threw exception {0}"&lt;/span&gt;, ex.Message));&lt;br&gt;
&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font size=2&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;}&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font size=2&gt;&lt;font size=2&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font size=2&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;So,
here we will grab the data from the current row, converting it as necessary to the
appropriate types, output a test line just to prove that we executed the method more
than once and then run the test.&amp;nbsp; The test will compare the result with the expected
database result and output a failure if they aren't the same.&amp;nbsp; If an exception
is thrown, then the &lt;strong&gt;shouldFail &lt;/strong&gt;must be true or that will be considered
a failure.&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font size=2&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;This
approach allows me to run through different scenarios very easily and I can just store
the Excel worksheet right with my unit tests - make sure it's deployed to the target
deployment directory (either through a &lt;strong&gt;DeploymentItem&lt;/strong&gt; attribute,
or through the test run configuration).&amp;nbsp; The size of my table here is about 14K,
compared to the equivalent .MDF file which is over 2M for the same data.&amp;nbsp; If
I didn't want to hardcode the filenames and such, I can also use an &lt;strong&gt;app.config&lt;/strong&gt; file
for the unit test and put the information there - just as Kev details.&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font size=2&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;Cool
stuff indeed.&lt;/font&gt;
&lt;/p&gt;
&gt;&gt;&gt;&gt;&gt;&gt;&gt;</description>
      <comments>http://www.julmar.com/blog/mark/CommentView,guid,e47f09cc-e893-46a6-aa13-7202d4e50986.aspx</comments>
      <category>.NET</category>
      <category>Code</category>
      <category>Enterprise</category>
    </item>
    <item>
      <trackback:ping>http://www.julmar.com/blog/mark/Trackback.aspx?guid=5553f6c8-9cf9-433e-b348-3cc06d6a4ee1</trackback:ping>
      <pingback:server>http://www.julmar.com/blog/mark/pingback.aspx</pingback:server>
      <pingback:target>http://www.julmar.com/blog/mark/PermaLink,guid,5553f6c8-9cf9-433e-b348-3cc06d6a4ee1.aspx</pingback:target>
      <dc:creator>Mark</dc:creator>
      <wfw:commentRss>http://www.julmar.com/blog/mark/SyndicationService.asmx/GetEntryCommentsRss?guid=5553f6c8-9cf9-433e-b348-3cc06d6a4ee1</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
So I spent the better part of a day getting a full Visual Studio Team Systems installation
running under VMWare.  In order to get it all to work together on a single server,
you have to have a bunch of components: Active Directory, SQL Server 2005, SQL Server
Reporting Services, SharePoint, Team Foundation Server, Office and finally VSTS itself. 
The first problem I ran into was just plain ignorance about SharePoint.  I started
with a prebuilt W2K3 server image that already had IIS setup.  I then turned
it into a domain server by installing Active Directory and then followed all the instructions.<br /><br />
I noticed that SharePoint didn't run properly and it appeared to be security related. 
I solved the issue by manually changing the security settings on the website, thought
to myself "well that's odd..." and moved on.  When I tried to create my first
VSTS project in the VM, it blew up saying SharePoint wasn't working properly. 
Ah.. ok.  So, a bit of reading on the SharePoint admin guide and I run into the
statement .. "You must install IIS <span style="FONT-WEIGHT: bold">after</span> installing
Active Directory".  Sigh. So, I blow away the image and start over.  Nothing
more fun that reinstalling a bunch of DVD images right?<br /><br />
The next run went a bit more smoothly, SharePoint appeared to work without me changing
anything, but I again had the same issue creating a project.  I check the event
log and find that Reporting Services won't start properly.  Weird.. it started
before.  I find out that it's because Reporting Services is configured for .NET
2.0 and SharePoint is configured for .NET 1.1 and they are trying to run in the same
host.  Obviously, that doesn't work - we can only start one version of the CLR
at a time.  SharePoint doesn't appear to run properly under 2.0 (or at least
I couldn't get it to run correctly and I didn't want to RTFM).  Instead, I found
that separating the two applications out to separate application pools did the trick
and I'm now off and running .. albeit slowly under a VM.  
</p>
        <p>
Ahhh.. let the modeling begin.<br /></p>
      </body>
      <title>Installing Visual Studio Team Systems</title>
      <guid isPermaLink="false">http://www.julmar.com/blog/mark/PermaLink,guid,5553f6c8-9cf9-433e-b348-3cc06d6a4ee1.aspx</guid>
      <link>http://www.julmar.com/blog/mark/2005/08/24/InstallingVisualStudioTeamSystems.aspx</link>
      <pubDate>Wed, 24 Aug 2005 20:37:19 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
So I spent the better part of a day getting a full Visual Studio Team Systems installation
running under VMWare.&amp;nbsp; In order to get it all to work together on a single server,
you have to have a bunch of components: Active Directory, SQL Server 2005, SQL Server
Reporting Services, SharePoint, Team Foundation Server, Office and finally VSTS itself.&amp;nbsp;
The first problem I ran into was just plain ignorance about SharePoint.&amp;nbsp; I started
with a prebuilt W2K3 server image that already had IIS setup.&amp;nbsp; I then turned
it into a domain server by installing Active Directory and then followed all the instructions.&lt;br&gt;
&lt;br&gt;
I noticed that SharePoint didn't run properly and it appeared to be security related.&amp;nbsp;
I solved the issue by manually changing the security settings on the website, thought
to myself "well that's odd..." and moved on.&amp;nbsp; When I tried to create my first
VSTS project in the VM, it blew up saying SharePoint wasn't working properly.&amp;nbsp;
Ah.. ok.&amp;nbsp; So, a bit of reading on the SharePoint admin guide and I run into the
statement .. "You must install IIS &lt;span style="FONT-WEIGHT: bold"&gt;after&lt;/span&gt; installing
Active Directory".&amp;nbsp; Sigh. So, I blow away the image and start over.&amp;nbsp; Nothing
more fun that reinstalling a bunch of DVD images right?&lt;br&gt;
&lt;br&gt;
The next run went a bit more smoothly, SharePoint appeared to work without me changing
anything, but I again had the same issue creating a project.&amp;nbsp; I check the event
log and find that Reporting Services won't start properly.&amp;nbsp; Weird.. it started
before.&amp;nbsp; I find out that it's because Reporting Services is configured for .NET
2.0 and SharePoint is configured for .NET 1.1 and they are trying to run in the same
host.&amp;nbsp; Obviously, that doesn't work - we can only start one version of the CLR
at a time.&amp;nbsp; SharePoint doesn't appear to run properly under 2.0 (or at least
I couldn't get it to run correctly and I didn't want to RTFM).&amp;nbsp; Instead, I found
that separating the two applications out to separate application pools did the trick
and I'm now off and running .. albeit slowly under a VM.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
Ahhh.. let the modeling begin.&lt;br&gt;
&lt;/p&gt;</description>
      <comments>http://www.julmar.com/blog/mark/CommentView,guid,5553f6c8-9cf9-433e-b348-3cc06d6a4ee1.aspx</comments>
      <category>Enterprise</category>
    </item>
  </channel>
</rss>