MSBuild: How to always include a file (Import Project)?

637 views Asked by At

I have a file: CoreAssemblyInfo.cs that I want to show up in my projects under the properties folder...

I realize that I can add the existing file as a link, but I was hoping to use MSBuild somehow to have all my "core" stuff. I tried doing the following:

 <Import Project="Core.csproj" />

Core.csproj:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <Compile Include="Properties\CoreAssemblyInfo.cs" />
  </ItemGroup>
</Project>

But it doesn't show up in the project... is what I'm looking for even possible?

1

There are 1 answers

3
sll On

Try out:

<ItemGroup> 
    <Compile Include="RealLocationFolder\Properties\CoreAssemblyInfo.cs">
        <Link>Properties\CoreAssemblyInfo.cs</Link>
    </Compile>
</ItemGroup>