Update RoslynLocalizeDetector
This commit is contained in:
parent
aa9b6cc3c6
commit
4f96d9aa7d
2 changed files with 11 additions and 20 deletions
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Collections.Immutable;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Microsoft.Build.Locator;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
using Microsoft.CodeAnalysis.MSBuild;
|
||||
|
|
@ -14,25 +15,15 @@ namespace RoslynLocalizeDetector
|
|||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
// ** Only works if run from VSDev Command prompt **
|
||||
//
|
||||
//var instances = MSBuildLocator.QueryVisualStudioInstances().ToList();
|
||||
//var instanceToUse = instances.First(a => a.Version.Major == 15);
|
||||
//Environment.SetEnvironmentVariable("VSINSTALLDIR", instanceToUse.VisualStudioRootPath);
|
||||
|
||||
Environment.SetEnvironmentVariable("VSINSTALLDIR", @"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community");
|
||||
Environment.SetEnvironmentVariable("VisualStudioVersion", "15.0");
|
||||
MSBuildLocator.RegisterDefaults();
|
||||
|
||||
string matterControlRoot = GetMatterControlDirectory();
|
||||
|
||||
var properties = new Dictionary<string, string>
|
||||
var workspace = MSBuildWorkspace.Create(new Dictionary<string, string>
|
||||
{
|
||||
{ "Configuration", "Debug" },
|
||||
{"Platform", "AnyCPU" }
|
||||
};
|
||||
//var workspace = MSBuildWorkspace.Create(properties);
|
||||
var workspace = MSBuildWorkspace.Create();
|
||||
|
||||
["Configuration"] = "Debug",
|
||||
["Platform"] = "AnyCPU"
|
||||
});
|
||||
workspace.WorkspaceFailed += (s, e) => Console.WriteLine(e.Diagnostic.Message);
|
||||
workspace.LoadMetadataForReferencedProjects = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net471</TargetFramework>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<AssemblyName>RoslynLocalizeDetector</AssemblyName>
|
||||
<RootNamespace>RoslynLocalizeDetector</RootNamespace>
|
||||
<StartupObject></StartupObject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Build" Version="15.9.20" />
|
||||
<PackageReference Include="Microsoft.Build.MSBuildLocator" Version="1.0.1-preview-g6cd9a57801" />
|
||||
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="15.9.20" />
|
||||
<PackageReference Include="Microsoft.Build" Version="15.9.20" ExcludeAssets="runtime" />
|
||||
<PackageReference Include="Microsoft.Build.Locator" Version="1.2.2" />
|
||||
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.1.76" ExcludeAssets="runtime" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.8.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue