M
Michael
Hi,
I'm having a problem with running an application that uses an assembly
I created, when run in the emulator.
The assembly uses XmlTextReader. Then calling the assembly's
constructor in the application, I get a TypeLoadException(). If I move
the XmlTextReader to the application, it works.
Additionally, if I call the XmlTextReader in the application before
calling the assembly's constructor (which contains the XmlTextReader),
it will work fine.
Lastly, if I load the XML assembly in the application, everything works
fine (Assembly a =
Assembly.LoadFrom(@"\Windows\GAC_System.Xml_v1_0_5000_0_cneutral_1.dll").
It seems that my application can't load the System.Xml assembly from my
class library unless the application uses XmlTextReader first.
To repro, I created a new smart device project. Then I add a class
library to the solution. The library looks like this:
using System;
using System.Reflection;
using System.Xml;
namespace SmartDeviceApplication2
{
public class Class1
{
public Class1()
{
XmlDocument doc = new XmlDocument();
XmlTextReader reader = null;
if (reader == null)
return;
}
}
}
The only changes made to the application is:
private void Form1_Load(object sender, System.EventArgs e)
{
Class1 c = new Class1();
}
Can anyone help me???
I'm having a problem with running an application that uses an assembly
I created, when run in the emulator.
The assembly uses XmlTextReader. Then calling the assembly's
constructor in the application, I get a TypeLoadException(). If I move
the XmlTextReader to the application, it works.
Additionally, if I call the XmlTextReader in the application before
calling the assembly's constructor (which contains the XmlTextReader),
it will work fine.
Lastly, if I load the XML assembly in the application, everything works
fine (Assembly a =
Assembly.LoadFrom(@"\Windows\GAC_System.Xml_v1_0_5000_0_cneutral_1.dll").
It seems that my application can't load the System.Xml assembly from my
class library unless the application uses XmlTextReader first.
To repro, I created a new smart device project. Then I add a class
library to the solution. The library looks like this:
using System;
using System.Reflection;
using System.Xml;
namespace SmartDeviceApplication2
{
public class Class1
{
public Class1()
{
XmlDocument doc = new XmlDocument();
XmlTextReader reader = null;
if (reader == null)
return;
}
}
}
The only changes made to the application is:
private void Form1_Load(object sender, System.EventArgs e)
{
Class1 c = new Class1();
}
Can anyone help me???