Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 669
  • Last Modified:

Crystal Reports called from VB.NET / ASP crashing on remote server

I have developed a small VB.NET / ASP application using Visual Studio 2010, and I have added a simple Crystal Reports .NET Framework 4.0 report to the site.

It runs ok on my local PC when I test it using VS 2010, but when I try and run it on the remote server (Fasthosts) it crashes with :-

[SecurityException: That assembly does not allow partially trusted callers.]
   CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor() +0

I have looked at many forums to try and get an answer, and so far I have created the following program :-

Assemblyinfo.vb     containing :-
<Assembly: AllowPartiallyTrustedCallers()>
<AttributeUsage(AttributeTargets.Assembly)>
Public NotInheritable Class AllowPartiallyTrustedCallersAttribute
    Inherits Attribute
End Class

and I have put these 2 lines at the top of my VB program that calls the report :-
Imports System.Security
<Assembly: AllowPartiallyTrustedCallers()>

This seems quite a complicated area, and I would be very grateful for any help.

Thanks
Geoff
0
lybreeze
Asked:
lybreeze
  • 5
  • 3
  • 2
2 Solutions
 
mlmccCommented:
DId you add Crystal runtimes to the server?

You can get them here
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/22083

mlmcc
0
 
lybreezeAuthor Commented:
Thank you for your reply.
I reckon I've put all the required ones in the bin folder under my main folder, but for completeness here is the list :-

CRVsPackageLib.dll
CrystalDecisions.CrystalReports.Design.dll
CrystalDecisions.CrystalReports.Engine.dll
CrystalDecisions.CrystalReports.TemplateEngine.dll
CrystalDecisions.Data.AdoDotNetInterop.dll
CrystalDecisions.Enterprise.Viewing.ReportSource.dll
CrystalDecisions.ReportAppServer.ClientDoc.dll
CrystalDecisions.ReportAppServer.CommLayer.dll
CrystalDecisions.ReportAppServer.CommonControls.dll
CrystalDecisions.ReportAppServer.CommonObjectModel.dll
CrystalDecisions.ReportAppServer.Controllers.dll
CrystalDecisions.ReportAppServer.CubeDefModel.dll
CrystalDecisions.ReportAppServer.DataDefModel.dll
CrystalDecisions.ReportAppServer.DataSetConversion.dll
CrystalDecisions.ReportAppServer.DataObjectFactory.dll
CrystalDecisions.ReportAppServer.Prompting.dll
CrystalDecisions.ReportAppServer.ReportDefModel.dll
CrystalDecisions.ReportAppServer.XmlSerialize.dll
CrystalDecisions.ReportSource.dll
CrystalDecisions.Shared.dll
CrystalDecisions.VSDesigner.dll
CrystalDecisions.Web.dll
CrystalDecisions.Windows.Forms.dll
log4net.dll
Microsoft.ReportViewer.WebForms.dll
SAPBusinessObjects.WPF.Viewer.dll
SAPBusinessObjects.WPF.ViewerShared.dll

Geoff


0
 
mlmccCommented:
Did you just copy them there or were they installed by an installer?

Some have to be in specific places and other have to be registered.

mlmcc
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
lybreezeAuthor Commented:
I uploaded them using FTP (or rather I copied them using the equivalent FTP program in VS 2010).

As I can't actually register files on a remote web hosting server such as Fasthosts, what would be the best way of running an installer?

VS 2010 makes you select web site or web application when you start designing your code. I chose web site for this program, but I see that under web application there is an option to publish the site using a .zip file.  Is that relevant to this problem?

Thanks
Geoff


0
 
mlmccCommented:
You would have to work with the website to do that.

Most won't do it because you have to be version specific with Crystal.

mlmcc
0
 
CodeCruiserCommented:
I think Crystal wont work if it does not have full access to the temp files on the web server.
0
 
lybreezeAuthor Commented:
Thank you for your reply.

Is that something that is usually configurable by end users, or am I reliant on the administrators of the web hosts?
0
 
CodeCruiserCommented:
You need to have access to the server?
0
 
lybreezeAuthor Commented:
I only have access to those parts of the server which I am permitted to access, i.e. my own public folder.  Crystal Reports operates like a black box, and I don't know / can't control what temp files it is using, how, and where.

I have put in a help request to Fasthosts to see if they can help, and to find out if they support Crystal Reports .NET Framework 4.0

If they don't support it then I will probably have to find another web host who do (a Google search shows that there are quite a few). That would mean ditching 6 months worth of hosting agreement, but it would have to be done.

If you know how I can configure Fasthosts (or similar) to work with the Crystal Report temp files then I would be grateful.

Thanks for your help
Geoff
0
 
lybreezeAuthor Commented:
I contacted Fasthosts, and they said that they do not support Crystal Reports on their web servers, probably because it needs to write temporary files to their server.

I have now switched to a web-hosting firm called ASP Host Central as they support the latest version of CR. I have to pay a bit extra for CR, but they have been very helpful getting everything set-up.  CR worked first time on their server, without my having to upload CR .dll's or to add workaround bits of code to my app.

Thank you for your replies - they made me realise that the problem was with the hosting rather than with my app.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now