align code in dotnet-run (#2679)

we used to use different code when --framework was specified than when it was not specified, this synchronizes them to use the same code path which removes a hidden NullRef

also adds tests to cover both cases
This commit is contained in:
Andrew Stanton-Nurse 2016-04-25 13:53:02 -07:00
parent 06f57c5c81
commit a729b97b35
5 changed files with 44 additions and 78 deletions

View file

@ -220,7 +220,8 @@ namespace Microsoft.DotNet.Tools.Compiler.Tests
}
var workspace = WorkspaceContext.Create(ProjectReaderSettings.ReadFromEnvironment(), designTime: false);
var context = workspace.GetProjectContext(projectJson, TestAssetFramework, rids);
var context = workspace.GetRuntimeContext(workspace.GetProjectContext(projectJson, TestAssetFramework), rids);
context = workspace.GetRuntimeContext(context, rids);
managedCompiler.Compile(context, _args);
RuntimeOutputDir = Path.Combine(OutputPath, rid);