[英]Set specific reference version for project when deployed in .NET project
TL;DR: How do I set a reference for an assembly to a specific version (earlier than current) TL; DR:如何将程序集的引用设置为特定版本(比当前版本早)
I have a project in which we are deploying to an SSIS server which has the assemblies current up to version 11.XXX, or Visual Studio 2012. On my local machine, I have Visual Studio 2014 installed on my local machine, which gives me version 12.XXX. 我有一个项目,正在其中将其部署到SSIS服务器上,该服务器的程序集的最新版本为11.XXX或Visual Studio2012。在我的本地计算机上,我在我的本地计算机上安装了Visual Studio 2014。 12.XXX。
With this project, once it has been compiled against VS 2014, it updates the version to 12.XXX. 对于此项目,一旦针对VS 2014进行了编译,它将版本更新为12.XXX。 This update causes the SSIS server to fail with an error about an incorrect/missing version.
此更新导致SSIS服务器失败,并显示有关版本不正确/缺失的错误。
How do I get the deployed project to reference the 2012 assemblies during runtime? 如何在运行时获取已部署的项目以引用2012程序集?
I have looked into the Specific Version flag, but it appears to only determine the build time reference used. 我已经查看了“特定版本”标志,但它似乎仅确定所使用的构建时间参考。 Is there another way to tell the project to use the 11.XXX version of the assembly?
有没有其他方法可以告诉项目使用程序集的11.XXX版本?
Here is a screenshot of the properties of the Analysis Services assembly, which is the one throwing the error. 这是Analysis Services程序集的属性的屏幕截图,该属性是引发错误的代码。 As you can see, it is referencing version 12.0.0.0 when I need it to reference 11.XXX.
如您所见,当我需要它引用11.XXX时,它正在引用版本12.0.0.0。
You can Redirect assembly bindings with App.config. 您可以使用App.config 重定向程序集绑定 。 Note that despite being named
newVersion
, this attrbiute can specify an earlier version than oldVersion . 请注意,尽管此属性被命名为
newVersion
,但它仍可以指定比oldVersion早的版本 。
EDIT: Since your project is not standalone things get a bit more complicated. 编辑:由于您的项目不是独立的,所以事情变得更加复杂。 See this post for where to locate SSIS app.config files.
请参阅此文章以找到SSIS app.config文件的位置。 Also you can specify redirects system-wide in machine.config file as stated in the first link.
您还可以按照第一个链接中所述在machine.config文件中指定系统范围的重定向。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.