Hello,
I am doing some evaluation about moving our current reportsystem to a newer state using the newest "Crystal Report for Visual Studio" with the newest servicepack 5 and Visual Studio 2013.
I managed to create and load new reports to the CrystalReportViewer in C# quite easily and I is it also possible to load our existing reports, which were created with Crystal Report XI.
They use ODBC Text Drivers.
This all works perfectly fine in a stand alone application which uses .Net 4.5.2.
As the next step I tried to add this simple client as a dll library to our existing program, which is written in c++.
When debugging it works just fine and as expected, but when I then start the main program normaly and try to show a report Crystal Report crashes with the following message when CrystamReportViewer.ReportDocument is set.:
As you see the message does not help that much here.
Since it is working as a stand alone application and it gives the same error in all reports I suppose it is not a problem of the reports.
Have someone experienced something like this before?
The Crystal Report Assemblies use .Net Framework 2.0.
I have read that it is needed for standalone programs to add a app.config file with
<?xmlversion="1.0"encoding="utf-8"?>
<configuration>
<startupuseLegacyV2RuntimeActivationPolicy="true">
<supportedRuntimeversion="v4.0"sku=".NETFramework,Version=v4.5.2"/>
</startup>
</configuration>
But this is not possible for library dlls.
As far as I know this needs to be set in the main program, which is the exe written in C++.
So the problem is to use the Crystal Report runtime in a .Net 4.5.2 library dll which is called from an exe written in C++.
Do someone maybe have an idea what to do here and how this can be fixed.
Help is pretty much appreciated and thanks in advance.