Results 1 to 2 of 2

Thread: Windows service and config file

  1. #1
    Powell Trusler is offline Registered User
    Join Date
    Sep 2006
    Posts
    8

    Windows service and config file

    I am having difficulty figuring out how to specifing a config file in a windows service. I am using C#, ICE 3.1 and ssl.
    The service works fine when I use a simple TCP setup with no config file and create an adapter with endpoints directly in the code.
    In the onstart method of my service I instantiate my server class which is an ICE Application. like...
    protected override void OnStart(string[] args)
    {
    app = new server();
    app.main(args, @"c:\test\config.server");
    ....

    Permissions and access to the file are not the cause.
    Can some one give me an example of how to do this, or how to specifiy the ICE properties directly in code eliminating the need for the config file?

    Any help greatly appreciated!
    Powell Trusler
    CitiGroup
    Enterprise Infrastructure Tools

  2. #2
    mes's Avatar
    mes
    mes is online now ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,441
    Hi,

    You don't mention it in your message, but what exactly is happening when you try to load a configuration file?

    If you want to hard-code the properties in your application, you can do something like this:
    Code:
    Ice.InitializationData initData = new Ice.InitializationData();
    initData.properties = Ice.Util.createProperties();
    initData.properties.setProperty("MyAdapter.Endpoints", "tcp -p 10000");
    app = new server();
    app.main(args, initData);
    Take care,
    - Mark

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to use my config file in VS 2005
    By bxhsix in forum Help Center
    Replies: 2
    Last Post: 03-30-2008, 03:46 AM
  2. Using config file with Java client
    By Djaunl in forum Help Center
    Replies: 2
    Last Post: 03-15-2007, 02:43 PM
  3. config file properties
    By Greenhippo in forum Help Center
    Replies: 3
    Last Post: 01-16-2007, 03:07 AM
  4. Using Ice.Config with a Windows Service
    By iamwoodyjones in forum Help Center
    Replies: 9
    Last Post: 09-26-2006, 11:14 AM
  5. set config properties w/o config file
    By dkey in forum Help Center
    Replies: 3
    Last Post: 05-08-2005, 05:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •