I have merged another project in my existing project by right-clicking on the project name and selecting Add->Existing project option. Now i wan't to access the files from my newly added project from the existing one in Visual Studio (Its a C# project) , how can i do this?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
I struggle with this until I found this the link is below:
If you want all windows application to run as one program rather then calling multiple .exe. Then change 'Out Put Type' of each project to 'Class Library'.
Step 1:
You can do that by right clicking on each Project in solution -> Go to Properties -> Application -> Out Put Type... set it to Class Library
Once you have done that out put of these will be generated as .DLL.
Step2:
Add a new Window Form application project, add reference of exiting projects in it so that they can be executed from here.. you can do that by.. right click on main project-> Add Reference->Projects select all existing projects from here..
Now on main application you can create 3 buttons to launch each project...
[Inventory]
[Accounts]
[Payroll]
Now in each button code will be something like that...
Inventory_click()
{
Inventory.MainForm frm=new Inventory.MainForm();
frm.show();
}
Credit goes to:
https://social.msdn.microsoft.com/Forums/en-US/c1ccccc7-13e0-415c-9ccc-492bdfc9983d/c-application-multiple-projects-in-one-solution?forum=csharpgeneral Hope this helps
If I'm following your question, you had a solution with a project
A
. You then added an existing projectB
.You now want to access a file from
A
inB
. If that's the case, right click on theB -> References
and add a reference to projectA
. Now you can use the files from that project.Edit: From your comment, I'm not sure if you want to have a separate project / file. If you want them to be only 1, you shouldn't really add a new project, you should add to your project
A
the files you need from projectB
. If you want to keep it as a different module that is included, then the above holds, but you need to realize that usually you have one solution, with many projects inside of it.