Skip to content

Commit

Permalink
Merge pull request #298 from RevenantX/master
Browse files Browse the repository at this point in the history
Fix for - Lots of mscorlib issues with 3rd party packages #265
  • Loading branch information
nosami committed Sep 15, 2015
2 parents ceda8a9 + a7bebef commit 66f1ee1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/OmniSharp/MSBuild/MSBuildProjectSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,17 @@ public void Initalize()
continue;
}

var compilationOptions = new CSharpCompilationOptions(projectFileInfo.OutputKind);
#if DNX451
compilationOptions = compilationOptions.WithAssemblyIdentityComparer(DesktopAssemblyIdentityComparer.Default);
#endif
var projectInfo = ProjectInfo.Create(ProjectId.CreateNewId(projectFileInfo.Name),
VersionStamp.Create(),
projectFileInfo.Name,
projectFileInfo.AssemblyName,
LanguageNames.CSharp,
projectFileInfo.ProjectFilePath);
projectFileInfo.ProjectFilePath,
compilationOptions: compilationOptions);

_workspace.AddProject(projectInfo);

Expand Down
13 changes: 13 additions & 0 deletions src/OmniSharp/MSBuild/ProjectFile/ProjectFileInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public class ProjectFileInfo

public IList<string> DefineConstants { get; private set; }

public OutputKind OutputKind { get; private set; }

public static ProjectFileInfo Create(MSBuildOptions options, ILogger logger, string solutionDirectory, string projectFilePath, ICollection<MSBuildDiagnosticsMessage> diagnostics)
{
var projectFileInfo = new ProjectFileInfo();
Expand Down Expand Up @@ -90,6 +92,17 @@ public static ProjectFileInfo Create(MSBuildOptions options, ILogger logger, str
projectFileInfo.SpecifiedLanguageVersion = ToLanguageVersion(projectInstance.GetPropertyValue("LangVersion"));
projectFileInfo.ProjectId = new Guid(projectInstance.GetPropertyValue("ProjectGuid").TrimStart('{').TrimEnd('}'));
projectFileInfo.TargetPath = projectInstance.GetPropertyValue("TargetPath");
var outputType = projectInstance.GetPropertyValue("OutputType");
switch(outputType)
{
case "Library": projectFileInfo.OutputKind = OutputKind.DynamicallyLinkedLibrary;
break;
case "WinExe": projectFileInfo.OutputKind = OutputKind.WindowsApplication;
break;
default:
case "Exe": projectFileInfo.OutputKind = OutputKind.ConsoleApplication;
break;
}

projectFileInfo.SourceFiles =
projectInstance.GetItems("Compile")
Expand Down

0 comments on commit 66f1ee1

Please sign in to comment.