none
Problems with a .NET4 Control GAC Reference failing at runtime but fine during debugging RRS feed

  • Question

  • I believe this question is specific to the CLR how ever I will test this in a Forms Application later.

    I have multiple .Net 4 Targeted WPF Applications that Reference Non Microsoft .NET 4 WPF Controls that I can confirm are in the GAC.

    Everything Debugs Great (Noting that none of the references are copied to the output directory) and Install's well using a Setup Package and manually installing has the same effect even after a reboot.

    The problem is the application will not start even as an administrator as it does not find the Control References in the GAC.

    This also happens if I try to start the application manually in the visual studio output Directory.

    I can also confirm that opening the application in reflector that reflector is able to correctly find the references.

    Finally if I copy the controls (.dll's) to the location of the application everything runs as expected for all the above issues.

     

    My question here is why is my application not able to load the .NET 4 controls from the GAC?

    Also note that everything uses a Strong Name.

    Wednesday, September 1, 2010 3:43 AM

Answers

  •  

    Hi,

     

    May I know what does the error say? If it is an assembly-binding error, you may use fuslogvw.exe to log details information of the failure, you can run fuslogvw.exe from the Visual Studio Command Prompt 2010.


    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.
    • Marked as answer by SpiderMaster Thursday, September 2, 2010 2:24 AM
    Thursday, September 2, 2010 1:23 AM
  • Perfect Eric,

    I followed your information and found that it was indeed the problem as I described it.

    For any body who follows the Documentation for Enabling the Fusion Log. Ignor the fact it says to use !EnableLog because the fusion logger will only work with the DWORD key 'LogFailures' set to 1 (true), You will most likely need to do a search 'fuslogvw.exe' in the Program Files directory to locate the log viewer and click run as administrator to be able to access the files!

     

    To be more clear about the issue the application was referencing a control like the following code.

    <ResourceDictionary Source="/WPFControls.Test32;component/Themes/O2010/Black.xaml" />

    Visual Studio will gladly accept this and run the application in Debug mode handling the reference load from the GAC.

     

    As my fusion log was able to tell me for the installed version,

    WRN: Partial binding information was supplied for an assembly:

    WRN: Assembly Name: WPFControls.Test32, Culture=neutral | Domain ID: 1

    WRN: A partial bind occurs when only part of the assembly display name is provided.

    WRN: This might result in the binder loading an incorrect assembly.

    WRN: It is recommended to provide a fully specified textual identity for the assembly,

    WRN: that consists of the simple name, version, culture, and public key token.

    WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.

     

    To fix the issue all I needed was to supply that information.

    <ResourceDictionary Source="/WPFControls.Test32, Version=0.8.1.0, Culture=neutral, PublicKeyToken=################;component/Themes/O2010/Black.xaml" />
    

     

    • Edited by SpiderMaster Thursday, September 2, 2010 2:45 AM Buggered it up lol
    • Marked as answer by SpiderMaster Thursday, September 2, 2010 2:46 AM
    Thursday, September 2, 2010 2:36 AM

All replies

  •  

    Hi,

     

    May I know what does the error say? If it is an assembly-binding error, you may use fuslogvw.exe to log details information of the failure, you can run fuslogvw.exe from the Visual Studio Command Prompt 2010.


    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.
    • Marked as answer by SpiderMaster Thursday, September 2, 2010 2:24 AM
    Thursday, September 2, 2010 1:23 AM
  • Perfect Eric,

    I followed your information and found that it was indeed the problem as I described it.

    For any body who follows the Documentation for Enabling the Fusion Log. Ignor the fact it says to use !EnableLog because the fusion logger will only work with the DWORD key 'LogFailures' set to 1 (true), You will most likely need to do a search 'fuslogvw.exe' in the Program Files directory to locate the log viewer and click run as administrator to be able to access the files!

     

    To be more clear about the issue the application was referencing a control like the following code.

    <ResourceDictionary Source="/WPFControls.Test32;component/Themes/O2010/Black.xaml" />

    Visual Studio will gladly accept this and run the application in Debug mode handling the reference load from the GAC.

     

    As my fusion log was able to tell me for the installed version,

    WRN: Partial binding information was supplied for an assembly:

    WRN: Assembly Name: WPFControls.Test32, Culture=neutral | Domain ID: 1

    WRN: A partial bind occurs when only part of the assembly display name is provided.

    WRN: This might result in the binder loading an incorrect assembly.

    WRN: It is recommended to provide a fully specified textual identity for the assembly,

    WRN: that consists of the simple name, version, culture, and public key token.

    WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.

     

    To fix the issue all I needed was to supply that information.

    <ResourceDictionary Source="/WPFControls.Test32, Version=0.8.1.0, Culture=neutral, PublicKeyToken=################;component/Themes/O2010/Black.xaml" />
    

     

    • Edited by SpiderMaster Thursday, September 2, 2010 2:45 AM Buggered it up lol
    • Marked as answer by SpiderMaster Thursday, September 2, 2010 2:46 AM
    Thursday, September 2, 2010 2:36 AM