mrzli
mrzli

Reputation: 17359

Visual Studio project linking files

I have two Visual Studio projects. One targets .NET 4.0, the other one .NET 3.5. They should have the same source.

I don't want to make a copy of the source code because I would have to keep them manually synchronized. I would also like to avoid linking files one by one because I would also need to do some upkeep when adding/removing files.

So, I am using the method described here to add all the files. The problem is that it also adds AssmblyInfo.cs. Is there a way link all source files from another project except one?

Upvotes: 1

Views: 83

Answers (1)

CodeCaster
CodeCaster

Reputation: 151588

Using Exclude.:

<ItemGroup>
  <Compile Include="..\Foo\**\*.cs" Exclude="..\Foo\**\AssemblyInfo.cs" />
</ItemGroup>

Upvotes: 2

Related Questions