I have several modules that each have several of their own Crystal
reports. When I compile these modules as Windows Applications the
reports work fine. When I compile the modules as Class Libraries and
call them from another Windows Application I get this exception:
An unhandled exception of type
'System.Runtime.InteropServices.MarshalDirectiveEx ception' occurred in
crystaldecisions.crystalreports.engine.dll
Additional information: Marshaler restriction: Excessively long string.
I can change the output types of these modules back to Windows
Applications, recompile them, and then the reports will work fine
again.
When the exception is thrown, Visual Studio highlights the last line of
the constructor of the report in the .cs file. Example (the line that
is just the closing bracket gets highlighted):
public ProblemReport() {
} // <-- this line highlighted
Why are the reports getting marshaled when they are in a class library?
Is there any way to prevent this? Is something else the root of this
problem?
I did a test with a simple report in a class library and was able to
instantiate it from another assembly, so that in itself is not the
problem.
Anyone have any ideas?
I'm using Visual Stuidio.NET 2003, C#, and .NET Framework 1.1.
-Kurt