My .NET Framework 4.8 solution (Visual Studio 2019) has two projects, ProjectA and ProjectB. Project A needs to be able to launch ProjectB executable. I've tried everything to get the ProjectB .exe published out to ProjectA's Application Files folder (using VS Publish feature), including:
- include ProjectB bin/Release folder in solution, then modify the .exe file's Build Action to 'Content' (doesn't work). Doing this does NOT make the .exe appear in Project A's Publish/Application_Files, surprisingly.
What am I missing?
Would it be better to just deploy Project B separately? (It is only a test program)
CodePudding user response:
In Visual Studio:
- Expand "Project A" in the "Solution Explorer"
- Right click on "References",
- Click on "Add reference..."
- On the window that has opened, select "Projects" on the left panel
- Select "Project B" as a reference and click "Ok"
Now "Project B" should compile along with "Project A" and is put in the bin and publish folders.
If there is some sort of cyclic reference error due to "Project A" already being referenced in "Project B", just publish "Project B" instead as it should have all DLL's and EXE's of both projects already.