Multiple Applications in One Solution

I believe that this is possible, but not sure how to get around it, I need to create a server / client solution, as a rule, I would create a new solution for the server and a new one for the client, however I am looking for this within the framework of one solution, since they will both use the same user classes and do not want the problem to change the same file twice.

So, the question is, can I create several exe in one solution and what are the steps to achieve this.

I searched here, but did not fully understand the procedure, so if someone could point me in the general right direction, that would be great. :)

VS2010 using C Sharp and Windows Forms

+4
source share
7 answers

See and the previous answer I gave for developing a cross-platform client server, in particular with code reuse for multiple clients. This also applies to your Winforms server application here.

Like many answers, you can structure your solution for code sharing as follows:

Project structure

Decision
.. General (Messages, Datacontracts, Utilities)
.. Middleware (Common links, provides common services)
.... Exe Server (Common, Middleware Links)
.... Exe Client (Common, Middleware Links)

Top-Level Client-Server Architecture

Cross-platform application stack

Your stack is getting

Customers:

The client has serialization, client-side implementation of web services / middleware and Model-View-Presenter for presentation.

Middleware:

Medium-sized software, that is, sharing services and transferring data on the server / client desktop, may be the same. Alternatively, you can call the Service. Any specific services only for the client (or only for the server) should be placed in separate assemblies and refer only to a specific exe (client or server). those. Do not use common code that is not used!

Messages / DataContracts:

Common to all clients / servers using the methods described above. In your case, these can be shared domain objects shared between the client and server.

Server:

All business logic, access to the database and server implementations. For access to the database, I recommend PetaPoco as an excellent MicroORM.

Development and debugging

Yes, a solution can have more than one exe, just use the Startup Project install by right-clicking on the Exe or Client Exe server to debug one or the other.

If you want to start the client and server together, you can start both from the command line and attach the debugger to both processes.

Yours faithfully,

+10
source

First, make sure you see the solution file in the solution explorer:

Go to Tools->Options . Then in Projects and Solutions make sure Always Show Solutions checked.

Then, in the solution explorer (top right, where your project files are located), right-click on your solution (just above the project icon), then click Add->New Project .


In terms of solution layout, you will have 3 projects, a client project, a server project, and a class library project for common classes.

Your client and server projects will refer to the library project: Project Link (MSDN)


See also: Multiple Project Solutions (MSDN)

+2
source

You would do it like this:

  • You have one solution
  • Add three projects to the solution:
    • Project A: exe server
    • Project B: exe client
    • Project C: A class library project containing classes that use projects A and B.
  • Make Project Link Project A and BC
+1
source

You can right-click the solution icon located at the top in the solution explorer and select a new project option.

+1
source
  • Add a new class library project to your solution. Put your generic code there.
  • Add as many WinForms projects you need for your solution.
  • Add class library project references to your winforms projects.
+1
source

There is nothing special about several projects within one solution - VS 2010 fully supports this, see http://msdn.microsoft.com/en-us/library/23x5fk78.aspx .

+1
source

You can also add the same project to several solutions . There is no need to have server and client output in one solution.

In other words, if these are projects that you want to use both on the server and on the client:

 Project A: CoreClasses Project B: Entities 

Then just add them to both solutions:

  + Solution 1: Server +- Project A: CoreClasses +- Project B: Entities +- Project C: ServerSpecific -> output + Solution 2: Client +- Project A: CoreClasses +- Project B: Entities +- Project D: ClientSpecific -> output 

In your trunk it looks something like this:

  /trunk/ /trunk/ProjectA/ /trunk/ProjectB/ /trunk/ProjectC/ /trunk/ProjectD/ /trunk/ClientSolution.sln /trunk/ServerSolution.sln 
+1
source

Source: https://habr.com/ru/post/1392499/


All Articles