chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
Problem: If TypeMock is initialized and an XmlSerializer construction is attempted for a type in a signed assembly, the construction will fail and throw due to a typeloading error.

TypeMock v 3.5.1.
.NET fwk 1.1

using System;
using System.Xml.Serialization;
using TypeMock;
using SignedAssemblyCode.AnyType;

public class Class1
{
   public static void Main()
   {
      MockManager.Init();
      XmlSerializer serializer2 = new XmlSerializer( typeof(SignedAssemblyCode.AnyType) );
      MockManager.Verify();
   }
}


The namespace SignedAssemblyCode is imported from another assembly SignedAssembly, which is signed.

To get this to work:
* Remove signing of assembly
* Remove MockManager.Init

Consequence: Any tests that use XmlSerializers for signed assemblies will fail.

It seems very coincidental but hopefully knowledge of typemock internals may make sense of this behavior.

/mawi
asked by mawi (2k points)

3 Answers

0 votes
Hi
First thank you for your excellent bug report. It really helped our developers to solve the bug 8)
We created a patch and I will send it to you offline.
answered by ohad (35.4k points)
0 votes
Hello,

thankyou for the patch - it is greatly appreciated!

It seems to have solved the issue - all tests now run, yay! Thank you for the excellent support.

Best regards!

PS
I think I should get a free license for my continued toils! ;-)
answered by mawi (2k points)
0 votes
Please see my bug report filed just now. Our assemblies are signed and you can see from the stack trace that the problem is around xmlserializers. Could they be the same issue?
answered by enjfdh (680 points)
...