MsBuild & ProjectReference

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top