22 Jun 2011

.NET Project File - Include External CommonAssemblyInfo file

I wanted to register a common AssemblyInfo.cs file in the Properties folder of my project. This file is actually external to my project, so how to do it?

Add this to your csproj file in the <ItemGroup> section with the Compile elements.

<Compile Include="..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>

Then just strip out the [assembly: Whatever()] bits from the original AssemblyInfo.cs file and put them in the CommonAssemblyInfo.cs file.

No comments:

Post a Comment

Comments are very welcome but are moderated to prevent spam.

If I helped you out today, you can buy me a beer below. Cheers!