Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to get C# library file in output directory?

I have a solution with a few projects:

  1. library.dll with something.json
  2. webapp.dll
  3. winapp.exe

2 and 3 depend on 1, not on eachother.

I would like copy something.json to the bin directory of winapp.exe

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

However setting the properties to Content and Copy always doesn’t do what I expected.

enter image description here

>Solution :

You can use the Post-build event command line of your winapp.exe for instruct to copy that file inside your target dir

something like this

xcopy /Y  $your path of something.json $(TargetDir).

Change your path of something.json to your actual path.

Remember that you have a set of usefull link

  • (TargetDir) = Where your project is going to be compiled
  • (SolutionDir) = The solution path on your disk
  • (ProjectDir) = The project path on your disk
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading