Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / October 2007

Tip: Looking for answers? Try searching our database.

Splitting WCF ServiceHost configurations into separate files?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jonesst2608@googlemail.com - 17 Oct 2007 14:34 GMT
Hi,

I have several ServiceHost instances each implemented in its own DLL.
The services are being self-hosted by a forms application.

I'd like to split the ServiceHost configuration parameters that are
all currently held in App.config into separate files so allowing the
service configurations to be managed more easily.

The only way I can see to do this is to subclass ServiceHost and
implement my own XML based configuration sub-system but this seems
insane.

Does anyone know an easy way to do this?

Thanks, Steve.
sloan - 17 Oct 2007 15:08 GMT
You talking about something like this??

<?xml version = "1.0" encoding = "utf-8" ?>
<configuration>

<configSections>
 <section name="dataConfiguration"
type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings,
Microsoft.Practices.EnterpriseLibrary.Data"/>
</configSections>

<appSettings file="CustomAppSettings.config" >
</appSettings>

<connectionStrings configSource="ExternalConnectionStrings.config" />

<dataConfiguration defaultDatabase="MainDatabaseConnectionString"/>

<system.serviceModel>

 <behaviors configSource="WCFBehaviors.config">
 </behaviors>

 <bindings configSource="WCFBindings.config">
 </bindings>

 <client configSource="WCFClient.config" >
 </client>

 <services configSource="WCFServices.config" >
 </services>

</system.serviceModel>

<system.diagnostics configSource="SystemDiagnostics.config">
</system.diagnostics>

</configuration>

Google
"bindings configSource" and "system.serviceModel"
and I think you'll find the same URL I did about it.

> Hi,
>
[quoted text clipped - 12 lines]
>
> Thanks, Steve.
jonesst2608@googlemail.com - 17 Oct 2007 15:48 GMT
Hi,

That's a step in the right direction.

Ideally I want to keep the <service>, <serviceBehaviors> ... etc in a
service specific
configuration file, eg ServiceA.dll is entirely configured by
ServiceA.config.

I'm wondering if my self-hosting parent application could
programmatically
change configSource="ServiceX.config" before instantiating the
specific
service X.

I'll have to investigate.

Thanks.

> You talking about something like this??
>
[quoted text clipped - 59 lines]
>
> > Thanks, Steve.
sloan - 17 Oct 2007 15:56 GMT
Well, a config file is just a fancy xml document, so that's possible.

I went the other route I think.

When I have several different projects, I end up having the app.config file
of the Host(er) as seen below.
Then I've written some el-crappo code to merge different app's into the
single WCFService.config file.

If you figure out anything, post a follow up (probably in a new thread, or
it'll get lost).

..

As a side note, you may want to look at the

msdn.microsoft.com/stocktrader/

Greg has put together a Configuration framework piece.  Its still in its
infancy, but is going to be great for managing multiple machine wcf/config
settings.

channel9/wiki site has some videos (with Greg explaining) as well.

> Hi,
>
[quoted text clipped - 78 lines]
>>
>> > Thanks, Steve.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.