Force Visual Studio for recovering dependent projects

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.

+5
source share
3

DLL ++ , , .

+2

, , .

# "" > " ".

++, DLL , "", " ".

, #, "", " ", "", . , Debug ( , ) . " ", .

, # ++, , ++, .

post-build # (foobar - ++ DLL).

copy "$(SolutionDir)\$(Configuration)\foobar.dll" "$(TargetDir)"
+3

:

<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, . , .

, , -. , . MSBuild , , . , F5 .

None Visible, . .

0
source

All Articles