Strange XmlSerializer behaviour

M

Michael Dyremo

Hello!
We have a serious problem with the class
System.Xml.Serialization.XmlSerializer
in .NET 1.1. The problem has occured on Windows 2000
Servers with Service Pack 2, 3 and 4. We havent tested
on Windows 2003 Servers yet. The error occurs on
some servers, but not on all. This code worked fine
in .NET 1.0.
The code looks like this:

XmlSerializer xs1 = new XmlSerializer(typeof
(MyClass1), "urn:name1");
XmlSerializer xs2 = new XmlSerializer(typeof
(MyClass2), "urn:name2");
XmlSerializer xs3 = new XmlSerializer(typeof
(MyClass3), "urn:name3");
XmlSerializer xs4 = new XmlSerializer(typeof
(MyClass4), "urn:name4");
XmlSerializer xs5 = new XmlSerializer(typeof
(MyClass5), "urn:name5");

The first 3 or 4 rows work fine, but then we get the
exception attached below. The problem does only occur (in
out tests) when we have signed the exe-file with our key.
An unsigned assembly does not seem to have this problem.
Our key is set to FullTrust.
Also, when running a test-program on this, I found that
the code above were executing very slow when the assembly
was signed, and much faster when the assembly was
unsigned.

Is this a known problem in .NET 1.1?
Is there a way to get around it?
I have a small test-program I can send you, if you want.


Unhandled Exception: System.TypeInitializationException:
The type initializer fo
r "Lettera.Sys.Services.MQ.Adapter.Entrypoint" threw an
exception. ---> System.I
O.FileNotFoundException: File or assembly name
s_ywqtnb.dll, or one of its depen
dencies, was not found.
File name: "s_ywqtnb.dll"
at System.Reflection.Assembly.nLoad(AssemblyName
fileName, String codeBase, B
oolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Ass
embly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad
(AssemblyName assemblyRef, Boolean
stringized, Evidence assemblySecurity, StackCrawlMark&
stackMark)
at System.Reflection.Assembly.Load(AssemblyName
assemblyRef, Evidence assembl
ySecurity)
at
System.CodeDom.Compiler.CompilerResults.get_CompiledAssemb
ly()
at
System.CodeDom.Compiler.CompilerResults.get_CompiledAssemb
ly()
at System.Xml.Serialization.Compiler.Compile()
at System.Xml.Serialization.TempAssembly..ctor
(XmlMapping[] xmlMappings)
at System.Xml.Serialization.XmlSerializer..ctor(Type
type, String defaultName
space)
at Lettera.Sys.Services.MQ.Adapter.Entrypoint..cctor()
in D:\Proj.NET\Edm\V-S
tore\MqAdapters\VStoreAdapter100\Entrypoint.cs:line 483

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\DOCUME~1
\lettera\LOCALS~1\Temp\1\s_ywqtnb.dll

LOG: Appbase =
D:\Lettera\Environments\Accept\Support\Test\
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time
(private, custom, partia
l, or location-based assembly bind).
LOG: Attempting download of new URL
file:///C:/DOCUME~1/lettera/LOCALS~1/Temp/1/
s_ywqtnb.dll.

--- End of inner exception stack trace ---
at Lettera.Sys.Services.MQ.Adapter.Entrypoint.Main
(String[] args)
 
T

Tian Min Huang

Hello Michael,

Thanks for your post. Could you post a small test program and tell me the
detailed steps to reproduce the problem? I will be glad to check it on my
side.

I look forward to hearing from you.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
M

Michael Dyremo

Hello.
Thank you for your quick response!
I have mailed you the small test program to your
mailaddress.

Regards, Michael Dyremo
 
T

Tian Min Huang

Hi Michael,

I did not receive the sample. Did you remove "online" from my email address?

I look forward to hearing from you.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
M

Michael Dyremo

Hello!
I missed to remove the 'online' part. :)
I have sent you a new mail.
Regards, Michael.
 
T

Tian Min Huang

Hi Michael,

Thanks for your patience. I am not able to reproduce the problem on my
side, I checked on several Windows 2000 and Windows 2003 systems. I will
test on more machines.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top