Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Fix globalisation issues with ProjectBuilder2017
Browse files Browse the repository at this point in the history
  • Loading branch information
conniey committed Jan 31, 2018
1 parent 30fbba1 commit d0a5683
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using ApiPortVS.Common;
using ApiPortVS.Contracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EnvDTE;
using Microsoft.VisualStudio.Shell.Interop;
using System.Threading;
using ApiPortVS.Common;
using System.Diagnostics;
using Microsoft.VisualStudio.ProjectSystem;
using Microsoft.VisualStudio.ProjectSystem.Build;
using Microsoft.VisualStudio.ProjectSystem.Properties;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;
using System;
using System.Collections.Concurrent;
using Microsoft.VisualStudio.ProjectSystem.Build;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using static Microsoft.Fx.Portability.Utils.FormattableStringHelper;

namespace ApiPortVS.VS2017
{
public class ProjectBuilder2015 : DefaultProjectBuilder
public class ProjectBuilder2017 : DefaultProjectBuilder
{
public ProjectBuilder2015(
public ProjectBuilder2017(
IVsSolutionBuildManager2 buildManager,
IVSThreadingService threadingService,
IProjectMapper projectMapper)
Expand All @@ -36,7 +35,7 @@ public ProjectBuilder2015(
/// https://github.com/Microsoft/visualfsharp/blob/master/vsintegration/tests/unittests/Tests.ProjectSystem.Miscellaneous.fs#L168-L182
/// </summary>
/// <returns>null if it is unable to retrieve VS configuration objects</returns>
public override async Task<IEnumerable<string>> GetBuildOutputFilesAsync(Project project, CancellationToken cancellationToken = default(CancellationToken))
public override async Task<IEnumerable<string>> GetBuildOutputFilesAsync(Project project, CancellationToken cancellationToken = default)
{
if (project == null)
{
Expand All @@ -61,7 +60,7 @@ public ProjectBuilder2015(
/// project is not a CPS project.</returns>
private async Task<IEnumerable<string>> GetBuildOutputFilesFromCPSAsync(
Project project,
CancellationToken cancellationToken = default(CancellationToken))
CancellationToken cancellationToken = default)
{
if (project == null)
{
Expand All @@ -72,7 +71,7 @@ private async Task<IEnumerable<string>> GetBuildOutputFilesFromCPSAsync(

if (hierarchy == null)
{
Trace.TraceWarning($"Unable to locate {nameof(IVsHierarchy)} for {project.Name}");
Trace.TraceWarning(ToCurrentCulture($"Unable to locate {nameof(IVsHierarchy)} for {project.Name}"));
return null;
}

Expand Down Expand Up @@ -110,7 +109,7 @@ private async Task<IEnumerable<string>> GetBuildOutputFilesFromCPSAsync(
}
catch (Exception e)
{
Trace.TraceError($"Could not fetch key output from project configuration {proj.ProjectConfiguration.Name}. Exception: {e}", e);
Trace.TraceError(ToCurrentCulture($"Could not fetch key output from project configuration {proj.ProjectConfiguration.Name}. Exception: {e}"), e);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ApiPort.VisualStudio.2017/ServiceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected override void Load(ContainerBuilder builder)
builder.RegisterType<VSThreadingService>()
.As<IVSThreadingService>()
.SingleInstance();
builder.RegisterType<ProjectBuilder2015>()
builder.RegisterType<ProjectBuilder2017>()
.As<IProjectBuilder>()
.SingleInstance();
}
Expand Down

0 comments on commit d0a5683

Please sign in to comment.