Skip to content

Commit

Permalink
Merge pull request #166 from qinzhen353/users/qinzhen/fix-dot-net
Browse files Browse the repository at this point in the history
A better way to check the framework name.
  • Loading branch information
arunkm authored Nov 15, 2022
2 parents d2097ef + d41bb21 commit faf85de
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ namespace Microsoft.StreamProcessing
{
internal static class Transformer
{
private static readonly bool IsNetCore = RuntimeInformation.FrameworkDescription.Contains(".NET Core") ||
RuntimeInformation.FrameworkDescription.Contains(".NET 5") || RuntimeInformation.FrameworkDescription.Contains(".NET 6");
// For .Net Framework, the framework name is like ".NET Framework 4.x.x.x", and uses Net Framework Assembly
// For .Net Core and .Net, the framework name is like ".NET Core 3.x.x" or ".NET 5.x.x", and use Net Core Assembly
private static readonly bool IsNetCore = !RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework");

private static readonly Lazy<IEnumerable<MetadataReference>> baseAssemblyReferences
= new Lazy<IEnumerable<MetadataReference>>(() => IsNetCore ? GetNetCoreAssemblyReferences() : GetNetFrameworkAssemblyReferences());
Expand Down

0 comments on commit faf85de

Please sign in to comment.