none
Recompile of GAC assembly results in "xxx is not a member of yyy" RRS feed

  • Question

  • I have a couple of cases where recompiling an assembly (.dll) and installing in the GAC (Wndows 2003 server) has resulted in run-time errors about types not being a member of the class.  Here are details of the most recent occurence:

    - Made a minor change to a working .Net 1.1 assembly and re-targeted to .Net 3.5
    - Installed the new version in the GAC
    - Added an assembly binding redirect to the new version in the machine.config
    - Tested an application that worked with the prior version of the assembly

    The application fails with the following compile error:

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: BC30456: 'StellentRenditions' is not a member of 'EBusiness'.

    Source Error:

    Line 94: 									<asp:TemplateColumn Visible="False" HeaderText="dType">
    Line 95: 										<ItemTemplate>
    Line 96: 											<asp:Label ID="lblRendition" Runat="server" text='<%# Rendition(Container.DataItem("dExtension"), Eaton.Fpg.EBusiness.StellentRenditions.Primary, Eaton.Fpg.EBusiness.StellentRenditions.Web)%>' />
    Line 97: 										</ItemTemplate>
    Line 98: 									</asp:TemplateColumn>

    Source File: D:\EcomDev\DistributorResources-Hydraulics\Presentations.aspx    Line: 96


    ------------------------------------

    If I copy the assembly to the local application bin folder, I do not get the error.

    If I open the assembly in ildasm or Reflector, I see that StellentRenditions is a member of the class.

    The first occurence of this was similar except that there were no code changes made (it was just a recompile to target .Net 3.5) and the error returned indicated that a type could not be loaded rather than the error above.  We can work around it by copying the assembly to the local bin folders, but my concern is that we will continue to run into these situations as we make changes to other shared assemblies.

    Any suggestions are greatly appreciated.

    Thursday, February 18, 2010 7:35 PM

All replies

  •  

    Hi,

    I tested your case with following steps:

    1. Build A.dll, version 1.0, targeting .NET 1.1 platform.
    1. Create Windows Console application Test.exe, add reference to A.dll(1.0).
    1. Rebuild A.dll, version 2.0, targeting .NET 3.5.
    1. Put Test.exe and A.dll(2.0) in same folder.
    1. Modify machine.config, adding redirect element:

     

        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

          <dependentAssembly>

            <assemblyIdentity name="A" publicKeyToken="03537efbde8b1cd4"  culture="neutral" />

            <!-- Assembly versions can be redirected in application, publisher policy, or machine configuration files. -->

            <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>

          </dependentAssembly>

        </assemblyBinding>

     

    1. Run Test.exe, Test.exe works well in my environment.

     

    You can use Fuslogvw.exe to view the detail of assembly binding process of your application, however, this issue seems to be ASP.NET related, you may consider posting it at  http://forums.asp.net where asp experts live in.

     

    Please feel free to let us know if you have any concern.


    Sincerely,
    Eric
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, February 22, 2010 2:21 AM
  • Thanks, I will give that a try and also post this under the ASP.Net forum.  I wasn't sure which one to post it under.
    Monday, February 22, 2010 9:58 PM
  • Hi,
    How about the issue status? are above steps hlepful, or there is any more information you got from fuslogvw? please feel free to let us know if you have any concern.
    Sincerely,
    Eric
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Thursday, February 25, 2010 1:33 AM
  • I used fuslogvw to view the bindings when executing our application and it shows everything being loaded except the assembly in question.
    Thursday, February 25, 2010 7:44 PM
  • Hi,
    You may modify setting of fuslogvw.exe to log binding failures only, open fuslogvw.exe, click "Settings" button, and check the check box of "Log bind failures to disk", so that you can see what happened when binding to that assembly.
    Sincerely,
    Eric
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Edited by eryang Monday, March 1, 2010 2:06 AM
    Friday, February 26, 2010 5:14 AM
  • Hi richc2,
    How about the issue status? please feel free to let us know if you have any concern.
    Sincerely,
    Eric
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, March 1, 2010 2:06 AM