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 noticed what whenever i enable TypeMock and need to use the System.Xml.Xsl.XslCompiledTransform class i get an invalidoperationexception informing me that Instances of abstract classes cannot be created. It appears this is occuring deep in the .net system code. I can always fix this problem by unlinking the profiler (NCover) from TypeMock.

I had this problem with v 4.03 and the previous version. I have tried various versions of NCover with the same result. Also worth noting that this happens within Visual Studio and when run via MSBuild.

I'm not 100% that this is a bug, but it is repeatable and seems to be isolated to the compiled transforms only. Any thoughts?? :D

The full stack is as follows:

) Tests.Templates.TemplateEngineTests.TestTemplateEngine_BasicContent : System.InvalidOperationException : Instances of abstract classes cannot be created.
at System.Diagnostics.SymbolStore.SymDocumentWriter..ctor(ISymUnmanagedDocumentWriter* pDocumentWriter)
at System.Diagnostics.SymbolStore.SymWriter.DefineDocument(String url, Guid language, Guid languageVendor, Guid documentType)
at System.Reflection.Emit.ModuleBuilder.DefineDocumentNoLock(String url, Guid language, Guid languageVendor, Guid documentType)
at System.Reflection.Emit.ModuleBuilder.DefineDocument(String url, Guid language, Guid languageVendor, Guid documentType)
at System.Xml.Xsl.IlGen.XmlILModule.AddSourceDocument(String fileName)
at System.Xml.Xsl.IlGen.GenerateHelper.MarkSequencePoint(ISourceLineInfo sourceInfo)
at System.Xml.Xsl.IlGen.GenerateHelper.MethodBegin(MethodInfo methInfo, ISourceLineInfo sourceInfo, Boolean initWriters)
at System.Xml.Xsl.IlGen.XmlILVisitor.Function(QilFunction ndFunc)
at System.Xml.Xsl.IlGen.XmlILVisitor.Visit(QilExpression qil, GenerateHelper helper, MethodInfo methRoot)
at System.Xml.Xsl.XmlILGenerator.Generate(QilExpression query, AssemblyName asmName)
at System.Xml.Xsl.XslCompiledTransform.CompileIlFromQil(XsltSettings settings)
at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
at System.Xml.Xsl.XslCompiledTransform.Load(XmlReader stylesheet)
asked by pdwebb (1.3k points)

1 Answer

0 votes
Wow, i just posted this and when i go back to the forums i see someone else beat me to it with the same issue ( I must be blind or didnt refresh my browser). :oops: As with the other post the problem simply occurs when doing a standard call to load on a XslCompiledTransform on an XSLT which would normally work absolutely fine.
answered by pdwebb (1.3k points)