How do I add an .EXE project to a solution of DLL's?

Discussion in 'Programming' started by xarzu, Jan 11, 2022.

  1. #1
    How do I add an .EXE project to a solution of DLL's?
    This is using Microsoft Visual Studio Professional
    I have been handed a solution file which contains three projects. But all three projects generate DLL files. It is kind of unique because I have uncovered that they contain XAML files. So there is the opportunity to use the dll's to display WPF style UI as long as I properly create a new project for the solution. And this is what I am asking. What are the steps involved in creating a new project in the solution that is an executable and loads the DLL's and displays the UI'S?
     
    xarzu, Jan 11, 2022 IP
  2. Ike Copeland

    Ike Copeland Banned

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #2
    To add an.EXE project to a DLL solution in Visual Studio, you can follow these steps:

    1. Open your DLL solution in Visual Studio.

    2. Go to the Solution Explorer window, right-click on the solution, and select "Add" and then "New Project" from the context menu.

    3. In the "New Project" dialog box, select the "Windows" category and choose the "Windows Application" template.

    4. Give your project a name, and then click "OK" to create the new project.

    5. Now you have the new project added to the solution. You can add the required files and source code to the new project to make it functional.

    6. To run the EXE project, you can right-click on the project in the Solution Explorer window and select "Set as StartUp Project."

    7. In the Solution Explorer window, you can also right-click on the solution, select "Properties," and then navigate to "Common Properties" -> "Startup Project" and choose "Multiple Startup Projects." Then set the action for both projects (EXE and DLL) to "Start."

    8. You can now press the "Start" button or press F5 to run the solution, and it will run both the DLL and EXE projects together.
    Please note that depending on the specific requirements of your project and the interaction between the DLL and the EXE, you may need to make additional changes to the projects, such as adding references between them or making changes to the code, to ensure that the DLL is properly loaded and used by the EXE.

    It's also important to be aware of the dependencies and the different functionalities between DLLs and EXEs. DLLs are typically used for code that will be used by multiple applications, while EXEs are standalone applications that are meant to be executed directly by the user.
     
    Ike Copeland, Jan 14, 2023 IP
  3. ChristianMorris

    ChristianMorris Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    To add an .EXE project to a solution of DLL's in Microsoft Visual Studio Professional, you can follow these steps:

    1. Open the solution in Visual Studio.
    2. Right-click on the solution in the Solution Explorer, and select "Add" > "New Project".
    3. Select the type of project you want to create, such as "WPF App" or "Windows Forms App", and give it a name.
    4. Once the project is created, right-click on it in the Solution Explorer and select "Add" > "Existing Project"
    5. Browse and select the DLL projects you want to include in the solution.
    6. In the .EXE project, add references to the DLL projects you added in the previous step.
    7. In the .EXE project's Main method, you can use the DLL's to display WPF style UI.
    Note that you may need to make sure the DLL's are loaded before the UI is displayed, and that the DLL's are properly referenced in the .EXE project.
     
    ChristianMorris, Jan 22, 2023 IP
  4. Joseph Mack

    Joseph Mack Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    Amazing Information! its really a great thread.
     
    Joseph Mack, Mar 6, 2023 IP
  5. Mark Elijah

    Mark Elijah Greenhorn

    Messages:
    145
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    18
    #5
    Here's how to add an executable project to a solution containing DLLs in Visual Studio:
    1. Right-Click the Solution: In the Solution Explorer pane, right-click on the solution name at the top.

    2. Add -> New Project: Select "Add" -> "New Project" from the context menu.

    3. Choose Project Type: In the "Add New Project" window, choose the project type for your executable. For a WPF application with UI, select "WPF App (.NET Framework)" under the "Visual C#" or "Visual Basic" section (depending on your preference).

    4. Name and Location: Provide a name for your new project and choose a location within the solution folder to save it.

    5. Add Reference: Once the project is created, right-click on the "References" folder within your new executable project.

    6. Add Project References: Select "Add Reference...". In the "Add Reference" dialog box, choose the "Projects" tab.

    7. Select DLL Projects: Check the boxes for the three existing DLL projects that you want your executable to reference. These will provide the XAML UI functionalities.

    8. Click OK: Click "OK" to add the references.
    Now, your new executable project can access the functionalities and UI elements defined within the referenced DLL projects. You can write code in your executable project to interact with the UI elements and classes defined in the DLLs using XAML and C#/VB.NET depending on your chosen language.

    Tips:
    • Make sure the build configuration (Debug/Release) of your executable project matches the build configuration of the referenced DLL projects.
    • You might need to adjust the startup code within your executable project to initialize and display the UI elements from the referenced DLLs. Refer to WPF documentation for guidance on creating user interfaces.
     
    Mark Elijah, May 4, 2024 IP