none
Passing in-memory assembly RRS feed

  • Question

  • I'm using MS WinForms ReportViewer control in local mode.
    My application creates in-memory assembly EntityExtension dynamically.

     

    Report definition refers codemodule Business which references to this assembly:

     

    <CodeModule>EntityExtension</CodeModule>
    <CodeModule>Business</CodeModule>

     

    For running ReportViewer I use:

     

    reportViewer1.LocalReport.ExecuteReportInCurrentAppDomain(
                       System.Reflection.Assembly.GetExecutingAssembly().Evidence);

    reportViewer1.LocalReport.AddTrustedCodeModuleInCurrentAppDomain("EntityExtension");
    reportViewer1.LocalReport.AddTrustedCodeModuleInCurrentAppDomain("Business");

     

    Trying to preview report causes error

     

    An error occured during local report processing
    [BC30007] Reference required to assembly EntityExtension

     

    How to fix ?

    How to force ReportViewer to find EntityExtension assemnly ?

     

    Andrus.

    Wednesday, April 2, 2008 3:20 PM

Answers

  •  

    I tried VS2008 reportviewer redistributable loaded from msdn blog link.

     

    I tried fyireporting.com  reportviewer. It finds in-memory assemblies without issues. So I think I will switch into it.

    Monday, April 7, 2008 10:07 AM

All replies


  • I'm having issues loading my assembly as well, though my assembly is not generated on the fly (the compiler, however, cannot seem to load the dll from the filesystem.)

    Though I'm having issues getting it to work, this MS blog may be helpful.

    Adding custom code to Local Reports in Visual Studio.NET 2005 (Problems & Solutions)

    Wednesday, April 2, 2008 5:10 PM
  • Thank you.

     

    I read this blog and related links. 

    However they do'nt describe this error message and do'nt describe in-memory reading possibility.

    Maybe ReportViewer assumes that assembly is always in disk and is not capable to work with dynamic assemblies.

    Wednesday, April 2, 2008 7:42 PM

  • Though it would be great if it turns out that you can work with in-memory assemblies, I don't beleive it is possible.

     As I have continued to research my problem (with a compiled dll residing on the disk) I am left with the impression that the report viewer is limited to the GAC when accessing assemblies (though in debug mode you can also place the assembly in C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies )
    Wednesday, April 2, 2008 8:20 PM
  • I use my own assemblies located in application directory with reportviewer without any issues. I beleive gotreportviewer.com and other sites contain samples about this.

    So I have no idea why you have such impression.

     

    I think we need to catch reportviewer assemblyresolve event and return reference to in-memory assembly to reportviewer here.

    Unfortunately application regular Appdomain AssemblyResolve event does not fire for ReportViewer.

     

    Any idea how this can be done ?

    Thursday, April 3, 2008 7:39 AM
  • To answer your question of where I got that impression: Completely out of my arse.

    Its totally anecdotal based on my own poking around and a number of posts I've seen (here, at ASP.net, and in the comments section of the link I original posted in this thread) where post ReportViewer SP1 assemblies that once loaded without problem were suddenly not found unless added to the GAC or placed in the vs PublicAssemblies.

    If you are using ReportViewer 2005 SP1 version or later and have no problems loading the assembly, I need to be the one asking you for help because that has been a real pain!

    Good luck to you.
    - Jordan

    PS: I did a quick check to see if I could find a solution for you and ran into your posts regarding this issue on a few different boards. Google works! : >)
    If you do ever get an answer, please post a link or copy/paste to this thread.  I am very curious as to what the solution might be.
    Friday, April 4, 2008 8:16 PM
  •  

    I tried VS2008 reportviewer redistributable loaded from msdn blog link.

     

    I tried fyireporting.com  reportviewer. It finds in-memory assemblies without issues. So I think I will switch into it.

    Monday, April 7, 2008 10:07 AM