C# click once application with report and reference to assembly

R

reifen-straub

Hi, we have a C# click once application with a report.
This report has a reference to an assembly to calculate some things.

If we run this application locally with the 'click once' checkbox
unchecked, everything works.
But if we publish the application and for this automatically click once
gets checked, we get the following error message within the report:

Error during the local report processing. The definition of the report
"main report ' is invalid. Unexpected error during the report
processing. Error during the requirement of the type of authorization
System.Security.Permissions.FileIOPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.

We don`t have any further ideas how to fix this problem.
Does anybody know a solution for this?
 
A

Andy

are you sure the report is included in the clickonce manifest? Check
out the .application and .deployment files to make sure.

A better idea might be to embed the report as a resource into your
application.

Andy
 
R

reifen-straub

Andy said:
are you sure the report is included in the clickonce manifest? Check
out the .application and .deployment files to make sure.

A better idea might be to embed the report as a resource into your
application.

Andy

Hi Andy,

I have a [REPORT_NAME].deploy file on the server and it`s also
downloaded to the folder, click-once created onto the client.
I also can change the characteristic of the report from content to
embeded resource and it makes no difference. If I activate click-once,
I cannot access the report and if it`s not activated, it works.

I think the error occurs because I have this reference to my assembly
in the report. Without this everything works.
Also if I start the application from the [APPLICATION.EXE] which was
downloaded into the folder, click-once created onto the server, I can
access the report in the application. But in this why I work only
locally and the application doesn`t check for any updates.

Here a part of the code I use for the assembly and for the report:

reportViewer1.LocalReport.ExecuteReportInCurrentAppDomain(AppDomain.CurrentDomain.Evidence);


this.reportViewer1.ProcessingMode = ProcessingMode.Local;
this.reportViewer1.LocalReport.AddTrustedCodeModuleInCurrentAppDomain("[NAME_OF_THE_DLL],
Version=1.0.0.0, Culture=neutral, PublicKeyToken=[TOKEN_OF_THE_DLL]");
this.reportViewer1.LocalReport.ReportPath =
"berichte\\monatsbericht.rdlc";
this.reportViewer1.RefreshReport();

and this i have added to the DLL:

[assembly: System.Security.AllowPartiallyTrustedCallers]

Any ideas?

Thanks for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top