WCF сервис - не работает
Материал из 1GbWiki.
(Различия между версиями)
Версия 22:39, 26 декабря 2009 (править) Dmach (Обсуждение | вклад) ← К предыдущему изменению |
Текущая версия (23:18, 4 декабря 2010) (править) (отменить) Dmach (Обсуждение | вклад) м |
||
(3 промежуточные версии не показаны) | |||
Строка 1: | Строка 1: | ||
- | + | === 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"> | <serviceHostingEnvironment aspNetCompatibilityEnabled="true"> | ||
Строка 7: | Строка 15: | ||
</serviceHostingEnvironment> | </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" | ||
+ | |||
[[Категория:WEB-сервер IIS]] | [[Категория:WEB-сервер IIS]] | ||
[[Категория:Программирование]] | [[Категория:Программирование]] | ||
[[Категория:ASP.NET]] | [[Категория:ASP.NET]] | ||
+ | [[Категория:web.config]] |
Текущая версия
[править] 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"