add --targetprofile:netcore if target framework is not desktop

This commit is contained in:
Enrico Sada 2016-02-08 11:03:27 +01:00
parent d67a0cd9bb
commit 2bd7a978cf

View file

@ -12,6 +12,7 @@ using System.Text;
using Microsoft.DotNet.Cli.Compiler.Common; using Microsoft.DotNet.Cli.Compiler.Common;
using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.ProjectModel; using Microsoft.DotNet.ProjectModel;
using NuGet.Frameworks;
namespace Microsoft.DotNet.Tools.Compiler.Fsc namespace Microsoft.DotNet.Tools.Compiler.Fsc
{ {
@ -104,6 +105,13 @@ namespace Microsoft.DotNet.Tools.Compiler.Fsc
allArgs.Add($"{outputName}"); allArgs.Add($"{outputName}");
} }
//set target framework
var framework = new NuGetFramework(assemblyInfoOptions.TargetFramework);
if (!framework.IsDesktop())
{
allArgs.Add("--targetprofile:netcore");
}
foreach (var reference in references) foreach (var reference in references)
{ {
allArgs.Add("-r"); allArgs.Add("-r");