Highlighted
Super Contributor.
Super Contributor.
1420 views

Referring to a managed project in another solution

Jump to solution

I haven't found a good solution for this on the Web.  Project A in solution 1 wants to call a program in project B in solution 2.  Because project B is in another solution I don't see it on the Project tab of the Add Reference dialog so I add a reference to project B's dll file from the Browse tab.  Once I've done this I can call project B's programs from project A.  The problem is that I'm doing this for the debug build and looking inside the cobol project file the reference is shown as  "debug\ProjectB.dll".  All of our compiled programs are being output to this directory.  When we later do a release build all programs will be output to the release directory and we will need to replace all references.  Because we are keeping our solutions small this could require a lot of work.

What is the best way to add references to projects in other solutions ?

Phil Levin

Tags (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Super Contributor.
Super Contributor.

RE: Referring to a managed project in another solution

Jump to solution

I was not able to use the above post build events because my solutions are all in different folders but maybe I won't have a problem after all.  I'm calling a program in managed project b in solution 2 from a program in managed project a in solution 1.  I can't program the call to the program in project b unless I first add a reference to it in project a.  Intellisense can't find it.  Because project b is in a different solution I don't see it on the project tab of the add a reference dialog so I have to browse and select projectb.dll.  For the debug build all of my files are being output to the same "debug" directory, so this directory holds both projecta.dll and projectb.dll.  When I do the release build, projecta.dll and projectb.dll are both output to the same "release" directory.  The reference that I added in project a to project b points to "debug\projectb.dll" not "release.projectb.dll".  When I run the "release" version of my two projects, the program in project a still finds the program in project b.  I also tried renaming the "debug" directory to "debug-save", but the program in project a is still able to call the program in project b.

Phil Levin

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Referring to a managed project in another solution

Jump to solution

I use a used "post" and "pre-build" events to copy the .dll into the right location.

for example:

In the DLL project have a "post-build" event of:

  if not exist $(SolutionDir)Shared.$(ConfigurationName) mkdir  $(SolutionDir)Shared.$(ConfigurationName)
  copy $(TargetDir)*.dll  $(SolutionDir)Shared.$(ConfigurationName)

 

and in the exe project have another post build event that copies everything from the directory eg:

  copy $(SolutionDir)Shared.$(ConfigurationName) $(TargetDir)

0 Likes
Highlighted
Super Contributor.
Super Contributor.

RE: Referring to a managed project in another solution

Jump to solution

I was not able to use the above post build events because my solutions are all in different folders but maybe I won't have a problem after all.  I'm calling a program in managed project b in solution 2 from a program in managed project a in solution 1.  I can't program the call to the program in project b unless I first add a reference to it in project a.  Intellisense can't find it.  Because project b is in a different solution I don't see it on the project tab of the add a reference dialog so I have to browse and select projectb.dll.  For the debug build all of my files are being output to the same "debug" directory, so this directory holds both projecta.dll and projectb.dll.  When I do the release build, projecta.dll and projectb.dll are both output to the same "release" directory.  The reference that I added in project a to project b points to "debug\projectb.dll" not "release.projectb.dll".  When I run the "release" version of my two projects, the program in project a still finds the program in project b.  I also tried renaming the "debug" directory to "debug-save", but the program in project a is still able to call the program in project b.

Phil Levin

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.