2010-01-15 41 views
1

我已经开发了一个小工具来上传工资信息给瑞士政府,并且我使用了WSE 3.0成功。但现在,我的一个客户报告说,他的机器上,我的程序崩溃与下面的堆栈跟踪:WSE032错误,WebServicesConfiguration无法加载配置。部分

WSE032: There was an error loading the microsoft.web.services3 configuration section. 
    at Microsoft.Web.Services3.Configuration.WebServicesConfiguration.get_Current() 
    at Microsoft.Web.Services3.Configuration.WebServicesConfiguration.get_MessagingConfiguration() 
    at Microsoft.Web.Services3.WebServicesClientProtocol..ctor() 
    ... 

我一直试图弄清楚这是什么意思,但我必须承认,我有点迷失在这里。该方案有一个.exe.config文件具有以下内容:

<?xml version="1.0"?> 
<configuration> 
    <configSections> 
    <section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
    ... 
    </configSections> 
    <startup> 
    <supportedRuntime version="v2.0.50727"/> 
    </startup> 
    <microsoft.web.services3> 
    <security> 
     <x509 allowTestRoot="false" storeLocation="CurrentUser" skiMode="RFC3280"/> 
    </security> 
    </microsoft.web.services3> 
... 
</configuration> 

删除从XML中<security>节点上方排序修复该问题(在WSE032错误消失),但是这不是我的情况的解决方案,如我需要以这种方式配置安全性,以便能够签署稍后传输的数据。

任何想法可能是什么问题。显然,WSE 3.0已经安装在客户机器上,否则,在发生WSE032错误之前,堆栈跟踪不会在调用者中显示它。

回答

3

看起来客户正在从共享上的盘符执行程序;尽管我认为.NET 3.5 SP1允许从LocalIntranet_Zone启动EXE的完全信任特权,但这似乎是加载可执行文件的WSE配置部分的问题。

为了解决这个问题,我跑caspol这可以在这里找到:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\caspol.exe 

的命令行是沿着线的东西:

caspol -m -ag LocalIntranet_Zone -url N:\* FullTrust -n "name" -d "description" 

用于安装在驱动器盘符N:份额;请注意,namedescription纯粹是信息性的。

此命令提供驱动器上的所有可执行文件N:FullTrust权限,就像它们是从本地资源(例如硬盘驱动器)启动一样。

请参阅MSDN上的How to: Grant Permissions on Folders and Assemblies