❔ Copy files before building a project
Hi all!
I am trying to do a thing that but I don't know if it's possible. I have a Debug and Release environment, and I have the same project references in two different ways (one folder or another). In order to make it work in Release, I need to copy some files into the same folder of the current project so it can compile. But, even if I try to copy the files, because we can only have one reference to a project in the solution, it doesn't compile and it does not work.
The question would be: Is it possible to have a solution that references a project that is in two places depending on the environment?
- In Release: Same folder of the main project
- In Debug: Different folder of the main project
I can add more info if you need more clarification.
5 Replies
Yes, pretty sure you can add conditional reference, have it depend upon the configuration. Let me look for docs
Stack Overflow
Project reference conditional include with multiple conditions
Here's a snippet from my csproj file:
<ProjectReference Include="..\program_data\program_data.csproj" Condition="'$(Configuration)'=='Debug'">
<Project>{4F9034E0-B8E3-448E-8794-
Just add 'condition', it seems
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Hi, sorry for the late reply. I've tried this, but it won't compile