How to get Visual Studio 2012 to rebuild all dependent projects when the project changes?
I have two projects: C ++ DLL and C # WPF application. The C # project has a post-build command to copy the DLL to the Debug folder.
When I modify a C ++ project, the DLL is rebuilt, but the C # project is not, and therefore the DLL is not updated in the Debug folder. Then I need to clear and rebuild the solution before I see the updated results.
I would like to tell VS that whenever I update a C ++ project, it should rebuild the C # project (or at least run the post-build command). A C # project depends on a C ++ project, but not through a link.
DLL ++ , , .
, , .
# "" > " ".
++, DLL , "", " ".
, #, "", " ", "", . , Debug ( , ) . " ", .
, # ++, , ++, .
post-build # (foobar - ++ DLL).
copy "$(SolutionDir)\$(Configuration)\foobar.dll" "$(TargetDir)"
:
<ItemGroup> <None Include="$(MSBuildProjectDirectory)\Properties\Build\_buildforcer"> <Visible>true</Visible> </None> </ItemGroup> <Target Name="ForceNextBuild" AfterTargets="PrepareForRun" Condition=" '$(BuildingInsideVisualStudio)' == 'true' "> <Touch Files="$(MSBuildProjectDirectory)\Properties\Build\_buildforcer" AlwaysCreate="true"/> </Target>
Import, . , .
Import
, , -. , . MSBuild , , . , F5 .
MSBuild
F5
None Visible, . .
None
Visible