我有一些C ++库(.dll)文件,必须在WCF webservice中使用。通常,WCF只能理解位于C:\Program Files (x86)\Common Files\microsoft shared\DevServer\11.0
的dll。我成功运行并通过代码调用dll。但是在IIS中托管之后,IIS无法找到dll文件,它无法加载程序集。将dll文件放在IIS中的确切位置是什么?
答案 0 :(得分: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.
答案 1 :(得分:-1)
该服务正在尝试从GAC访问dll。请将dll添加到GAC。然后使用所需的dll更新配置文件,如下所示
<compilation debug="true">
<assemblies>
<add assembly="MyWcfAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=AAAAAAAAAA"/>
</assembly>
</compilation>