Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Question on Visual Studio & Project References

Question on Visual Studio & Project References

Scheduled Pinned Locked Moved C#
visual-studioquestionhelpcsharpdesign
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    malharone
    wrote on last edited by
    #1

    The project I'm currently working on high level has 3 primary projects: |-> Definitions [dll] |-> ClientConsole [exe] |-> ServerConsole [exe] Definitions project has no references. ClientConsole is an exe that will be distributed on clients and references "Definitions" project. ServerConsole is an exe that will be distributed on server(s). But the requirements allow, server to present itself as a client and thus be an acting "client". My question: How do I add "ClientConsole" as a reference to the "ServerConsole" project as the server needs to be able to instantiate the client related objects (UI, other classes). The "Add Reference" fails since "ClientConsole" is of type exe. I can NOT make "ClientConsole" a class-library and add a new additional EXE project just for launching the ClientConsole. I have tried all of the following: 1. Keep ClientConsole an exe, and as a "Post build event" on "ClientConsole" project to copy and rename itself as a DLL to the references folder of "ServerConsole" project. This does not work because ... a) Visual Studio locks the DLLs and thus the new DLL cannot be copied to the destiation folder b) Even if VS does not lock the file, the intellisense will not reflect the changes in ClientConsole when editing code for ServerConsole when "ClientConsole" is updated 2. Change ClientConsole to a DLL project, and add it as a project reference to ServerConsole. I'll have solved my issue with intellisense and VS picking up the correct DLLs. And as an icing on the cake, set the "post build event" on "ServerConsole" project to rename the "ClientConsole.dll" file to "ClientConsole.exe". This is an ideal solution for me, but this also bomb because ... a) when the client is compiled as a DLL, the entry poing info "Main()" is not defined so renaming the DLL to an EXE throws error that it's an invalid Win32 app. I'm sure I'm not the first one to encounter this error. What do you suggest? Thanks, - Malhar

    C 1 Reply Last reply
    0
    • M malharone

      The project I'm currently working on high level has 3 primary projects: |-> Definitions [dll] |-> ClientConsole [exe] |-> ServerConsole [exe] Definitions project has no references. ClientConsole is an exe that will be distributed on clients and references "Definitions" project. ServerConsole is an exe that will be distributed on server(s). But the requirements allow, server to present itself as a client and thus be an acting "client". My question: How do I add "ClientConsole" as a reference to the "ServerConsole" project as the server needs to be able to instantiate the client related objects (UI, other classes). The "Add Reference" fails since "ClientConsole" is of type exe. I can NOT make "ClientConsole" a class-library and add a new additional EXE project just for launching the ClientConsole. I have tried all of the following: 1. Keep ClientConsole an exe, and as a "Post build event" on "ClientConsole" project to copy and rename itself as a DLL to the references folder of "ServerConsole" project. This does not work because ... a) Visual Studio locks the DLLs and thus the new DLL cannot be copied to the destiation folder b) Even if VS does not lock the file, the intellisense will not reflect the changes in ClientConsole when editing code for ServerConsole when "ClientConsole" is updated 2. Change ClientConsole to a DLL project, and add it as a project reference to ServerConsole. I'll have solved my issue with intellisense and VS picking up the correct DLLs. And as an icing on the cake, set the "post build event" on "ServerConsole" project to rename the "ClientConsole.dll" file to "ClientConsole.exe". This is an ideal solution for me, but this also bomb because ... a) when the client is compiled as a DLL, the entry poing info "Main()" is not defined so renaming the DLL to an EXE throws error that it's an invalid Win32 app. I'm sure I'm not the first one to encounter this error. What do you suggest? Thanks, - Malhar

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      malharone wrote:

      I can NOT make "ClientConsole" a class-library and add a new additional EXE project just for launching the ClientConsole.

      Why not?

      malharone wrote:

      I'm sure I'm not the first one to encounter this error. What do you suggest?

      State the obvious and suggest you move the relevant parts to a new Class Library and have ClientConsole become a bootstrap to the controls and forms in the new class library.


      Upcoming Scottish Developers events: * UK Security Evangelists On Tour (2nd November, Edinburgh) * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog

      M 1 Reply Last reply
      0
      • C Colin Angus Mackay

        malharone wrote:

        I can NOT make "ClientConsole" a class-library and add a new additional EXE project just for launching the ClientConsole.

        Why not?

        malharone wrote:

        I'm sure I'm not the first one to encounter this error. What do you suggest?

        State the obvious and suggest you move the relevant parts to a new Class Library and have ClientConsole become a bootstrap to the controls and forms in the new class library.


        Upcoming Scottish Developers events: * UK Security Evangelists On Tour (2nd November, Edinburgh) * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog

        M Offline
        M Offline
        malharone
        wrote on last edited by
        #3

        Colin Angus Mackay wrote:

        Why not?

        Unfortunately, where I work, it is the "Business" that makes tbe technical decision. They want to have a simplified client-side deployment process. One additional DLL and the hell breaks loose! They've dictated that clients should have "Definitions.dll" and the "ClientConsole.exe" only. Rest of the 3rd party dependent references are already installed, so the installer only copies 2 files on the client machine.

        Colin Angus Mackay wrote:

        State the obvious

        I was hoping that from the post build event of "ServerConsole", somehow I could recompile the ClientConsole as a WinExe application.

        M 1 Reply Last reply
        0
        • M malharone

          Colin Angus Mackay wrote:

          Why not?

          Unfortunately, where I work, it is the "Business" that makes tbe technical decision. They want to have a simplified client-side deployment process. One additional DLL and the hell breaks loose! They've dictated that clients should have "Definitions.dll" and the "ClientConsole.exe" only. Rest of the 3rd party dependent references are already installed, so the installer only copies 2 files on the client machine.

          Colin Angus Mackay wrote:

          State the obvious

          I was hoping that from the post build event of "ServerConsole", somehow I could recompile the ClientConsole as a WinExe application.

          M Offline
          M Offline
          malharone
          wrote on last edited by
          #4

          malharone wrote:

          the ClientConsole as a WinExe application

          hmm.. I could do that.. I should do that given the constraints

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups