|
Не удаётся вовремя подгрузить нужный config-файл, содержащий настройки службы и | или клие
|
|||
---|---|---|---|
#18+
Доброго времени суток. Копирую текст, размещённый мною на зарубежном форуме (надеюсь, что проблем с пониманием текста не возникнет): I wrote WCF service and its WCF client. Both are compiled in DLL-format. For each of them I wrote config-file, because I don't want to edit of the host application config-file (my DLL files will be located in the ./extensions/<extensionName>/ sudbirectory of host application). If I use WcfSvcHost.exe for my service hosting, then I can require to use my config-file through the /config:MyService.dll.config parameter. Since WCF 4.5 it is possible to define the static Configure method in the service class: Код: c# 1.
I tried to do it: Код: c# 1. 2. 3. 4. 5. 6. 7.
But I get an exception when I initialize my proxy through endpoint name: ExceptionIt wasn't succeeded to find an element of an ending point with the name "http" and the contract "RedBee.DwgSaveAs.IDrawing" in the section of a configuration of the client of ServiceModel. It can be caused by the fact that for application the file of a configuration isn't found or the element of an ending point corresponding to this name isn't found in an element of the client. It is occurs before Configure launched. Is exist the simple native way for loading of the config settings from my additional config-file for my service and client? I want to do it in the code of Configure method. С уважением, Андрей ... |
|||
:
Нравится:
Не нравится:
|
|||
28.04.2016, 13:17 |
|
Не удаётся вовремя подгрузить нужный config-файл, содержащий настройки службы и | или клие
|
|||
---|---|---|---|
#18+
Разобрался. Моя ошибка была в том, что я поначалу решил, что метод Configure можно реализовывать как на стороне сервиса, так и на стороне клиента. Можно только на стороне сервиса. Кроме того, как оказалось, в импортируемом config-файле игнорируются базовые адреса. Именно это было причиной того, почему у меня настройки корректно не импортировались... Как следствие - либо эти адреса должны быть прописаны в config-файле хостового приложения, либо в импортируемом файле следует указывать полные адреса в конечных точках (в т.ч. и для метаданных). Это ложка дёгтя, но не смертельно... P.S. ответ на свой вопрос нашёл здесь . ... |
|||
:
Нравится:
Не нравится:
|
|||
28.04.2016, 15:01 |
|
|
start [/forum/topic.php?fid=19&fpage=4&tid=1396772]: |
0ms |
get settings: |
11ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
31ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
43ms |
get tp. blocked users: |
2ms |
others: | 294ms |
total: | 418ms |
0 / 0 |