Click here to Skip to main content
15,925,369 members
Home / Discussions / C#
   

C#

 
GeneralRe: String formatting question Pin
Andy *M*3-Jun-04 6:28
Andy *M*3-Jun-04 6:28 
GeneralSharing a config file Pin
Andy *M*3-Jun-04 5:22
Andy *M*3-Jun-04 5:22 
GeneralRe: Sharing a config file Pin
Dave Kreskowiak3-Jun-04 5:55
mveDave Kreskowiak3-Jun-04 5:55 
GeneralRe: Sharing a config file Pin
Heath Stewart3-Jun-04 6:07
protectorHeath Stewart3-Jun-04 6:07 
GeneralRe: Sharing a config file Pin
Dave Kreskowiak3-Jun-04 6:11
mveDave Kreskowiak3-Jun-04 6:11 
GeneralRe: Sharing a config file Pin
Andy *M*3-Jun-04 6:12
Andy *M*3-Jun-04 6:12 
GeneralRe: Sharing a config file Pin
Colin Angus Mackay4-Jun-04 9:37
Colin Angus Mackay4-Jun-04 9:37 
GeneralRe: Sharing a config file Pin
Heath Stewart3-Jun-04 6:10
protectorHeath Stewart3-Jun-04 6:10 
As Dave said, that really isn't possible.

There is one way, though it's a pretty big hack and won't really solve your problem. You can create a launcher with it's own config file that specifies the path of the executable (optional) and the path to the .config file. This launcher is executable as normal but then grabs the path to your current Windows Service executable (or hard-code it, though I recommend against that), sets up a second AppDomain (see AppDomain.CreateDomain) and sets the AppDomain.SetupInformation.ConfigurationFile using the path you configured.

This isn't recommended, though. Those .config files are separate for security reasons and because a true application boundary exists (they're obviously both separate executables). Also, A Windows Service and an ASP.NET web application really share very little of the .config in common, such as the appSettings and assemblyBinding (as well as other runtime sections).

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Sharing a config file Pin
Andy *M*3-Jun-04 6:25
Andy *M*3-Jun-04 6:25 
GeneralRe: Sharing a config file Pin
Heath Stewart3-Jun-04 6:43
protectorHeath Stewart3-Jun-04 6:43 
GeneralRe: Sharing a config file Pin
Andy *M*3-Jun-04 22:11
Andy *M*3-Jun-04 22:11 
GeneralRe: Sharing a config file Pin
Heath Stewart4-Jun-04 4:03
protectorHeath Stewart4-Jun-04 4:03 
General"scrolling" old listbox items off the bottom when a new one is added to the top... Pin
xylophile3-Jun-04 5:01
xylophile3-Jun-04 5:01 
GeneralRe: "scrolling" old listbox items off the bottom when a new one is added to the top... Pin
Dave Kreskowiak3-Jun-04 5:17
mveDave Kreskowiak3-Jun-04 5:17 
GeneralRe: "scrolling" old listbox items off the bottom when a new one is added to the top... Pin
Heath Stewart3-Jun-04 6:11
protectorHeath Stewart3-Jun-04 6:11 
GeneralRe: "scrolling" old listbox items off the bottom when a new one is added to the top... Pin
Dave Kreskowiak3-Jun-04 6:42
mveDave Kreskowiak3-Jun-04 6:42 
GeneralRe: "scrolling" old listbox items off the bottom when a new one is added to the top... Pin
Heath Stewart3-Jun-04 6:54
protectorHeath Stewart3-Jun-04 6:54 
GeneralRe: "scrolling" old listbox items off the bottom when a new one is added to the top... Pin
Dave Kreskowiak3-Jun-04 7:17
mveDave Kreskowiak3-Jun-04 7:17 
GeneralRe: "scrolling" old listbox items off the bottom when a new one is added to the top... Pin
Heath Stewart3-Jun-04 7:22
protectorHeath Stewart3-Jun-04 7:22 
GeneralRe: "scrolling" old listbox items off the bottom when a new one is added to the top... Pin
Dave Kreskowiak3-Jun-04 7:25
mveDave Kreskowiak3-Jun-04 7:25 
GeneralRe: "scrolling" old listbox items off the bottom when a new one is added to the top... Pin
Dave Kreskowiak3-Jun-04 6:39
mveDave Kreskowiak3-Jun-04 6:39 
GeneralSimple (I think) Inheritance question Pin
Guinness4Strength3-Jun-04 4:43
Guinness4Strength3-Jun-04 4:43 
GeneralRe: Simple (I think) Inheritance question Pin
Judah Gabriel Himango3-Jun-04 5:59
sponsorJudah Gabriel Himango3-Jun-04 5:59 
GeneralRe: Simple (I think) Inheritance question Pin
Heath Stewart3-Jun-04 6:02
protectorHeath Stewart3-Jun-04 6:02 
GeneralRe: Simple (I think) Inheritance question Pin
Guinness4Strength3-Jun-04 6:04
Guinness4Strength3-Jun-04 6:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.