none
Problem with ReportViewer with target .NET Framework 4 Client Profile RRS feed

  • Question

  • Hello,

    I have a problem with my application when I choose the target .NET framework 4 Client profilez instead of the Framework 3.5. When I put back the target Framework 3.5 all is fine. Only with the 4 Client Profile.

    The form_Load with the Reportviewer control works perfectly (I reach a breakpoint in the end of the event), and after that, the error appears (No debug possible as there is no code of mine there).

    I can call LoadReportDefinition, and add parameters, so it seems the assembly is loaded correctly

    There is no assembly with Version=11.2.30319.1 in my project

    If I target the Framework 4 the same problem applies. With the framework 3.5, all is fine

     

    Can you please help me?

    I have no idea about what I can do.

    In the process explorer, I saw nothing with 11.2.30319.1

    Here is the error message

    The assembly with display name 'expression_host_fd26addc231b47d4bbf4caed423a1180' failed to load in the 'LoadFrom' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'expression_host_fd26addc231b47d4bbf4caed423a1180, Version=11.2.30319.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

     

    Thank you

    Marc

    Tuesday, July 13, 2010 10:05 AM

Answers

  • Hello,

    tenacity ... after some further work i've managed to get the viewer to display my reports. i have turned off the binding failure debug assistant as referred in my previous post. also i added code to stop failure when closing down app. this is a workaround at best and i would like to see more clarification from microsoft.

    obj.LocalReport.ReleaseSandboxAppDomain in dispose() (or formclosing())

    Good luck to you

    Saturday, July 17, 2010 7:55 PM

All replies

  • Hi Marc,

    The error message indicates that your application was trying to load a dynamically generated expression host assembly for your report. However this error looks strange to me. I think that this issue was probably related to the changes to code access security (CAS) in .NET 4.0. Was there any special for your report, such as using a custom assembly, accessing external resources etc? If so, you may have to use the function AddFullTrustModuleInSandboxAppDomain or SetBasePermissionsForSandboxAppdomain in your application:
    LocalReport.SetBasePermissionsForSandboxAppDomain Method (See the C# sample)
    http://msdn.microsoft.com/en-us/library/microsoft.reporting.webforms.localreport.setbasepermissionsforsandboxappdomain(VS.100).aspx
    LocalReport.AddFullTrustModuleInSandboxAppDomain Method
    http://msdn.microsoft.com/en-us/library/microsoft.reporting.webforms.localreport.addfulltrustmoduleinsandboxappdomain(VS.100).aspx

    Brian Hartman had a good blog talking about Expression Evaluation:
    http://blogs.msdn.com/b/brianhartman/archive/2010/02/18/expression-evaluation-in-local-mode.aspx


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Thursday, July 15, 2010 4:29 AM
    Moderator
  • please see an entry posted on saturday with this same error.

    "Help vs2010 ... bindingfailure detected ... expression_host failed to load" . I attempted to implement this fix with no success. I too am unsure about what to do but this error is a show stopper.

     also, my example is a winform app localreport only -- this fix refers to webforms

    Thank you

    Randy

    • Edited by rlulery Thursday, July 15, 2010 8:54 AM clarification
    Thursday, July 15, 2010 8:48 AM
  • Hello,

     

    My sub report only uses parameters (string, boolean..., nothing custom).

    All my datasources are List (of CustomClasses)
    And my custom classes are all simple classes (properties and private variables)

    I use no custom assembly (only microsoft assembly in the project)
    The only formulas that I have are for example if parameter = true in the hidden files (so it doesn't seem to be the problem). I use no class assembly in the report

    My reports are compiled in an external DLL but I load the RDLC text from the DLL (to change some things in it depending on the customer choice and I apply it to the report source.).

     

    @rlulery You are right, It seems to be the same problem. Only the component GUID is different, but the version is the same.
    It is also a winform app and local report that I use

     

    Thank you

    Marc

    Thursday, July 15, 2010 10:00 AM
  • Hello,

    What I've read is that the component is generated dynamically hence we see a different GUID each time, just to make it more interesting. I had not changed the framework from 2.0 initially. when I changed to 3.5 or 4 it breaks adox and other com interops that I am using. I am going to try the 3.5 framework soon if I can, as you seem to have success with that.

    I think this is a bug. Why is it not ever possible to just do the one thing we need to do, instead of 3?

    Randy

     

    Thursday, July 15, 2010 11:05 AM
  • Hello,

     

    The target of my project was NET3.5 when I have added the control in the form. If it doesn't work for you, perhaps it is the problem.

     

    I have made another thing that really makes me think about a bug :

    If I launch manually the exe (from the debug folder from Windows explorer (instead of the Run from NET2010)) , there is no problem, so it really seems to be a problem because of the debugger of NET2010. Of course I don't want to deliver the program with the NET4 and change in NET 3.5 to debug. When I see that, I don't think that we will be able to do something, it seems to be a problem in NET2010.
    Can you please confirm that it isn't only me?


    Marc

     

    Friday, July 16, 2010 6:26 AM
  • i found this searching on bindingfailure and it is only related

    http://blog.unixwiz.net/2009/04/bindingfailure-was-detected-in-vs2008.html

    in essence it says to turn off the debug assistant which works, but the error

    is still occurring for me i just don't get a report, no failure though. in your

    case because you say it works when running outside of the debugger, it

    may work for you. in my case, running from debug folder just starts then

    quits, with no error.

    Friday, July 16, 2010 8:03 PM
  • Hello,

    tenacity ... after some further work i've managed to get the viewer to display my reports. i have turned off the binding failure debug assistant as referred in my previous post. also i added code to stop failure when closing down app. this is a workaround at best and i would like to see more clarification from microsoft.

    obj.LocalReport.ReleaseSandboxAppDomain in dispose() (or formclosing())

    Good luck to you

    Saturday, July 17, 2010 7:55 PM
  • Hello,

     

    You are right it is working.
    From your post before, it seems strange that it was working with NET 3.5 and not 4.0 (as NET 4.0 comes from VS2010) but in every case it is working (and it is the most important ).

    Thank you again for your help.

    You are right, some information from Microsoft would be great (there is no reason for something like that to happen)

    Marc

    • Proposed as answer by UDFOX Friday, January 4, 2013 3:19 AM
    • Unproposed as answer by UDFOX Friday, January 4, 2013 3:19 AM
    Thursday, July 22, 2010 8:23 AM
  • Hello,

    tenacity ... after some further work i've managed to get the viewer to display my reports. i have turned off the binding failure debug assistant as referred in my previous post. also i added code to stop failure when closing down app. this is a workaround at best and i would like to see more clarification from microsoft.

    obj.LocalReport.ReleaseSandboxAppDomain in dispose() (or formclosing())

    Good luck to you


    Thanks bro..its working for me also
    Friday, January 4, 2013 3:20 AM