在网站内添加 WCF 服务以进行发布
Adding a WCF service inside a Website for publishing
我在 IIS 上托管了一个网站,用户可以在 Internet 上从外部访问它。现在我也想对我的网络服务使用相同的域名,并允许用户在互联网上访问它,所以我只是在我的网站内添加了该服务的已发布代码文件夹,因此 URl 将如下所示.
WCF 服务:http://mytestsite.com/services/testservice.svc
但是当我尝试使用 testservice.svc 时,我收到一条错误消息
The service '/mytestsite/services/testservice.svc' cannot
be activated due to an exception during compilation. The exception
message is: The type 'AWL.AI.WWIP.SBLPayService', provided as
the Service attribute value in the ServiceHost directive, or provided
in the configuration element
system.serviceModel/serviceHostingEnvironment/serviceActivations could
not be found..
AWL.AI.WWIP 是服务和契约的命名空间。该服务本身是一个单独的解决方案,名称为 AWL.AI.WWIP。现在我试图将该文件夹添加到我的网站中,但它抛出了这个错误。即使我重命名文件夹以匹配命名空间名称,它也不起作用。它抛出同样的错误。非常感谢任何帮助。
感谢所有的意见,我找到了解决方案。正如我在问题中提到的,我在我的网站文件夹中添加了服务文件夹。并将服务文件夹转换为应用程序。在 IIS 中,您有此选项,右键单击该文件夹,您可以选择转换为应用程序。我这样做了,它在我的网站名称下创建了一个节点,然后你就可以访问服务而无需任何更改并使用网站域。
所以我现在可以说,
在浏览器和宾果游戏中!你看到了服务。 web.config 无需更改。
我在 IIS 上托管了一个网站,用户可以在 Internet 上从外部访问它。现在我也想对我的网络服务使用相同的域名,并允许用户在互联网上访问它,所以我只是在我的网站内添加了该服务的已发布代码文件夹,因此 URl 将如下所示.
WCF 服务:http://mytestsite.com/services/testservice.svc
但是当我尝试使用 testservice.svc 时,我收到一条错误消息
The service '/mytestsite/services/testservice.svc' cannot be activated due to an exception during compilation. The exception message is: The type 'AWL.AI.WWIP.SBLPayService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found..
AWL.AI.WWIP 是服务和契约的命名空间。该服务本身是一个单独的解决方案,名称为 AWL.AI.WWIP。现在我试图将该文件夹添加到我的网站中,但它抛出了这个错误。即使我重命名文件夹以匹配命名空间名称,它也不起作用。它抛出同样的错误。非常感谢任何帮助。
感谢所有的意见,我找到了解决方案。正如我在问题中提到的,我在我的网站文件夹中添加了服务文件夹。并将服务文件夹转换为应用程序。在 IIS 中,您有此选项,右键单击该文件夹,您可以选择转换为应用程序。我这样做了,它在我的网站名称下创建了一个节点,然后你就可以访问服务而无需任何更改并使用网站域。 所以我现在可以说,
在浏览器和宾果游戏中!你看到了服务。 web.config 无需更改。