Skip to content

Commit 3569e02

Browse files
Remove dependencies including build locator - theoretically this is auto-handled now
1 parent 614d868 commit 3569e02

6 files changed

Lines changed: 3 additions & 33 deletions

File tree

CodeConverter/Common/DefaultReferences.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static class DefaultReferences
3030
typeof(System.Xml.Linq.XElement),
3131
typeof(System.Linq.Expressions.Expression),
3232
typeof(Microsoft.VisualBasic.Constants),
33-
typeof(System.Data.SqlClient.SqlCommand)
33+
typeof(System.Data.Common.DbCommand)
3434
}.Select(t => t.Assembly).Concat(
3535
new[] { Assembly.Load("System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") }
3636
).ToArray();

CommandLine/CodeConv.NetFramework/CodeConv.NetFramework.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
14-
<PackageReference Include="Microsoft.Build.Locator" Version="1.2.6" />
1514
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.1.0" />
1615
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.1.0" />
1716
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.1.0" />

CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
using ICSharpCode.CodeConverter.Util;
1515
using ICSharpCode.CodeConverter.VB;
1616
using McMaster.Extensions.CommandLineUtils;
17-
using Microsoft.Build.Locator;
1817
using Microsoft.CodeAnalysis;
1918
using Microsoft.CodeAnalysis.Host.Mef;
2019
using Microsoft.CodeAnalysis.MSBuild;
@@ -30,7 +29,6 @@ public sealed class MSBuildWorkspaceConverter : IDisposable
3029
private readonly AsyncLazy<MSBuildWorkspace> _workspace; //Cached to avoid NullRef from OptionsService when initialized concurrently (e.g. in our tests)
3130
private AsyncLazy<Solution>? _cachedSolution; //Cached for performance of tests
3231
private readonly bool _isNetCore;
33-
private Version? _versionUsed;
3432

3533
public MSBuildWorkspaceConverter(string solutionFilePath, bool isNetCore, JoinableTaskFactory joinableTaskFactory, bool bestEffortConversion = false, Dictionary<string, string>? buildProps = null)
3634
{
@@ -95,8 +93,7 @@ private async Task<Solution> GetSolutionAsync(string projectOrSolutionFile, IPro
9593
return solution;
9694

9795
ValidationException CreateException(string mainMessage, string fullDetail) {
98-
var versionUsedString = _versionUsed != null ? $"Used MSBuild {_versionUsed}.{Environment.NewLine}" : "";
99-
return new ValidationException($"{mainMessage}:{Environment.NewLine}{versionUsedString}{fullDetail}{Environment.NewLine}{mainMessage}");
96+
return new ValidationException($"{mainMessage}:{Environment.NewLine}{fullDetail}{Environment.NewLine}{mainMessage}");
10097
}
10198
}
10299

@@ -120,15 +117,6 @@ private static async Task RestorePackagesForSolutionAsync(string solutionFile)
120117

121118
private async Task<MSBuildWorkspace> CreateWorkspaceAsync(Dictionary<string, string> buildProps)
122119
{
123-
if (MSBuildLocator.CanRegister) {
124-
var instances = MSBuildLocator.QueryVisualStudioInstances().ToArray();
125-
var instance = instances.OrderByDescending(x => x.Version).FirstOrDefault()
126-
?? throw new ValidationException("No Visual Studio instance available");
127-
MSBuildLocator.RegisterInstance(instance);
128-
_versionUsed = instance.Version;
129-
AppDomain.CurrentDomain.UseVersionAgnosticAssemblyResolution();
130-
}
131-
132120
var hostServices = await ThreadSafeWorkspaceHelper.CreateHostServicesAsync(MSBuildMefHostServices.DefaultAssemblies);
133121
return MSBuildWorkspace.Create(buildProps, hostServices);
134122
}

CommandLine/CodeConv/CodeConv.csproj

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,13 @@
3333

3434
<ItemGroup>
3535
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />
36-
<PackageReference Include="Microsoft.Build.Locator" Version="1.4.1" />
3736
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" />
3837
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.14.0" />
3938
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.14.0" />
4039
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
4140
<PrivateAssets>all</PrivateAssets>
4241
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
4342
</PackageReference>
44-
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="16.10.56" />
45-
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
46-
<PackageReference Include="NuGet.Build.Tasks" Version="6.11.0" />
47-
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
48-
<PackageReference Include="System.Formats.Asn1" Version="8.0.1" />
49-
<PackageReference Include="System.Memory" Version="4.5.5" />
50-
<PackageReference Include="System.Net.Http" Version="4.3.4" />
51-
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
5243

5344
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.0.1" />
5445
</ItemGroup>

Func/Func.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
2424
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
2525
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.3.2" />
26-
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.0" />
26+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.0" />
2727
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0" />
2828
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.4.0" />
2929
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

Tests/Tests.csproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@
3232
<EmbeddedResource Remove="TestData\**" />
3333
<None Include="TestData\**\*.*" />
3434
</ItemGroup>
35-
<!--<ItemGroup Label="ReSharper test runner requirements - test against latest Visual Studio version">
36-
<PackageReference Include="Microsoft.CodeAnalysis.Features" Version="4.1.0" />
37-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.1.0" />
38-
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.1.0" />
39-
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.1.0" />
40-
<PackageReference Include="Microsoft.Build" Version="17.4.0" />
41-
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="17.4.0" />
42-
</ItemGroup>-->
4335
<ItemGroup>
4436
<ProjectReference Include="..\CommandLine\CodeConv\CodeConv.csproj" />
4537
</ItemGroup>

0 commit comments

Comments
 (0)