.NET app.config问题 [英] .NET app.config question

查看:245
本文介绍了.NET app.config问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个使用CLR 2.0的Excel 2003加载项,该加载项将安装在我客户站点上的数百台机器上。问题是安装加载项的某些机器具有并行运行的.NET 1.1和.NET 2.0,并且插件在尝试加载时会引发错误。

I have created an Excel 2003 add-in that uses the CLR 2.0 and this add-in is to be installed in hundreds of machines at my customer's site. The issue is that some of the machines where the add-in is installed have .NET 1.1 and .NET 2.0 running side by side, and the plugin throws an error when it's trying to load.

我所遇到的解决方案是在同一个文件夹中创建一个excel.exe.config文件,其中excel.exe将supportedRuntime版本设置为v2。 0.50727。

The solution I have come across that works is to create an excel.exe.config file in the same folder where excel.exe is that sets the supportedRuntime version to v2.0.50727.

因为这种解决方案在我的情况下不能很好地扩展(因为这个加载项是在数百台机器上使用的,用户甚至可能无法创建一个配置文件),我想知道如果我可以在我的插件app.config文件中添加相同的supportedRuntime参数,它将工作。

Because this solution does not scale well in my case (since the add-in is to be used in hundreds of machines where the users might not even have access to create a config file), I was wondering if I could add the same supportedRuntime parameter in my plugin app.config file and it would work.

如果这样不行,你们会知道别的什么吗?

If this will not work, do you guys know of anything else I could try?

推荐答案

您收到的错误讯息是什么?

What is the error message that you receive?

您所描述的问题不应该出现在Office 2007中。但是,所谓的共享加载项(.NET加载项基于使用COM互操作性的Extensibility.IDTExtensibility2接口)在Office 2003中。

The problem that you describe should not occur with Office 2007. However, it is a known problem for so-called Shared Add-ins (.NET add-ins based on the Extensibility.IDTExtensibility2 interface using COM interoperability) in Office 2003.

Microsoft已发布补丁,应为每个使用该加载项的用户安装该补丁。你可以在这里获得补丁:

Microsoft has a released a patch, which should be installed for every user using the add-in. You can obtain the patch here:


http://support.microsoft.com/kb/908002

使用配置的解决方案文件是一个非标准的解决方案,但也应该解决以下文章所述的问题:

The solution using the config file is a non-standard solution but should also fix the problem as stated in the following article:


http://nielsvanvliet.com/excel.html#Patch

如果要使用MSI安装程序部署加载项,则应检查Microsoft .NET Framework 2.0(KB908002)的共享加载项支持更新作为预必须在安装项目的属性中。请注意,此修复程序只能为当前用户安装,即应禁用ALLUSERS设置。

If want to deploy your add-in using an MSI installer you should check the Shared Add-in Support Update for the Microsoft .NET Framework 2.0 (KB908002) as a pre-requisite in the properties of the setup project. Please note that this fix can only be installed for the current user, i.e. an ALLUSERS setup should be disabled.

更新:VS 2008的安装有点复杂。参见这里:

UPDATE: The installation with VS 2008 is a little more complicated. See here:


可以在GAC之外安装.NET Word 2003加载项吗?

这篇关于.NET app.config问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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