I have one. Dll is compiled for 64 bit, which contains a class that I can serial into XML. Library is compiled in Visual Studio using the "AnyCPU" flag.
I have another process that refers to .dll, after creating that type of object, it tries to serialize XML like this:
XML serializer serializer = new XML serializer (typef (colophon)); (Using TextWriter w = new StreamWriter (m_colladaPath, false, System.Text.Encoding.UTF8)) {serializer.Serialize (w, collada.COLLADA); // exception is here)
This process works well on 32 bit machines. When trying on a 64 bit machine, the code compiles without error, but at runtime, I receive a "target attack" error:
The system. Reflection.TargetInvocationException occurred message = "Exception has been removed from the goal of a greeting." Source = "mscorlib"
StackTrace: On System. RuntimeMethodHandle._InvokeMethodFast (Object Target, Object [] Logic, SignatureStrank & Sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) on the system. RuntimeMethodHandle.InvokeMethodFast (Object Target, Object [] Logic, Signature Sign, Methods, Attributes, Runtime Typing Handle Type Owner) Interpretation: System.badimageformat expression message = "file or assembly could not be loaded 'goBIM_API, version = 1.0.3922.23514, Culture = Neutral, Public Key Token = Zero 'or one of its dependencies. An attempt was made to load the wrong format program. " Roth = "xnzfsdbo" filename = "goBIM_API, version = 1.0.3922.23514, culture = neutral, public kits = zero" fusion log = stacktrace: on Microsoft.Xml. Serialization. Generated assembly. XML Authorization Worter Colada Right 653_COLLADA (Object O) Innerxy Epson:
I have checked that everything is now compiled for AnyCPU, and successfully without compiling "x64" to everyone, including the library Have tried. I am not using any specific specific indicators, i.e. "IntPtr" in the library
Update: I have created a stand alone application using this library, created a test object and it was sorted without error (X 64 in all). The problem remains with the fact that the method called by another application is being done in the process of serialization. That is, the method is part of the plug-in interface for another application. The application is messing with some serialization about APIs. Autodesk Revit is not sure whether anyone has a revisit guru here?
It seems that goBIM_API or its reference is 32 bits if you have any XML marked X 64 will not load in the assembly.
Comments
Post a Comment