Answered by:
Visual Studio Programming 101

Question
Answers
-
Hi Brandon,
Files can be shared between projects but from my perspective, this is not a good pattern.
To share a file between projects you right click the location where the file should be added (e.g. inside the project itself or inside a sub folder.) and choose Add -> Existing Item...
Choose the file you want to add but instead of clicking the button "Add" you click on the small arrow next to it. Then you can choose Add as Link.
That way the other file is also included in the 2nd project.
You should take care with namespaces - if the projects have different default namespaces than this might cause trouble.
With kind regards,
Konrad
- Marked as answer by Brandon.Ho Friday, May 06, 2016 4:43 AM
All replies
-
-
Yes, Visual Studio creates one exe file per project. In the project, it creates app.config, exe, and other files on both bin and release folders. I would like to create another exe program which would share the app.config common parameters and SQL connection configuration. If I use Blend to copy VS project, when I change the contains in the app.config, I will have to update both app.config files. If I share the folder, I don't have to change them in multiple folders.
Thanks,
-
Hi Brandon,
Files can be shared between projects but from my perspective, this is not a good pattern.
To share a file between projects you right click the location where the file should be added (e.g. inside the project itself or inside a sub folder.) and choose Add -> Existing Item...
Choose the file you want to add but instead of clicking the button "Add" you click on the small arrow next to it. Then you can choose Add as Link.
That way the other file is also included in the 2nd project.
You should take care with namespaces - if the projects have different default namespaces than this might cause trouble.
With kind regards,
Konrad
- Marked as answer by Brandon.Ho Friday, May 06, 2016 4:43 AM
-