[英]One web application with two dlls. One dll is dependent upon the other. Why do I have to update both DLLs?
I have a web application that has two referenced assemblies in the form of DLLs. 我有一个Web应用程序,该应用程序具有DLL形式的两个引用程序集。 Lets call the DLLs Primary.dll and Secondary.dll. 让我们调用DLL Primary.dll和Secondary.dll。 The Secondary.dll is dependent upon Primary.dll. Secondary.dll依赖于Primary.dll。
I need to add a feature to Primary.dll for use within the web application. 我需要向Primary.dll添加功能以在Web应用程序中使用。 This requires a new version. 这需要一个新版本。 This new feature is not required by Secondary.dll. Secondary.dll不需要此新功能。 There are no breaking changes for Secondary.dll. Secondary.dll没有重大更改。
Now when a bit of code in Secondary.dll is triggered, I get the following error: 现在,当Secondary.dll中的一些代码被触发时,出现以下错误:
"Could not load file or assembly 'Primary.dll' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. " “无法加载文件或程序集'Primary.dll'或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。”
Secondary.dll is looking for the specific version of Primary.dll Secondary.dll正在寻找Primary.dll的特定版本
Is this solved simply by making the SpecificVersion="false" value in the Secondary.dll project file? 是否可以通过在Secondary.dll项目文件中设置SpecificVersion =“ false”值来解决?
If not, I've thought of keeping the older version of Primary.dll in the GAC, this way Secondary.dll would find it there. 如果没有,我曾想过将旧版本的Primary.dll保留在GAC中,这样Secondary.dll就会在其中找到它。 But would like to avoid this if possible. 但是,如果可能,请避免这种情况。
So now I'm stuck with having to rebuild and re-version Secondary.dll, with a reference to the updated Primary.dll, every time I make a change to Primary.dll for use by the web application. 因此,每次我更改要由Web应用程序使用的Primary.dll时,我都不得不重新构建和重新版本Secondary.dll,并引用更新的Primary.dll。
Is there way to make it so I don't have to update Secondary.dll's reference to the new version of Primary.dll? 有没有办法使我不必将Secondary.dll的引用更新为Primary.dll的新版本?
If changes are really not breaking, try this way: 如果更改确实没有中断,请尝试以下方式:
To make the investigation more simple, use simple almost empty ConsoleApplication with reference to Secondary.dll to play instead of web application. 为了使调查更加简单,请使用参考Secondary.dll的几乎空的ConsoleApplication代替Web应用程序来播放。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.