cannot get MyService.dll.config connectionstring

Jul 28, 2010 at 7:51 AM

Hi, I'm using DotNetWinService as my windows service, but I found when my dll have a config file such as myservice.dll.config, I can not get the config information (appsettings, connectstrings, etc) from the DotNetWinService; but I can get it if I run my dll ; how can this happen?

 

thx.

Coordinator
Jul 30, 2010 at 7:36 PM

Hi yangjianhua,

Thanks for your question. If I'm right, you are using the TaskMethod class to fire a method inside your assembly. Is that correct? Which version of DotNetWinService are you using? 

If the myservice.dll.config is located inside the same directory as the myservice.dll, it should be able to read all the defined settings. However, I will have a look at project where I did a similar thing 

and let you know asap.

Best regards.

 

Jul 31, 2010 at 3:14 AM
Yes, I'm using DotNetWinService v1.0.0.0.0 & TaskMethod class and I solved this problem.

I found I must put my connectstring and app settings into DotNetWinServiceConsole.exe.config and DotWinService.exe.config, so I can read the config information in MyService.dll's methods.

is that correct?

thank you very much.



On Sat, Jul 31, 2010 at 3:36 AM, jdecuyper <notifications@codeplex.com> wrote:

From: jdecuyper

Hi yangjianhua,

Thanks for your question. If I'm right, you are using the TaskMethod class to fire a method inside your assembly. Is that correct? Which version of DotNetWinService are you using? 

If the myservice.dll.config is located inside the same directory as the myservice.dll, it should be able to read all the defined settings. However, I will have a look at project where I did a similar thing 

and let you know asap.

Best regards.

 

Read the full discussion online.

To add a post to this discussion, reply to this email (dotnetwinservice@discussions.codeplex.com)

To start a new discussion for this project, email dotnetwinservice@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Jul 31, 2010 at 3:59 PM

Yes, that is absolutely correct, this the way to solve it.

Thanks a lot for you comment, I added a note inside the documentation section!