Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / Служба + wcf config / 4 сообщений из 4, страница 1 из 1
06.02.2014, 19:27
    #38552427
фиганыч
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Служба + wcf config
wcf-сервис размещён в виндовой службе,
но не в какую не хочет подхватывать свой конфиг - при размещении на iis спокойно подхватывает их из web.config - а перевожу в службу, сцепляю в конфиге службы - всё служба не запускается.

вот конфиг, помогите плиз
Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
<?xml version="1.0"?>


<configuration>

<configSections>
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
        <section name="ServerDataService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
	<section name="DataService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
    </sectionGroup>
  </configSections>
</configSections>


<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>

  <system.serviceModel>


    <services>
      <service
         name="DataService.Service">

	<host>
          <baseAddresses>
            <add baseAddress="http://localhost:9011/DataService/service"/>
          </baseAddresses>
        </host>

        <endpoint address=""
             binding="basicHttpBinding"
              bindingConfiguration="HttpStreaming"
              contract="DataService.IService" />

	<endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />

      </service>
    </services>
    

    <bindings>
      <basicHttpBinding>
        <binding name="HttpStreaming" maxReceivedMessageSize="65536000" closeTimeout="00:05:00" bypassProxyOnLocal="true" openTimeout="00:05:00" receiveTimeout="00:30:00" sendTimeout="00:30:00" transferMode="Buffered" messageEncoding="Text">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="65536000" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
        </binding>
      </basicHttpBinding>
    </bindings>
    
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

  <userSettings>
    <ServerDataService.Properties.Settings>
      <setting name="x" serializeAs="String">
        <value>dssd</value>
      </setting>
    </ServerDataService.Properties.Settings>
  <DataService.Properties.Settings>
   <setting name="ConnectionString" serializeAs="String">
    <value>Data Source=xxxx;Initial Catalog=credit;User ID=xxxx;Password=xxxxx</value>
   </setting>
   <setting name="BaseDirectory" serializeAs="String">
    <value>X:\3DTV\Directory</value>
   </setting>
   <setting name="SessionLife" serializeAs="String">
    <value>20</value>
   </setting>
  </DataService.Properties.Settings>
  </userSettings>

</configuration>
...
Рейтинг: 0 / 0
06.02.2014, 20:05
    #38552474
Lelouch
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Служба + wcf config
фиганыч,

http://msdn.microsoft.com/en-us/library/ms733932(v=vs.110).aspx

System.Configuration: Web.config and App.config

WCF uses the System.Configuration configuration system of the .NET Framework.

When configuring a service in Visual Studio, use either a Web.config file or an App.config file to specify the settings. The choice of the configuration file name is determined by the hosting environment you choose for the service. If you are using IIS to host your service, use a Web.config file. If you are using any other hosting environment, use an App.config file.
...
Рейтинг: 0 / 0
06.02.2014, 20:05
    #38552475
фиганыч
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Служба + wcf config
фиганыч,

всем спасибо, решил - перенёс в отдельный sectionGroup - заработало
...
Рейтинг: 0 / 0
15.10.2014, 07:58
    #38776852
des1roer
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Служба + wcf config
подскажите а как прибить по onstop процесс и освободить все ресурсы правильно?
...
Рейтинг: 0 / 0
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / Служба + wcf config / 4 сообщений из 4, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]