Skip to content

Instantly share code, notes, and snippets.

@PetSerAl

PetSerAl/Test.cs Secret

Last active October 19, 2018 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PetSerAl/53c469c4552370a9ca96db908295a805 to your computer and use it in GitHub Desktop.
Save PetSerAl/53c469c4552370a9ca96db908295a805 to your computer and use it in GitHub Desktop.
using System;
namespace Test {
class Program {
static void Main() {
Console.WriteLine("Hello World!");
#if NETFRAMEWORK
Console.WriteLine(".NET Framework");
Console.WriteLine((System.Numerics.Vector<byte>)new System.Numerics.Vector<int>(42));
#elif NETCOREAPP
Console.WriteLine(".NET Core");
Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(new { a = 1, b = 2 }));
#else
Console.WriteLine("Unknown");
#endif
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>Latest</LangVersion>
<OutputType>Exe</OutputType>
<TargetFrameworks>
netcoreapp2.1;
net472;
</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="$(Platform) == 'AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<ItemGroup Condition="$(TargetFramework) == 'netcoreapp2.1'">
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework) == 'net472'">
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
</ItemGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment