Avatar of lybreeze
lybreeze

asked on 

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
Visual Basic.NETCrystal ReportsASP.NET

Avatar of undefined
Last Comment
lybreeze
Avatar of Mike McCracken
Mike McCracken

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
Avatar of lybreeze
lybreeze

ASKER

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


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
Avatar of lybreeze
lybreeze

ASKER

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


SOLUTION
Avatar of Mike McCracken
Mike McCracken

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of lybreeze
lybreeze

ASKER

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?
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

You need to have access to the server?
Avatar of lybreeze
lybreeze

ASKER

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
Avatar of lybreeze
lybreeze

ASKER

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.
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo