Click here to Skip to main content
15,917,875 members
Home / Discussions / C#
   

C#

 
AnswerRe: turn GUI program into service Pin
malharone2-Feb-06 11:39
malharone2-Feb-06 11:39 
GeneralRe: turn GUI program into service Pin
BlackDice2-Feb-06 11:54
BlackDice2-Feb-06 11:54 
GeneralRe: turn GUI program into service Pin
Colin Angus Mackay2-Feb-06 12:06
Colin Angus Mackay2-Feb-06 12:06 
GeneralRe: turn GUI program into service Pin
BlackDice2-Feb-06 12:14
BlackDice2-Feb-06 12:14 
GeneralRe: turn GUI program into service Pin
Colin Angus Mackay2-Feb-06 12:20
Colin Angus Mackay2-Feb-06 12:20 
GeneralRe: turn GUI program into service Pin
malharone2-Feb-06 12:11
malharone2-Feb-06 12:11 
GeneralRe: turn GUI program into service Pin
BlackDice2-Feb-06 12:16
BlackDice2-Feb-06 12:16 
AnswerRe: turn GUI program into service Pin
Colin Angus Mackay2-Feb-06 12:02
Colin Angus Mackay2-Feb-06 12:02 
BlackDice wrote:
I've been working on an app with a gui (mostly because it's easier to test) because I know someone who said it was easy to turn an app into a service once you had it tested the way you want.


Personally, I would have used something like NUnit[^]

I would have set the solution up as follows:

Solution
-- Service Bootstrap Assembly
-- NUnit Test Assembly
-- Service logic

The Service Logic project would contain all the code that the service uses. It would have zero dependancy on either of the other two projects - If it suddenly does need a dependancy the compiler will warn me about it and I know I've coded something wrong.

The NUnit Test Assembly (which is roughly equivalent to your GUI code) contains all the tests and is dependant on the Service Logic project (because that it what it is testing).

The Service Bootstrap is the EXE that actually runs as a service, but it has very little code as all it does is access the code in the Service Logic project. Again, this project is dependant on the Service logic assembly.

This keeps all the code nicely separated to when it comes time to deploy it you can just grab the bootstrap and the logic assemblies.

So, back to your problem, the best way to do this would be to extract the GUI from the service code and try and put something together that resembles the above - otherwise you are going to create lots of problems for yourself in the future.


BlackDice wrote:
He did it in VB.Net, though and I'm no longer in touch with him.


Just as well. You you were I'd tell you to tell him that I think his solution is crazy and introduces lots of problems into the project that you are now having to resolve.

ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

AnswerRe: turn GUI program into service Pin
Andy Brummer2-Feb-06 12:19
sitebuilderAndy Brummer2-Feb-06 12:19 
AnswerRe: turn GUI program into service Pin
bskirkman2-Feb-06 17:53
bskirkman2-Feb-06 17:53 
GeneralRe: turn GUI program into service Pin
bskirkman2-Feb-06 17:55
bskirkman2-Feb-06 17:55 
QuestionC# Class Inheritance Pin
LighthouseJ2-Feb-06 11:16
LighthouseJ2-Feb-06 11:16 
AnswerRe: C# Class Inheritance Pin
Guffa2-Feb-06 11:21
Guffa2-Feb-06 11:21 
GeneralRe: C# Class Inheritance Pin
LighthouseJ2-Feb-06 11:44
LighthouseJ2-Feb-06 11:44 
AnswerRe: C# Class Inheritance Pin
Guffa2-Feb-06 22:19
Guffa2-Feb-06 22:19 
GeneralRe: C# Class Inheritance Pin
LighthouseJ3-Feb-06 4:34
LighthouseJ3-Feb-06 4:34 
AnswerRe: C# Class Inheritance Pin
Ravi Bhavnani2-Feb-06 11:24
professionalRavi Bhavnani2-Feb-06 11:24 
GeneralRe: C# Class Inheritance Pin
LighthouseJ2-Feb-06 11:45
LighthouseJ2-Feb-06 11:45 
AnswerRe: C# Class Inheritance Pin
malharone2-Feb-06 11:37
malharone2-Feb-06 11:37 
GeneralRe: C# Class Inheritance Pin
LighthouseJ2-Feb-06 11:53
LighthouseJ2-Feb-06 11:53 
QuestionEDIT MENU + CUT, COPY, PASTE Pin
emran8342-Feb-06 11:08
emran8342-Feb-06 11:08 
AnswerRe: EDIT MENU + CUT, COPY, PASTE Pin
J4amieC2-Feb-06 23:08
J4amieC2-Feb-06 23:08 
GeneralRe: EDIT MENU + CUT, COPY, PASTE Pin
emran8343-Feb-06 17:20
emran8343-Feb-06 17:20 
QuestionGet a controll fully customized Pin
Sasuko2-Feb-06 10:22
Sasuko2-Feb-06 10:22 
AnswerRe: Get a controll fully customized Pin
Ingo3-Feb-06 2:14
Ingo3-Feb-06 2:14 

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.