WSE032 错误,WebServicesConfiguration 无法加载配置。部分

发布于 2024-08-17 18:41:44 字数 1393 浏览 4 评论 0原文

我开发了一个小工具来向瑞士政府上传工资信息,并成功使用了 WSE 3.0。但现在,我的一位客户报告说,在他的机器上,我的程序崩溃并显示以下堆栈跟踪:

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 中删除 节点可以修复以下问题:问题(WSE032 错误消失),但这对我来说不是解决方案,因为我需要以这种方式配置安全性,以便能够对我稍后传输的数据进行签名。

知道可能是什么问题。显然,WSE 3.0 已安装在客户的计算机上,否则,在 WSE032 错误发生之前,堆栈跟踪不会在调用方中显示它。

I have developed a small tool to upload salary information to the swiss administration and I used WSE 3.0 with success. But now, one of my customers has reported that on his machine, my program crashes with the following stack trace:

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()
  ...

I've tried to figure out what this means, but I must admit that I am a bit lost here. The program has a .exe.config file with the following contents:

<?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>

Removing the <security> node from the XML above sort of fixes the issue (the WSE032 error vanishes) but this is not a solution in my case, as I need to configure the security this way in order to be able to sign the data I am transmitting later on.

Any idea what could be the issue. Obviously, WSE 3.0 has been installed on the customer's machine, since otherwise, the stack trace would not have shown it in the callers before WSE032 error happens.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若言繁花未落 2024-08-24 18:41:44

客户似乎是从安装在共享上的驱动器盘符执行该程序;尽管我认为 .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 上。

It appears that the customer was executing the program from a drive letter mounted on a share; even though I thought that .NET 3.5 SP1 allowed full trust privilege to EXEs launched from the LocalIntranet_Zone, this seems to be an issue with the loading of the WSE configuration section of the executable.

To fix this, I ran caspol which can be found here:

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

The command line is something along the lines of:

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

for a share mounted on drive letter N:; note that name and description are purely informational.

This command gives all executables found on the drive N: the FullTrust privilege, just as if they were started from a local resource (hard disk drive, for instance).

See How to: Grant Permissions on Folders and Assemblies on MSDN.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文