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

C#

 
GeneralRe: Dealing with shortcuts Pin
Christian Graus1-Mar-05 18:07
protectorChristian Graus1-Mar-05 18:07 
GeneralRe: Dealing with shortcuts Pin
Radgar1-Mar-05 22:04
Radgar1-Mar-05 22:04 
Generalpix Pin
wael_waw1-Mar-05 14:33
wael_waw1-Mar-05 14:33 
GeneralRe: pix Pin
Christian Graus1-Mar-05 15:13
protectorChristian Graus1-Mar-05 15:13 
GeneralSimple example ZIP of Windows Service with remoting Pin
a_edwill1-Mar-05 14:28
a_edwill1-Mar-05 14:28 
GeneralRe: Simple example ZIP of Windows Service with remoting Pin
Scott Serl1-Mar-05 19:02
Scott Serl1-Mar-05 19:02 
GeneralRe: Simple example ZIP of Windows Service with remoting Pin
a_edwill2-Mar-05 7:36
a_edwill2-Mar-05 7:36 
GeneralRe: Simple example ZIP of Windows Service with remoting Pin
Scott Serl4-Mar-05 8:28
Scott Serl4-Mar-05 8:28 
I am sorry I have not replied quickly. There are several problems to consider in the approach you have. You can't remote your whole service like you are trying to do. Instead, put your code in a class (preferably in a new class library project). The class must inherit from MarshalByRefObject to be remoted. Also, the "type" attribute in your config files should be in the form type="namespace.class,assemblyname". It looks like you have it backwards.
Also, when you write the client app, you can add a reference to your remote class, but is generally looked upon as bad practice. It will work though for learning about remoting. After you become more comfortable, there are other ways of referencing your remote objects in the client such as implementing an interface in the remote code, and only referring to the interface in the client code. There are also ways to make a meta data assembly using soapsuds to extract the definitions from the remote object, then compiling an assembly using the output from soapsuds. For now, just keep that in the back of your mind to explore after you get romoting to work in the most simple case.

1. Make a new class library project (call it HelloWorld or something).
a. Add a Class called HelloWorldInfo or something.
1. Make sure it inherits from MarshalByRefObject
2. Make a console project to act as a test server (call it MyServer).
a. Add a reference in MyServer to HelloWorld.
b. Add a config file to MyServer and add the remoting config to it.
c. In Main(), call the remoting configuration, and then wait for a keypress.
3. Make a console project to act as a client to the server.
a. Add a reference to HelloWorld (this is not good practice, but will serve as a simple way during learning).
b. Add a config file and put the client remoting config in it.
c. In Main(), call the remoting configuration, then call any methods you want and output the results to the console.
4. Debug the server by starting it in Visual Studio
a. Open a command prompt and type "netstat -a"
b. look in the list output from netstat for the port you have assigned to your remote object. You should see your computer listening on that port.
5. Open your client in another copy of Visual Studio and start it for debugging.
a. You can now step through your code in debug mode, and even step into the server code. This makes debugging much easier.
6. Once the server code is fully debugged, Make a new windows service project.
a. Add a reference to HelloWorld.
b. Put the remoting configuration code in the OnStart of your service.
c. Add an installer to your service.
d. Add a setup project to install your service.

After you get comfortable with remoting, be sure to go back and learn how to reference remote classes in the remote client without deploying the server code to the client (so it by implementing interfaces, or compiling metadata-only assemblies).


GeneralMDI and moveable (custom) control painting Pin
pacharakeng1-Mar-05 12:13
pacharakeng1-Mar-05 12:13 
GeneralRe: MDI and moveable (custom) control painting Pin
Dave Kreskowiak3-Mar-05 0:39
mveDave Kreskowiak3-Mar-05 0:39 
Questionimport registry files? Pin
Anthony Mushrow1-Mar-05 12:02
professionalAnthony Mushrow1-Mar-05 12:02 
AnswerNeed some help! Pin
Anthony Mushrow1-Mar-05 22:50
professionalAnthony Mushrow1-Mar-05 22:50 
GeneralNeed help accessing a textbox from another class... Pin
ericfgarcia1-Mar-05 10:56
ericfgarcia1-Mar-05 10:56 
GeneralRe: Need help accessing a textbox from another class... Pin
Judah Gabriel Himango1-Mar-05 11:46
sponsorJudah Gabriel Himango1-Mar-05 11:46 
GeneralRe: Need help accessing a textbox from another class... Pin
ericfgarcia2-Mar-05 3:44
ericfgarcia2-Mar-05 3:44 
GeneralRe: Need help accessing a textbox from another class... Pin
Judah Gabriel Himango2-Mar-05 5:14
sponsorJudah Gabriel Himango2-Mar-05 5:14 
GeneralGetAttribute Returning Null Sometimes Pin
DemonBob1-Mar-05 10:37
DemonBob1-Mar-05 10:37 
GeneralRegex question Pin
ektoras1-Mar-05 10:02
ektoras1-Mar-05 10:02 
GeneralRe: Regex question Pin
Dave Kreskowiak1-Mar-05 10:18
mveDave Kreskowiak1-Mar-05 10:18 
GeneralRe: Regex question Pin
leppie1-Mar-05 11:10
leppie1-Mar-05 11:10 
GeneralOleDB Insert into MS Access Pin
Vodstok1-Mar-05 9:54
Vodstok1-Mar-05 9:54 
GeneralRe: OleDB Insert into MS Access Pin
Dave Kreskowiak1-Mar-05 10:16
mveDave Kreskowiak1-Mar-05 10:16 
GeneralRe: OleDB Insert into MS Access Pin
Vodstok1-Mar-05 10:26
Vodstok1-Mar-05 10:26 
GeneralRe: OleDB Insert into MS Access Pin
Anonymous1-Mar-05 10:42
Anonymous1-Mar-05 10:42 
GeneralRe: OleDB Insert into MS Access Pin
Troske1-Mar-05 12:29
Troske1-Mar-05 12:29 

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.