MsBuild & ProjectReference

  • Thread starter Thread starter jomu
  • Start date Start date
J

jomu

how can i create a golabel file who can execute a .csproj at different
project,

that what i was doing:

<ItemGroup>
<ProjectReference
Include="..\DataAccessLayer\DataAccessLayer1.csproj" />
<ProjectReference Include=".\BusinessLayer\BusinessLayer1.csproj"
/>
<ProjectReference Include="..\GUILayer\GUILayer1.csproj" />
<ProjectReference
Include="..\SecurityProject\SecurityProject1.csproj" />
</ItemGroup>

<Target Name="BuildProjectReferences">
<MSBuild
Projects="@(ProjectReferences)"
Targets="Build">
</MSBuild>
</Target>

<Target Name="clean">
<RemoveDir
Directories="$(OutputPath)" />
<Target Name="build" DependsOnTargets="BuildProjectReferences">
<MakeDir Directories="$(OutputPath)" />
</Target>

</Target>



but it not compile,just delete and cretae a directory, and i dont have
any errors!


thks for help in advance
 
I don't think you want to use projectreference for this, msbuild treats those
items specially, instead have your item group use
<ItemGroup>
<ProjFile
Include="..\DataAccessLayer\DataAccessLayer1.csproj" />
<ProjFile Include=".\BusinessLayer\BusinessLayer1.csproj"
/>
<ProjFile Include="..\GUILayer\GUILayer1.csproj" />
<ProjFile
Include="..\SecurityProject\SecurityProject1.csproj" />
</ItemGroup>

and maybe include a Message task in your step to print out the value of
@(ProjFile) so you can make sure that your paths are correct.
 
Back
Top