如何在Visual Studio中添加对强命名程序集的引用,但在运行时使用部分名称加载 [英] how to add reference to strong named assembly in visual studio but load with partial name during runtime

查看:51
本文介绍了如何在Visual Studio中添加对强命名程序集的引用,但在运行时使用部分名称加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我继承了一个引用Microsoft.reportviewer.webforms版本8的解决方案

i inherited a solution which references Microsoft.reportviewer.webforms version 8

我找不到官方链接来下载此版本的reportviewer并立即安装到生产环境中.

I cannot find an official link to download this version of reportviewer to install into production environment now.

是否可以在Visual Studio中配置引用属性,以便在运行时将以部分名称而不是强名称加载程序集?

is it possible to configure the reference property in visual studio so that during runtime, the assembly will be loaded with partial name, instead of strong name?

在我的环境中,我可以看到一个"strongname"该属性在以下屏幕截图中标记为黄色,但是该属性已禁用,我无法将该值更改为false.

In my environment, I can see a "strongname" property as marked yellow in the following screenshot, but the property is disabled, I cannot change the value to false.

并且根据http://stackoverflow.com/questions/24022134/how-exactly-does-the-specific-version-property-of-an-assembly-reference-work-I,特定版本"属性用于编译时而不是运行时.

and according to http://stackoverflow.com/questions/24022134/how-exactly-does-the-specific-version-property-of-an-assembly-reference-work-I , the "specific version" property is used in compile time instead of runtime.

推荐答案

报表查看器控件以前是必须下载的独立程序集(我相信v11之前的版本).但是很长一段时间以来,它们都随框架一起提供.因此,除了引用它们之外,您无需执行其他任何操作.

The report viewer controls used to be standalone assemblies that you had to download (pre v11 I believe). But for quite a while now they ship with the framework. Therefore you don't need to do anything other than reference them.

除非有充分的理由,否则请删除引用,然后使用当前版本的查看器(根据您所针对的框架进行定义)将其重新添加回去.其他所有内容都应保持不变.

Unless there is a really good reason, remove the reference and then add it back using the current version of the viewer as defined by the framework you're compiling against. Everything else should remain unchanged.

迈克尔·泰勒
http://www.michaeltaylorp3.net

Michael Taylor
http://www.michaeltaylorp3.net


这篇关于如何在Visual Studio中添加对强命名程序集的引用,但在运行时使用部分名称加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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