Getting Exception "Common Language Runtime detected an invalid program"

Aug 19, 2008 at 6:33 PM

I'm getting a Common Language Runtime detected an invalid program exception while debuging the solution in VS 2008 with SP1. 

"   at Microsoft.TeamFoundation.Client.TeamFoundationServer.GetService(Type serviceType)\r\n   at Microsoft.Vsts.Ranger.Migration.TfsToTfs.Client.TfsHelper.GetTeamProjects() in G:\\DFS\\Projects\\Precio\\STEM\\TFS Migration\\Source\\TfsPartialCopyUI\\Common\\TfsHelper.cs:line 55\r\n   at Microsoft.Vsts.Ranger.Migration.TfsToTfs.Client.Controls.TeamProjectPicker.btnConnect_Click(Object sender, EventArgs e) in G:\\DFS\\Projects\\Precio\\STEM\\TFS Migration\\Source\\TfsPartialCopyUI\\Controls\\TeamProjectPicker.cs:line 77\r\n   at System.Windows.Forms.Control.OnClick(EventArgs e)\r\n   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)\r\n   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)\r\n   at System.Windows.Forms.Control.WndProc(Message& m)\r\n   at System.Windows.Forms.ButtonBase.WndProc(Message& m)\r\n   at System.Windows.Forms.Button.WndProc(Message& m)\r\n   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)"

Any idéas?


Aug 19, 2008 at 7:46 PM
This is just a shot in the dark, but are you doing this on a 64bit operating system?
Aug 19, 2008 at 9:12 PM
Yes, that was causing the problem. I'm using a 64 bit OS and by choosing the 32 bit target platform compiler mode, it worked just fine.