Upgrade a reference dll in a C# project without recompiling the project

前端 未结 1 1061
星月不相逢
星月不相逢 2020-12-08 11:22

I need to take a built version of an C# application and change one of the reference dll\'s. What is the best way to do this, I have specific version turned off on the refer

1条回答
  •  情话喂你
    2020-12-08 12:10

    Yes, you can do this - see the MSDN article Redirecting Assembly Versions.

    You should read the whole document, but it essentially involves either the assembly's publisher creating a 'publisher policy file' or the consumer adding a bindingRedirect to an app.config file, like this (copied directly from the article):

    
       
          
           
             
             
           
          
       
    
    

    A few notes:

    • If you haven't explicitly specified your culture (as many don't), it will be "neutral" rather than "en-us".

    • If you don't already know it, you can get the assembly's public key token using the strong name utility, like this: sn -t [AssemblyPath]

    0 讨论(0)
提交回复
热议问题