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
I have traced a problem down to TypeMock but not sure how extensive the problem is. All the issues started popping up with the latest source of NHibernate from the trunk so I thought the issue was there. Basically running the unit tests for NHibernate would produce an error similiar to this.

NHibernate.Test.CfgTest.ConfigurationFixture.CacheConfiguration : NHibernate.MappingException : Could not compile the mapping document: NHibernate.DomainModel.ABC.hbm.xml

  ----> System.InvalidOperationException : There is an error in XML document (0, 0).

  ----> System.InvalidProgramException : Common Language Runtime detected an invalid program.


basically its an issue with the XmlSerializer and TypeMock. After working with the NHibernate team and nobody could reproduce the error, I found this post http://forums.microsoft.com/MSDN/ShowPo ... 5&SiteID=1

The reporter ultimately figured out that uninstalling TypeMock fixed the problem. I simply disabled TypeMock from Vs.Net and that resolved the problem. ReEnabled TypeMock and the problem returned.

The issue seems to stem from a conflict between TypeMock and The XmlSerializer because the issue the NHibernate tests are with the XmlSerializer just as the poster describes in the link above.

Partial stack from NHibernate is

       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializerContract..ctor()

          --- End of inner exception stack trace ---

       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)

       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)

       at System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader)

       at NHibernate.Cfg.XmlHbmBinding.Binder.Deserialize[T](XmlNode node)


I saw that there are other issues with the CLR detecting an Invalid program and TypeMock on this forum. Hopefully this issue is being fixed. Otheriwse, let me know if I can provide more information to get this issue resolved.

Jesse
asked by juice_johnson (9.8k points)

33 Answers

0 votes
I have a very simple repro but it doesnt look like I can attach it here. I will send it to support.
answered by juice_johnson (9.8k points)
0 votes
Thanks.
answered by royo (2k points)
0 votes
Hi TypeMock Team,

how is it going with testing?

Thanks
answered by dean2008 (960 points)
0 votes
Hi,

No news yet, unfortunately. This is one tough cookie :cry:
But we'll get there. We'll get you updated as soon as we got a fix.
answered by gilz (14.5k points)
0 votes
Have you at least been able to reproduce the error with the sample that I sent?
answered by juice_johnson (9.8k points)
0 votes
Hi,

During the trials to reproduce the problem, we came across a similar exception to the one you reported. It seems related , but we're still investigating to make sure it originates from the same issue.

So we're still in progress on this one. Once we have a solution, you'll get it.
answered by gilz (14.5k points)
0 votes
thanks, are you able to reproduce it?
answered by dean2008 (960 points)
0 votes
Hi,

Please refer to my former post - we're working on reproducing it.
answered by gilz (14.5k points)
0 votes
hi typemock team,

is the fix to this in the new beta?

thanks
answered by dean2008 (960 points)
0 votes
Hi Dean
Sorry but not yet :cry:
answered by ohad (35.4k points)
...