简体   繁体   English

请参阅没有特定版本号的 .net 参考

[英]Refer .net reference without specific version number

I am referring a 3rd party dll as refrence in my windows project.我在我的 Windows 项目中将第 3 方 dll 称为引用。 Whenever third party releases the dll I used to refer the latest one in code.. Post that I build and deploy the code.每当第三方发布 dll 时,我都会在代码中引用最新的 dll。发布我构建和部署代码的信息。

Can't I somehow refer the dll without version and simply deploy the dll in production without building ?我不能以某种方式引用没有版本的 dll 并简单地将 dll 部署到生产中而不构建吗?

Needless to say this would be tested first with just replacing the dll in non-prod.不用说,这将首先通过替换非生产中的 dll 进行测试。

Suggest if any mechanism exists.建议是否存在任何机制。

Can't I somehow refer the dll without version and simply deploy the dll in production without building ?我不能以某种方式引用没有版本的 dll 并简单地将 dll 部署到生产中而不构建吗?

You should be able to do this by adding a <dependentAssembly> element to your App.config .您应该能够通过向App.config添加一个<dependentAssembly>元素来做到这一点。 Please refer to the documenation for more information and details.有关更多信息和详细信息,请参阅文档

From MSDN:来自 MSDN:

You can manually edit the app configuration file to resolve assembly issues.您可以手动编辑应用程序配置文件以解决程序集问题。 For example, if a vendor might release a newer version of an assembly that your app uses without supplying a publisher policy, because they do not guarantee backward compatibility, you can direct your app to use the newer version of the assembly by putting assembly binding information in your app's configuration file as follows例如,如果供应商可能会在不提供发布者策略的情况下发布您的应用程序使用的程序集的较新版本,因为它们不保证向后兼容性,您可以通过放置程序集绑定信息来指示您的应用程序使用较新版本的程序集在您的应用程序的配置文件中,如下所示

<dependentAssembly>
    <assemblyIdentity name="someAssembly"  
    publicKeyToken="32ab4ba45e0a69a1"  
    culture="en-us" />
    <bindingRedirect oldVersion="7.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>  

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM