none
BindingFailure was detected RRS feed

  • Question

  • Hello,

    I have a WinForms app that uses LocalReport to process reports and create .pdf files. All was well until I let VS2010 convert them to v10... Now, when I try to execute:

    LocalReport report = new LocalReport();
    ...
    ReportParameterInfoCollection rpInfo = report.GetParameters();

    The strange thing is that if I strip out just the reporting parts of this project into a simple test app created from scratch in VS2010 then I have no problems. So, I think there's something that the VS2010 project upgrader missed but I can't figure it out. Everything appears to be the same... I get the following exception:

    BindingFailure was detected
    Message: The assembly with display name 'expression_host_4087850d464f4291b25944875ae980be' 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_4087850d464f4291b25944875ae980be, Version=11.2.30319.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

    Unfortunately, this was not detected until it was already released...so I'm under the gun for a fast solution. I've updated the Reporting references to v10 (why didn't the VS2010 upgrade do this for me????) and after reading that the security model changed, I added the following lines prior to calling GetParameters() without any luck:

    PermissionSet permissions = new PermissionSet(PermissionState.Unrestricted);
    permissions.AddPermission(new FileIOPermission(PermissionState.Unrestricted));
    permissions.AddPermission(new SecurityPermission(SecurityPermissionFlag.AllFlags));
    report.SetBasePermissionsForSandboxAppDomain(permissions);

    Any ideas?

    Thanks!

    Ian

    Wednesday, May 19, 2010 9:01 PM

Answers

  • Hi Ian,

    I recommend that you first check your application to see if there is any dependent assembly with the version "Version=11.2.30319.1". The publickKeyToken is null which indicates that this is not a strong named assembly and should not appear in GAC.

    If you could not identify which assembly is, I recommend that you run Process Monitor to check which assembly file is accessed with the not found error. You can download the tool from this link http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx.

    Probably this assembly is not compatible with your converted assemblies. Once you identify it, check if you can rebuild the assembly with VS2010 and add the reference in your project. 

     

     

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Wednesday, May 26, 2010 1:06 PM
    Moderator

All replies

  • Hi Ian,

    I recommend that you first check your application to see if there is any dependent assembly with the version "Version=11.2.30319.1". The publickKeyToken is null which indicates that this is not a strong named assembly and should not appear in GAC.

    If you could not identify which assembly is, I recommend that you run Process Monitor to check which assembly file is accessed with the not found error. You can download the tool from this link http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx.

    Probably this assembly is not compatible with your converted assemblies. Once you identify it, check if you can rebuild the assembly with VS2010 and add the reference in your project. 

     

     

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Wednesday, May 26, 2010 1:06 PM
    Moderator
  • Go to Visual Studio - > Debug - > Exceptions and uncheck all the checkboxes under "Thrown" column.

    Let me know if that works for you.

    Wednesday, August 20, 2014 10:01 AM