cancel
Showing results for 
Search instead for 
Did you mean: 

.Net class file doesn't work on 64bit Vista machine

Former Member
0 Kudos

Post Author: Cyberdevil67

CA Forum: .NET

I am not sure that I am posting this into the right area or not.

I have 2 machines running Vista Ultimate, one is 64bit the other is 32bit. Both have Crystal Reports 2008 and Visual Studio 2008 installed.

I have created a class to open a report, print, change the connection info etc. To be used in a web application. I also have a Windows test form that runs the class file and displays the loaded report in a viewer.

Both machines have .Net 2.0 and 3.5 installed.

Within Visual Studio 2008 the class file works fine.

On the 32bit machine within the web application it works fine as well, but not on the 64bit machine in the web application.

On the 64bit machine I am getting this which tells me that it is a 64bit issue.

System.InvalidOperationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. at au.com.aegeon.asReportTool.CreateReportDocument(String reportFile) at au.com.aegeon.asReportTool.OpenReport(String reportFile) at au.com.aegeon.asReportTool.Export(String fileName, CrystalExportFormat exportFormat)

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Post Author: Argan

CA Forum: .NET

There are no 64 bit runtimes for CR 2008.

You can try deploying the CR 2008 runtimes and make sure you specify 32 bit in your build instead of Any Cpu.

Answers (4)

Answers (4)

Former Member
0 Kudos

Post Author: Cyberdevil67

CA Forum: .NET

See this is the thing.

Step 1)

Created a project in Visual Studio 2008, with a class that has methods and code to open a report and print export etc.

Step 2) Add another project to test this in Visual Studio with a windows form.

Step 3) Compile this for any CPU and within the application, I can open a report send it to the CrystalViewer, export and print.

Step 4) Still on the same machine, create a web application to open that class assembly. It opens fine, I can see the methods and properties etc.

Step 5) Try to open a report.

Step 6) Scratch head as to why it can't open the report with the error reported in first post.

The thing is that it is on the same machine, Visual Studio has no problems running th class opening a report. The IIS web application, can open the class and call certain methods. But as soon as it comes to opening the report it fails with that exception.

This is driving me insane. And I would seriously like to know, with how long 64bit OS's have been around for why there is no 64bit cr runtimes? I see so many people talking about them when I google but can't find them to download. Even VS 2008 has 64bit runtimes, at least that is what it says it is installing in the setup?

I am seriously at a loss here and really need someone from Business Objects to help here, there has to be a simple explanation to this.

Former Member
0 Kudos

Post Author: Argan

CA Forum: .NET

If you have changed it to x86 only then I dont know what else to tell you.

I have yet to run into an instance where doing that doesnt work on a 64bit machine with our 32bit runtimes installed.

Former Member
0 Kudos

Post Author: Cyberdevil67

CA Forum: .NET

I should have also stated that the compiler is set to any cpu in the first example.

So even though it appears eveything is 32bit, it will work on 32 bit machines. Not on a 64 bit machine unless it is running as a full .Net compiled application.

So if it can work in a VS compiled .Net application why does it fail when I run it in a web application?

Former Member
0 Kudos

Post Author: Cyberdevil67

CA Forum: .NET

Thats what I thought.

I even told VS 2008 to compile it to x86, and I still get the same error when trying to use the Crystal runtimes on a 64bit machine runing in 64bit mode.

Even switching IIS to use 32bit, still doesn't do the trick.

I know it has something to do with a 64bit machine, OS and software.

But for the life of me I can't figure it out. This needs to be deployed onto a 64bit OS, and I am at a loss to get any more ideas as to how to fix this.