I'm a bit confused. I have the new version of Visual Studio 2017. And have converted my class projects (.net full 4.5) to the new .csproj project format. Then I tried to run live tests on those projects, but VS now informs me that live testing is not supported on .net core projects jet.
So:
Thanks
CSPROJ files define a project's content, platform requirements, versioning information, and web server or database server settings. They also list the files that are part of the project.
Each project SDK is a set of MSBuild targets and associated tasks that are responsible for compiling, packing, and publishing code. A project that references a project SDK is sometimes referred to as an SDK-style project.
What I often in Visual Studio 2017 RC3 to edit the csproj file, is: Right click on the project title in the Solution Explorer window. Select the option "Edit [project name]. csproj" to open the csproj file in the code editor window.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With