Search code examples
c#c++visual-studiovisual-studio-2012projects-and-solutions

Force Visual Studio to rebuild dependent projects


How can I force Visual Studio 2012 to rebuild all dependent projects when a project changes?

I have two projects: a C++ DLL, and a C# WPF app. The C# project has a post-build command to copy the DLL into the Debug folder.

When I modify the C++ project, the DLL is rebuilt, but the C# project isn't, and so the DLL isn't updated in the Debug folder. Then I need to clean and rebuild the solution before I see the updated results.

I'd like to tell VS that whenever I update the C++ project, it should rebuild the C# project (or at least run the post-build command). The C# project is dependent on the C++ project, but not through a reference.


Solution

  • If setting the project dependency inside your solution does not help just try to include the .dll from the C++ project as a link into the other project, then it should recognize that the file was changed and should rebuild the project.