tags:

views:

158

answers:

4

I've tried to develop a simple winform utility which is using xml file as its database. I've used VS 2008 express edition, C#.

When this utility tries to write into the xml file then this error is displayed on other computer. I've tried to provide System.Xml.dll & System.Xml.Linq.dll in the same folder on the other computer but no use.

What does it means? Any solution?

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.MissingMethodException: Method not found: 'Void System.Xml.XmlReaderSettings.set_MaxCharactersFromEntities(Int64)'.
   at System.Xml.Linq.XNode.GetXmlReaderSettings(LoadOptions o)
   at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
   at System.Xml.Linq.XDocument.Load(String uri)
   at Issues.Form1.button1_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.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.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Issues
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/sumsnl.LTSLFBD/Desktop/Process%20Improvement/Issues%20Register/Issues.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    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.832 (QFE.050727-8300)
    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.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
4u_pgrmq
    Assembly Version: 1.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.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:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

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.
+1  A: 

Do not provide System.Xml.dll & System.Xml.Linq.dll. They are part of the framework and should already be present in the GAC. Make sure that .NET 3.5 SP1 is installed on the user computer.

Darin Dimitrov
+4  A: 

It sounds like you are developing against .NET 3.5 but then deploying to a machine that only has .NET 2.0. That won't work.

Brian
+1  A: 

Form here: http://stackoverflow.com/questions/690967/facebook-toolkit-2-0-error-when-running-it-on-a-server-with-asp-net-2-0-install

Maybe you have the wrong .NET version on your target machine?

JD
I'm in my initial stages of learning to code with C#, how do u suggest me to take care of such things on client's computer?
gsvirdi
It's not really a C# issue, more that the client doesn't have the latest version of the .NET framework installed. If you get them to go to the Microsoft website (http://www.microsoft.com/NET/) they can download from there. If you are using VS2008 they will need framework 3.5 at least
JD
+1  A: 

Something very fishy going on in the exception dump. The call stack is clearly showing that it is executing Linq code, GetXmlReaderSettings() is only available in System.Xml.Linq, a .NET 3.5 assembly. The list of assemblies however doesn't show this assembly.

In fact that list looks corrupted, note the entry named "4u_pgrmq". Loaded from System.dll, already listed before.

The .NET revision number is very low, 832 ought to be somewhere around the .NET 3.0 timeframe. Possible evidence that you've added 3.5 assemblies to an earlier installed version.

Odds ought to be good that you'll solve this by simply installing .NET 3.5 SP1 on the machine.

Hans Passant
As a developer..... I can't go on and install things on a client computer. My utility is just few controls to accept user input and add them in the xml file. A webbrowser control displays the xml, formatting it with the help of a stylesheet file. I don't expect my utility to be an installation package full of assemblies, this is just a interface. Any better suggestions plz?????
gsvirdi
Looks to me you got into trouble by doing what you were not supposed to do, install things like Linq on a client computer. You'll have to stop using XDocument et al if you can't convince the sys admin or user to update the machine's .NET version. Have you in fact asked? What if the machine only has .NET 1.1? You've got a No, maybe you'll get a Yes. XDocument is not a real problem, XmlDocument gets the job done too.
Hans Passant
How do u suggest to handle such errors?? I'd been reading thru list of available Exceptions on MSDN. But no success..... Which exception should I use to Display such FrameWork errors on the Client Machine?????
gsvirdi
Erm, the .NET framework already generates an exception, you don't have to help.
Hans Passant