I like the new format for .net 4.0 projects, it's way easier not having to worry about including files to your project also having less files to deal with nuget is nice as well.
You can start out with a csproj
as simple as this
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net40</TargetFramework>
</PropertyGroup>
</Project>
And then use visual studio to add back in your dependencies, move the meta data to the packages tab and remove AssemblyInfo.cs
, and then customize anything you had custom (hint sometimes excluding and re-including files can help to get the default behavior if you have something strange e.g. T4 templates). It will be a much cleaner file and way easier to update to .netstandard in the future (or even multitarget).
Here is an example of an opensource project of mine using multi-target and some T4 templates this is the full file and there are like 40 C# files automatically included in the project because they are in the directory:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.5;net40</TargetFrameworks>
<Description>(pronounced dyna-mighty) flexes DLR muscle to do meta-mazing things in .net</Description>
<Company>Ekon Benefits</Company>
<Authors/>
<Copyright>Copyright 2017 Ekon Benefits</Copyright>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
<FileVersion>1.5.0.0</FileVersion>
<PackageProjectUrl>https://github.com/ekonbenefits/dynamitey</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
<PackageTags>dynamic metaprogramming dlr reflection currying tuples expando latetypes</PackageTags>
<IncludeSymbols>True</IncludeSymbols>
<IncludeSource>True</IncludeSource>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
<DelaySign>False</DelaySign>
<Version>1.5.0</Version>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)'!='net40'">
<PackageReference Include="Microsoft.CSharp" Version="4.3.0"/>
<PackageReference Include="System.ComponentModel" Version="4.3.0"/>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net40'">
<Reference Include="Microsoft.CSharp"/>
</ItemGroup>
<ItemGroup>
<None Update="InlineLambdas.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>InlineLambdas.cs</LastGenOutput>
</None>
<None Update="ThisFunctions.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>ThisFunctions.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Compile Update="InlineLambdas.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>InlineLambdas.tt</DependentUpon>
</Compile>
<Compile Update="ThisFunctions.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>ThisFunctions.tt</DependentUpon>
</Compile>
</ItemGroup>
</Project>