0

I have little C# experience. I have at one time maintained C# code on existing project. Now I'm assigned a task of developing a C# client connecting a server installed on local host. The server provides support for user to develop client in several languages. For C++, several folders containing dlls and headers, that's enough(I know how to use). For C#, several folders of .cs files. This way I don't know how to use. They're not compiled assemblies. May I need to include all the folders and cs files one by one into my own project and build them together? Please refer to pictures below:

C++ developer support:

enter image description here

C# developer support, I don't know how should I start to build a client:

enter image description here

The content under Support folder provides users ways to call interfaces which in turn connecting to the running server.
I'll generate a C# program using those files under Support\csharp\ folder. I begin in this way as picture below, not sure if it's the correct beginning? And about the error hint: if the namespace and the class name are same, how to instantiate it with new:

enter image description here

enter image description here

Wason
  • 1,341
  • 1
  • 13
  • 26

1 Answers1

1

If there's no .csproj file, you must include them (cs files) in a C# VisualStudio project (.csproj), and compile/build them. You must know (and add) the external libraries used or deduce them from the using sentences (import's).

Then you can build that project in a external solution, and get dll to your own project, or add a new project on same solution and build them together.


It's a bad idea (namespace and class with the same name). Look at this SO thread: Namespace and class with the same name?. If you can't change it, you must set the path explicitly everywhere:

QQQClient.QQQClient quts = new QQQClient.QQQClient();
Marc
  • 1,359
  • 1
  • 15
  • 39
  • Thanks! You answers what I needed. And may you explain the error for me? How if the QQQClient is both a namespace and a class name? The names are defined by the product. – Wason Mar 29 '18 at 06:05
  • Thank you very much. Fully get it. – Wason Mar 29 '18 at 08:20