WCF сервис - не работает

Материал из 1GbWiki.

(Различия между версиями)
Перейти к: навигация, поиск
Версия 12:42, 30 июня 2010 (править)
Dmach (Обсуждение | вклад)
м
← К предыдущему изменению
Версия 12:43, 30 июня 2010 (править) (отменить)
Dmach (Обсуждение | вклад)

К следующему изменению →
Строка 15: Строка 15:
</serviceHostingEnvironment> </serviceHostingEnvironment>
-=== Could not load type ===+=== Could not load type 'System.ServiceModel'===
При работе под ASP.NET версии 4 При работе под ASP.NET версии 4

Версия 12:43, 30 июня 2010

ServiceActivationException

При ошибках вида

[ServiceActivationException: The service '/service.svc' cannot be activated due to an exception during compilation.
The exception message is: This collection already contains an address with scheme http.  There can be at most one 
address per scheme in this collection. Parameter name: item.]

Нужно дописать что-то типа

<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
  <baseAddressPrefixFilters>
    <add prefix="http://dmach.ru/"/>
  </baseAddressPrefixFilters>
</serviceHostingEnvironment>

Could not load type 'System.ServiceModel'

При работе под ASP.NET версии 4

Could not load type 'System.ServiceModel.Activation.HttpHandler' from assembly 'System.ServiceModel, Version=3.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Нужно убрать из web.config следующее:

aspNetCompatibilityEnabled="true"
Личные инструменты