Unhandled Exception

Oct 3, 2010 at 4:34 PM

Hello

Below is the error I am getting when trying to use TFS Deployer with TFS 2010 hosted on a Windows Server 2008 R2 build box. 

Here is my mappings

<DeploymentMappings xmlns="http://www.readify.net/TfsDeployer/DeploymentMappings20100214">
	<Mapping xmlns=""
			   NotificationAdress="VSTFhelp@harleysvillegroup.com"
			   Computer="AS73TFSBUILD05"
		       BuildDefinitionPattern="HIC\.TFS\.Services\.Build"
			   OriginalQuality="Ready for Deployment"
			   NewQuality="Deploy2-DEV"
			   Script="Deploy.ps1" />
	
	<Mapping xmlns=""
				   NotificationAdress="VSTFhelp@harleysvillegroup.com"
				   Computer="AS73TFSBUILD05"
				   BuildDefinitionPattern="HIC\.TFS\.Services\.Build"
				   OriginalQuality="In-DEV"
				   NewQuality="Deploy2-DEV"
				   Script="Deploy.ps1" />


</DeploymentMappings>

Output for TfsDeployer.exe -d

TfsDeployer.exe Information: 0 : Notification Event Received Details as follows.
EventXml:
<?xml version="1.0" encoding="utf-16"?><BuildStatusChangeEvent xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="h
ttp://www.w3.org/2001/XMLSchema-instance"><BuildUri>vstfs:///Build/Build/4</BuildUri><TeamFoundationServerUrl>http://as7
3tfs02:8080/tfs/HIC</TeamFoundationServerUrl><TeamProject>Enterprise Incident Management</TeamProject><Title>Enterprise
Incident Management Build HIC.TFS.Services.Build_20101001.1 Quality Changed To Ready for Deployment</Title><Subscriber>C
ORP\tfsbuild</Subscriber><Id>HIC.TFS.Services.Build_20101001.1</Id><Url>http://as73tfs02:8080/tfs/web/build.aspx?pcguid=
b3cc7583-14dc-4996-bbe0-5c56ad57a632&amp;builduri=vstfs:///Build/Build/4</Url><TimeZone>Eastern Daylight Time</TimeZone>
<TimeZoneOffset>-04:00:00</TimeZoneOffset><ChangedTime>10/3/2010 12:08:42 PM</ChangedTime><StatusChange><FieldName>Quali
ty</FieldName><OldValue>Deploy2-DEV</OldValue><NewValue>Ready for Deployment</NewValue></StatusChange><ChangedBy>CORP\BH
OPENW</ChangedBy></BuildStatusChangeEvent>
TfsIdentityXml:
<TeamFoundationServer url="http://as73tfs02:8080/tfs/HIC/Services/v3.0/LocationService.asmx" />
TfsDeployer.exe Information: 0 : Deserializing Event of type Readify.Useful.TeamFoundation.Common.Notification.BuildStat
usChangeEvent from XML:
<?xml version="1.0" encoding="utf-16"?><BuildStatusChangeEvent xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="h
ttp://www.w3.org/2001/XMLSchema-instance"><BuildUri>vstfs:///Build/Build/4</BuildUri><TeamFoundationServerUrl>http://as7
3tfs02:8080/tfs/HIC</TeamFoundationServerUrl><TeamProject>Enterprise Incident Management</TeamProject><Title>Enterprise
Incident Management Build HIC.TFS.Services.Build_20101001.1 Quality Changed To Ready for Deployment</Title><Subscriber>C
ORP\tfsbuild</Subscriber><Id>HIC.TFS.Services.Build_20101001.1</Id><Url>http://as73tfs02:8080/tfs/web/build.aspx?pcguid=
b3cc7583-14dc-4996-bbe0-5c56ad57a632&amp;builduri=vstfs:///Build/Build/4</Url><TimeZone>Eastern Daylight Time</TimeZone>
<TimeZoneOffset>-04:00:00</TimeZoneOffset><ChangedTime>10/3/2010 12:08:42 PM</ChangedTime><StatusChange><FieldName>Quali
ty</FieldName><OldValue>Deploy2-DEV</OldValue><NewValue>Ready for Deployment</NewValue></StatusChange><ChangedBy>CORP\BH
OPENW</ChangedBy></BuildStatusChangeEvent>
TfsDeployer.exe Information: 0 : Deserializing Event of type Readify.Useful.TeamFoundation.Common.Notification.TfsIdenti
ty from XML:
<TeamFoundationServer url="http://as73tfs02:8080/tfs/HIC/Services/v3.0/LocationService.asmx" />
TfsDeployer.exe Information: 0 : Build Status Changed: Team Project Enterprise Incident Management  Team Build Version:
HIC.TFS.Services.Build_20101001.1 From Deploy2-DEV : Ready for Deployment
TfsDeployer.exe Information: 0 : Reading Configuration for Team Project: Enterprise Incident Management Team Build: HIC.
TFS.Services.Build
TfsDeployer.exe Information: 0 : Reading Configuration File:C:\Users\tfsbuild\AppData\Local\Temp\3\tmpDFC0.tmp
TfsDeployer.exe Error: 0 : System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
   at TfsDeployer.Configuration.ConfigurationReader.ReadMappings(IBuildDetail buildDetail) in c:\Users\Jason\Documents\D
ev\TfsDeployer\Trunk\TfsDeployer\TfsDeployer\Configuration\ConfigurationReader.cs:line 56
   at TfsDeployer.Deployer.ExecuteDeploymentProcess(BuildStatusChangeEvent statusChanged) in c:\Users\Jason\Documents\De
v\TfsDeployer\Trunk\TfsDeployer\TfsDeployer\Deployer.cs:line 69

 

Coordinator
Oct 4, 2010 at 8:19 AM

Hi,

You should remove the xmlns="" attribute from the Mapping elements. For example:

<Mapping NotificationAdress="VSTFhelp@harleysvillegroup.com"
			   Computer="AS73TFSBUILD05"
		       BuildDefinitionPattern="HIC\.TFS\.Services\.Build"
			   OriginalQuality="Ready for Deployment"
			   NewQuality="Deploy2-DEV"
			   Script="Deploy.ps1" />

 

Regards,

Jason

Oct 4, 2010 at 2:09 PM

Jason

Thanks for your quick reply, one note with TFS Deployer for TFS 2005 they deploymentmapping.xml works, Nevertheless, your suggestion did work, but I not have run into another issue.  Just to give some background, we heavily use TFS Deployer for our TFS 2005 environment and it works very well for us, now we are migrating to TFS 2010 thus why I trying to get TFS Deployer for TFS 2010 to work. 

My issue is my powershell failed which was an excepted outcome but the failure email was not sent.  As you can see the To variable is set to null, in Deployer 05 this was taken the for app.config but I believe in the 2010 version it is taken for the mappings xml. 

Am I missing something?

Below is the output for .\TFSDeployer.exe -d

TfsDeployer.exe Information: 0 : Sending email alert via server '172.20.2.15'
 From: 'me@localhost'
 To: ''
 Subject: Failed:  TfsDeployer Ran Script Deploy.ps1 on Machine AS73TFSBUILD05 for Enterprise Incident Management/HIC.TF
S.Services.Build/HIC.TFS.Services.Build_20101001.1

Team Project/Build: Enterprise Incident Management to HIC.TFS.Services.Build
Quality Change: In-DEV to Deploy2-DEV
Drop Location: \\as73tfs01\BuildStore\SRM\TFSEventServices\HIC.TFS.Services.Build\HIC.TFS.Services.Build_20101001.1
Build Uri: vstfs:///Build/Build/4
Script: Deploy.ps1
Executed on Machine: AS73TFSBUILD05
Output:
System.Management.Automation.ParentContainsErrorRecordException: Exception calling "Load" with "1" argument(s): "Could n
ot load file or assembly 'Microsoft.TeamFoundation.Client, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d5
0a3a' or one of its dependencies. The system cannot find the file specified."

At E:\TFS\HICPowerPlatform\Get-Tfs.ps1:9 char:45
+     [void][System.Reflection.Assembly]::Load <<<< ("Microsoft.TeamFoundation.Client, Version=$tfsSdkVersion, Culture=n
eutral, PublicKeyToken=B03F5F7F11D50A3A")


TfsDeployer.exe Error: 0 : System.NullReferenceException: Object reference not set to an instance of an object.
   at TfsDeployer.Alert.EmailAlerter.Alert(Mapping mapping, IBuildData build, DeployAgentResult deployAgentResult) in c:
\Users\Jason\Documents\Dev\TfsDeployer\Trunk\TfsDeployer\TfsDeployer\Alert\EmailAlerter.cs:line 63

Coordinator
Oct 4, 2010 at 9:12 PM

Hi,

The update to TFS Deployer to support TFS 2010 was quite significant and so the opportunity was taken improve the product at the expense of backward-compatibility. Moving the email address configuration from the app.config to the mappings file was done to get more configuration data under source control and reduce the amount of config kept on non-source controlled deployment agents.

You are seeing a blank To address on the alert emails because the responsible attribute in the mappings file is misspelled, specifically Address should have two Ds.

Jason

Oct 5, 2010 at 2:52 PM

Jason

Too funny that attributor is misspelled in all of my DeploymentMappings.xml in my TFS 2005 region (300+ team build types) thanks for the catch

Good thing is this can be corrected with a simple Powershell scripts

Thanks again

TFSDeployer rocks

 

BJ