From 2bd7a978cf6d6bd51b77cc243202095a2a4752fb Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Mon, 8 Feb 2016 11:03:27 +0100 Subject: [PATCH] add --targetprofile:netcore if target framework is not desktop --- src/dotnet/commands/dotnet-compile-fsc/Program.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/dotnet/commands/dotnet-compile-fsc/Program.cs b/src/dotnet/commands/dotnet-compile-fsc/Program.cs index e22954eba..3d4bbe9c6 100644 --- a/src/dotnet/commands/dotnet-compile-fsc/Program.cs +++ b/src/dotnet/commands/dotnet-compile-fsc/Program.cs @@ -12,6 +12,7 @@ using System.Text; using Microsoft.DotNet.Cli.Compiler.Common; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.ProjectModel; +using NuGet.Frameworks; namespace Microsoft.DotNet.Tools.Compiler.Fsc { @@ -104,6 +105,13 @@ namespace Microsoft.DotNet.Tools.Compiler.Fsc allArgs.Add($"{outputName}"); } + //set target framework + var framework = new NuGetFramework(assemblyInfoOptions.TargetFramework); + if (!framework.IsDesktop()) + { + allArgs.Add("--targetprofile:netcore"); + } + foreach (var reference in references) { allArgs.Add("-r");