简体   繁体   English

在.NET项目中部署时,为项目设置特定的参考版本

[英]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。

捕获Microsoft.AnalysisServices的属性

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.

相关问题 同一解决方案中的项目到项目参考特定版本 - Project to Project reference specific Version in same solution 在运行时不是特定于版本的Visual Studio项目参考 - Visual Studio project reference that isn't version specific at runtime 如何在project.json中引用特定版本的NetStandard? - How to reference a specific version of NetStandard in project.json? 从参考 dll 获取版本并为当前项目设置相同 - Get version from reference dll and set the same for current project 我的项目可以引用针对较低版本.net框架的程序集吗? - Can my project reference an assembly targeting a lower version of .net framework? 参考.Net 4.5和netstandard2.0项目的.Net 4.5项目拉错了版本但是可以工作 - .Net 4.5 Project with Reference to .Net 4.5 and netstandard2.0 Project pulls wrong version but works 项目参考属性-版本号 - Project reference properties - Version number 如何在Visual Studio中为项目引用设置“特定版本”属性 - How to set “Specific Version” property for project references in Visual Studio 未将对象引用设置为使用ASP.NET Project的对象的实例 - Object reference not set to an instance of an object working with ASP.NET Project 当NET Framework项目具有对netstandard项目的项目引用时,带有-IncludeReferencedProjects标志的nuget pack不起作用 - nuget pack with -IncludeReferencedProjects flag don't work when NET Framework project has project reference to netstandard project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM