Reputation:
My Windows Form application (created in Visual Studio 2008 using C#) is distributed across our company and runs on 50+ PCs with no issues.
Yesterday, I had to install it on an old PC running WinXP. My Visual Studio 2008 Setup project prompted to install the .Net Framework 3.5 SP1. We installed that, rebooted, then continued the installation.
After installation, I turned the old machine off, waited about 5 seconds, then turned it back on.
When I attempted to run the application, I got the Unhandled exception: "Could not load type 'System.DateTimeOffset' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5... blah, blah, blah.
Why didn't the 3.5 SP1 install the DateTimeOffset
feature?
Why is the application trying to load this from mscorlib version 2.0
?
I did a search for the keyword DateTimeOffset
, but it does not exist anywhere in my project. Is this a part of DateTime
(i.e. DateTime.Now.AddDays(1)
)?
Here's a copy of the full blown exception:
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.TypeLoadException: Could not load type 'System.DateTimeOffset' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at System.ComponentModel.ReflectTypeDescriptionProvider.get_IntrinsicTypeConverters() at System.ComponentModel.ReflectTypeDescriptionProvider.ReflectedTypeData.GetConverter(Object instance) at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetConverter() at System.ComponentModel.TypeDescriptor.GetConverter(Type type) at System.Windows.Forms.ListControl.GetItemText(Object item) at System.Windows.Forms.ComboBox.NativeAdd(Object item) at System.Windows.Forms.ComboBox.OnHandleCreated(EventArgs e) at System.Windows.Forms.Control.WmCreate(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ComboBox.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) ************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- Suite Assembly Version: 2.2.21.30536 Win32 Version: 2.2.21 CodeBase: file:///C:/Program%20Files/Aaon%20Coil%20Products,%20Inc/ACP%20Software%20Suite/Suite.exe ---------------------------------------- System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System.Core Assembly Version: 3.5.0.0 Win32 Version: 3.5.30729.1 built by: SP CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll ---------------------------------------- Accessibility Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll ---------------------------------------- System.Data Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll ---------------------------------------- AcpFormHeader Assembly Version: 1.0.5.0 Win32 Version: 1.0.5 CodeBase: file:///C:/Program%20Files/Aaon%20Coil%20Products,%20Inc/ACP%20Software%20Suite/AcpFormHeader.DLL ---------------------------------------- System.Xml Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- ************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled. For example: When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.
Upvotes: 2
Views: 5742
Reputation: 11
I got the same problem today. I was inserting the values in a DataVisualization.Charting.Series this way
MaSerie.Points.AddXY(x, y)
I change my code for this and the DateTimeOffset error disappear
MaSerie.Points.Add(New DataVisualization.Charting.DataPoint(x, y))
Upvotes: 1
Reputation: 942010
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
Something went seriously wrong during the install. Revision 42 was the original .NET 2.0 release. The trace also shows 2.0.50727.3053, that's a good one. Right now, the machine has a mix-match of assembly versions. The exception is indeed expected with that. No idea of course how this happened, I'm guessing a bad 3.5 install on top of an existing 2.0 install. Or you forgot to reboot the machine after installing.
Upvotes: 2