"The target "VerifyAlteredTargetsUsed" does not exist in the project" Error

259 views Asked by At

When I'm using msbuild tried to build a brand new repo (based on msbuild with .net 472) I got this weird error: build error

The interesting thing is that in each separate project I can build correctly. But when I use a dirs.proj and try to build both projects I got this issue. Here is the dirs.proj I'm using: dirs.proj file

Does any one know why this "VerifyAlteredTargetsUsed" does not exist issue happen and how to resolve it?

1

There are 1 answers

0
Jingmiao Xu-MSFT On

You can try this code:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <ItemGroup>
        <ProjectReference  Include="######\######.csproj" />
        <ProjectReference  Include="######\####.sfproj" />
    </ItemGroup>
    <Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" />
    <PropertyGroup>
        <BuildDependsOn>ResolveReferences</BuildDependsOn>
    </PropertyGroup>
</Project>

It works in my test.