0

我有一些 C++ 库(.dll)文件,必须在 WCF 网络服务中使用。通常 WCF 只能理解位于C:\Program Files (x86)\Common Files\microsoft shared\DevServer\11.0. 我通过代码成功运行并调用了dll。但是在 IIS 中托管后,IIS 无法找到 dll 文件,无法加载程序集。将 dll 文件放入 IIS 的确切位置是什么?

4

2 回答 2

0

不要从本地驱动器的物理路径中引用 dll。如果你这样做了,那么 dll 将在你的本地,只有服务将被移动到服务器。因此,在您的应用程序中放置一个文件夹并将 dll 放置在该文件夹中并引用它们。因此,在移动服务解决方案时,dll 也将随解决方案一起移动。

If the dlls are owned by any other tools or applications then you need to install them in that server where you are planning to host the service. If you need only the dlls and they can  work independently then you may copy the dlls as said above.
于 2013-04-29T06:03:10.167 回答
-1

该服务正在尝试从 GAC 访问 dll。请将 dll 添加到 GAC。然后使用所需的 dll 更新配置文件,如下所示

    <compilation debug="true">
       <assemblies>
         <add assembly="MyWcfAssembly, Version=1.0.0.0, Culture=neutral,     PublicKeyToken=AAAAAAAAAA"/>
       </assembly>
     </compilation>
于 2013-04-29T06:40:49.513 回答