I need to compile two files: server.cs and client.cs, which use the server.cs file; and therefore get two .exe files server.exe and client.exe on the desktop.
Since I am compiling using code , I call this process from the Desktop directory: c: \ windows \ Microsoft.NET \ Framework \ v4.0.30319 \ csc.exe.
After that, I read this topic:
How to use links when compiling C # code through the command line
I realized that to solve my problem I have to use the link option.
This is what I do:
c: \ windows \ Microsoft.NET \ Framework \ v4.0.30319 \ csc.exe / t: exe / out: server.exe server.cs
To create the server.exe file, it works.
c: \ windows \ Microsoft.NET \ Framework \ v4.0.30319 \ csc.exe / t: library server.cs
To create the server.dll file, it works.
c: \ windows \ Microsoft.NET \ Framework \ v4.0.30319 \ csc.exe / lib: C: \ Users \ MyName \ Desktop \ / r: server.dll / t: exe / out: client.exe client .cs
To create the client.exe file, but I got the following error:
"Cannot find the name or namespace name of the server (do you miss the using directive or assembly references?);
source
share