C#asp.net支持一个DLL的多个版本 [英] C# asp.net Supporting multiple versions of a dll

查看:223
本文介绍了C#asp.net支持一个DLL的多个版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下DLL地狱:


  • 一个ASP.Net项目

    • 引用WebGrease

      • 它引用Antlr3.Runtime.dll 3.3.1.7705 [保存在asp.net应用程序/斌/文件夹]


      • 它引用NCalc。codeplex.com

        • 它引用Antlr3.Runtime.dll 3.1.3.22795 [保存在asp.net应用程序/斌/ CustomProject /文件夹]

        勿庸置疑这两个版本的Antlr都没有合作得很好,我获得位于集清单定义不匹配的程序集引用错误

        unsurprisingly these two version of Antlr are not working well together and I get "The located assembly's manifest definition does not match the assembly reference" errors

        我不愿意修改WebGrease项目。

        I am unwilling to modify the WebGrease project.

        我试图升级NCalc项目中使用3.3.1.7705但是我与<苦苦挣扎href=\"http://stackoverflow.com/questions/17364701/c-sharp-antlr-build-against-a-specifc-version-of-antlr3-runtime-dll\">this

        I am attempting to upgrade the NCalc project to use 3.3.1.7705 however I am struggling with this

        你有没有关于如何获得这两个DLL的一起工作有什么建议?

        Do you have any suggestions on how to get these two DLL's to work together?

        修改不幸的是,NCalc code是不是用ANTLR较新的版本不兼容,所以我不能用绑定重定向

        EDIT unfortunately the NCalc code is not compatible with the newer version of antlr so I cannot used binding redirects

        感谢您

        推荐答案

        提供了NCalc可以使用Antlr3.Runtime的新版本 - 即没有重大更改,你应该能够使用绑定重定向指示它加载更高版本

        Providing NCalc can use the later version of Antlr3.Runtime - ie there are no breaking changes you should be able to use a binding redirect to direct it to load the later version

        例如,在web.config文件的屁股像

        eg in the web.config file ass something like

        <runtime>
            <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
              <dependentAssembly>
                <assemblyIdentity name="NCalc" publicKeyToken="xxxxxxxxx" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.1.3.0" newVersion="3.3.1.0" />
              </dependentAssembly> 
        
            </assemblyBinding>
          </runtime>
        

        我不认为在版本的第4位是用来

        I don't think the 4th digit on the versions is used

        这篇关于C#asp.net支持一个DLL的多个版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆