none
Publisher policy did not work for the referenced assembly? RRS feed

  • Question

  • I have two assembly Dll1 and Dll2, both are registered in GAC. DLL2 has reference of DLL1 and there is a publisher policy attached with DLL1, Why it is not redirecting the DLL1 as per publisher policy if I am using some function of DLL1 through DLL2? While if I use DLL1 directly in my application it redirects properly.

    • Moved by Ego Jiang Monday, March 25, 2013 7:10 AM
    Friday, March 22, 2013 10:20 AM

Answers

All replies

  • Hi,

    It seems an issue related to CLR, I am moving this thread to CLR forum for further support.

    Best regards,


    Ego [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 25, 2013 7:10 AM
  • HI Hitesh,

    Welcome to the MSDN Forum.

    Based on my known, the publisher policy just redirect the same assembly from one to another.

    It doesn't redirect one assembly to another unrelated one.

    Here is a related document: http://msdn.microsoft.com/en-us/library/dz32563a.aspx

    If I have misunderstood anything, please feel free to follow up.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 25, 2013 12:01 PM
    Moderator
  • I am not trying to redirect one assembly to another unrelated one, what I am trying to achieve is whenever an assembly say DLL1 is called it should redirect to the latest version, which is not happening if my DLL1 is used in another assembly (say ParentDLL) as a GAC reference, and Client is calling some function of ParentDLL which in turn calling DLL1's function.

    and as a result Client always get older version of DLL1, while there exists a publisher policy for DLL1 in GAC.

    Now if Client directly use DLL1, instead of going through ParentDLL the publisher policy works fine.

    I hope you understand the issue.

    Tuesday, March 26, 2013 7:03 AM
  • Hi Hitesh,

    >>as a result Client always get older version of DLL1, while there exists a publisher policy for DLL1 in GAC.

    Ok, I think this should be the problem, you need to put the config file into your application config file, rather than DLL1. So when your application try to load the dll1, it will get the configuration and will turn to dll2(the latest version).

    I hope this will be clear.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, March 26, 2013 9:47 AM
    Moderator
  • Mike,<o:p></o:p>

    I really appreciate
    your prompt response but, but putting the putting it in to Application's config
    file force me to recompile my application, which my client surely will not
    accept.<o:p></o:p>

    My Goal is
    to pick the latest version of DLL1, without recompiling the other assembly/Application
    using it.<o:p></o:p>

    In my case
    ParentDLL is using DLL1, and for this DLL1 I deployed publisher policy in GAC,
    but publisher policy is failing because this DLL1 is not used directly in
    Client application, while ParentDLL is used in application.<o:p></o:p>

    Thanks
    & Regards,<o:p></o:p>

    Hitesh<o:p></o:p>


    Tuesday, March 26, 2013 1:23 PM
  • Hi Hitesh,

    >>but putting the putting it in to Application's config
    file force me to recompile my application, which my client surely will not
    accept.<o:p></o:p>

    No, I don't think you need to recompile the application. You can just added the config to the application config file. Or you can replace it with your new config file.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, March 27, 2013 12:26 PM
    Moderator