I need to compile two files: server.cs and client.cs which use the file server.cs; and so obtain two .exe file server.exe and client.exe in the Desktop.
Since, I am doing the compilation via code, I am calling the process from the Desktop directory: c:\windows\Microsoft.NET\Framework\v4.0.30319\csc.exe.
After, I have read this topic:
How to use references when compiling c# code via command line
I understood that for solve my problem I should use the reference option.
This is what I am doing:
c:\windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:exe /out:server.exe server.cs
In order to create the server.exe file, and it works.
c:\windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:library server.cs
In order to create the server.dll file, and 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
In order to create the client.exe file, but I got the following error:
"The type or namespace name 'server' could not be found (are you missing a using directive or an assembly reference?);"