1
Vote

TFSWorkItem Crash

description

TFSWorkItem crashes when open cropper 'Options'
 
************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.TeamFoundation.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.TeamFoundation.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Cropper.TFSWorkItem.OptionsForm..ctor(TfsSettings settings)
at Cropper.TFSWorkItem.TFS.Fusion8.Cropper.Extensibility.IConfigurablePlugin.get_ConfigurationForm()
at Fusion8.Cropper.Options..ctor()
at Fusion8.Cropper.MainCropForm.ShowOptionsDialog()
at Fusion8.Cropper.MainCropForm.HandleMenuOptionsClick(Object sender, EventArgs e)
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItem.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Command.DispatchID(Int32 id)
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at Fusion8.Cropper.CropForm.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

comments

Cheeso wrote Dec 23, 2010 at 10:32 PM

Good to know. I will look into building some intelligence into the plugin so that it does not try to load if that DLL is not present. I guess you know the way to avoid this problem is to simply remove the SendToTFSWorkitem dll from the plugins directory. Thanks for reporting this.

Cheeso wrote Dec 27, 2010 at 3:31 PM

I think the way to fix this is to force the Send-to-TFS plugin to load the dependent assembly upon instantiation or load. This would happen if one of the types in the DLL implemented an interface defined in the 'Microsoft.TeamFoundation.Client' assembly. But that isn't a natural solution. There might be a better way to do it. I'll research.

If the Send-to-TFS plugin tries to resolve the 'Microsoft.TeamFoundation.Client' assembly as soon as the Send-to-TFS dll is loaded, in the way described above or in some other way, then when Cropper does its initial scan for plugins, Assembly.LoadFile will throw if the 'Microsoft.TeamFoundation.Client' dll is not present in the GAC. This will cause Cropper to not include the TFS plugin into the list of potential outputs, which will avoid the problem reported here.