How to add a linked file to a csproj file with MSBuild. (3.5 Framework)

Realogrish

New Member
I'm trying to us MSBuild to add a linked file to my \[code\].csproj\[/code\] file.This is .Net Framework 3.5 (and not 4.0). I mention that because I'm seen some 4.0 specific stuff trying to manipulate the XML.Here is what I'm starting with:\[code\]<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Core"> <RequiredTargetFramework>3.5</RequiredTargetFramework> </Reference> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="MySuperCoolClass.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /></Project>\[/code\]This is what I'm trying to get:\[code\] <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Core"> <RequiredTargetFramework>3.5</RequiredTargetFramework> </Reference> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="MySuperCoolClass.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> <Content Include="..\..\SomeFunFolder\MyLinkFile.ext"> <Link>MyLinkFile.ext</Link> </Content> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> </Project> \[/code\]I have:
  • \[code\]MSBuild.Community.Tasks.dll\[/code\]
and
  • \[code\]MSBuild.ExtensionPack.dll\[/code\]
available.Any concrete help?One liner comments like use 'MSBuild.ExtensionPack.Xml.XmlFile' won't be helpful.But I appreciate any pointers or coded examples immensely.
 
Back
Top