Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable support for Visual Studio 2022 #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,4 @@ UpgradeLog*.XML
# Mercurial
.hg

/src/packages
5 changes: 0 additions & 5 deletions Build/Common.Build.settings
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,12 @@
<TreatWarningsAsErrors Condition="'$(TreatWarningsAsErrors)' == ''">true</TreatWarningsAsErrors>

<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>

<DevEnvDir>$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\$(VisualStudioVersion)', 'InstallDir', null, RegistryView.Registry32))\</DevEnvDir>
<VSSDKDir>$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\VSIP\$(VisualStudioVersion)', 'InstallDir', null, RegistryView.Registry32))\</VSSDKDir>
</PropertyGroup>

<Import Project="$(BuildSettingsPath)Common.Build.CSharp.settings" Condition="'$(MSBuildProjectExtension)' == '.csproj'" />

<Target Name="PrintVariables">
<Message Importance="high" Text="BuildRoot = $(BuildRoot)"/>
<Message Importance="high" Text="TargetsPath = $(BuildSettingsPath)"/>
<Message Importance="high" Text="DevEnvDir = $(DevEnvDir)"/>
<Message Importance="high" Text="VSSDKDir = $(VSSDKDir)"/>
</Target>
</Project>
16 changes: 8 additions & 8 deletions src/Core/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,10 @@
<FileAlignment>512</FileAlignment>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>AnyCPU</PlatformTarget>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<ItemGroup>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="protobuf-net">
<HintPath>$(BuildRoot)src\packages\protobuf-net.2.0.0.640\lib\net40\protobuf-net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -328,7 +323,12 @@
<Compile Include="Win32\UnicodeString.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="NLog">
<Version>4.4.12</Version>
</PackageReference>
<PackageReference Include="protobuf-net">
<Version>2.0.0.640</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
4 changes: 0 additions & 4 deletions src/Core/Linq/EnumerableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,6 @@ public static IList<TSource> ToReadOnlyList<TSource>(this IEnumerable<TSource> s
return list;
}

public static HashSet<TSource> ToHashSet<TSource>(this IEnumerable<TSource> source) {
return new HashSet<TSource>(source);
}

private static class EmptyCollection<TSource> {
public static readonly ReadOnlyCollection<TSource> Instance = new ReadOnlyCollection<TSource>(new TSource[0]);
}
Expand Down
5 changes: 0 additions & 5 deletions src/Core/packages.config

This file was deleted.

30 changes: 18 additions & 12 deletions src/DkmIntegration/DkmIntegration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
<RootNamespace>VsChromium.DkmIntegration</RootNamespace>
<AssemblyName>VsChromium.DkmIntegration</AssemblyName>
<FileAlignment>512</FileAlignment>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property is unneeded in PackageReference world.

</NuGetPackageImportStamp>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Dia.Interop, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL" Condition="'$(VSTarget)' != '10.0'">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>Microsoft.Dia.Interop.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.Debugger.Engine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" Condition="'$(VSTarget)' != '10.0'">
<HintPath>$(VSSDKDir)\VisualStudioIntegration\Common\Assemblies\v4.0\Microsoft.VisualStudio.Debugger.Engine.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Debugger.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
Expand Down Expand Up @@ -80,9 +80,9 @@
<None Include="ServerComponent\ServerComponent.vsdconfigxml">
<SubType>Designer</SubType>
</None>
<VsdConfigXml Include="IdeComponent\IdeComponent.vsdconfigxml;ServerComponent\ServerComponent.vsdconfigxml">
<VsdConfigXmlFiles Include="IdeComponent\IdeComponent.vsdconfigxml;ServerComponent\ServerComponent.vsdconfigxml">
<Visible>false</Visible>
</VsdConfigXml>
</VsdConfigXmlFiles>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Core\Core.csproj">
Expand All @@ -93,10 +93,19 @@
<ItemGroup>
<Content Include="Microsoft.Dia.Interop.dll" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine">
<Version>16.4.1111102</Version>
</PackageReference>
<PackageReference Include="Microsoft.VSSDK.Debugger.VSDConfigTool">
<Version>16.4.1111102</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<!-- .vsdconfigxml -> .vsdconfig -->
<PropertyGroup>
<VsdConfigOutput>$(OutputPath)\VsChromium.vsdconfig</VsdConfigOutput>
<VsdConfigFile>$(OutputPath)\VsChromium.vsdconfig</VsdConfigFile>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand All @@ -106,10 +115,7 @@
<Target Name="AfterBuild">
</Target>
-->
<Target Name="GenerateVsdConfig" Inputs="@(VsdConfigXml)" Outputs="$(VsdConfigOutput)">
<Exec Command="&quot;$(VSSDKDir)VisualStudioIntegration\Tools\Bin\vsdconfigtool.exe&quot; @(VsdConfigXml, ' ') &quot;$(TargetPath)&quot; &quot;$(VsdConfigOutput)&quot;" />
</Target>
<Target Name="AfterBuild" DependsOnTargets="GenerateVsdConfig">
<Target Name="AfterBuild">
<Copy SourceFiles="@(NatVis)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="True" />
</Target>
</Project>
7 changes: 6 additions & 1 deletion src/Host/Host.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\ProjectBefore.settings"/>
<Import Project="..\ProjectBefore.settings" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -11,6 +11,8 @@
<AssemblyName>VsChromium.Host</AssemblyName>
<FileAlignment>512</FileAlignment>
<Prefer32Bit>true</Prefer32Bit>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand All @@ -27,6 +29,9 @@
<Name>VsChromium.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
3 changes: 3 additions & 0 deletions src/Host/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
4 changes: 2 additions & 2 deletions src/Native/Native.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
12 changes: 8 additions & 4 deletions src/Server/Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
<FileAlignment>512</FileAlignment>
<Prefer32Bit>false</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<ItemGroup>
<Reference Include="protobuf-net, Version=2.0.0.640, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
<HintPath>$(BuildRoot)src\packages\protobuf-net.2.0.0.640\lib\net40\protobuf-net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -183,6 +182,7 @@
<Compile Include="Server.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Configuration\ChromiumEnlistmentDetection.patterns">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand All @@ -202,7 +202,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Key.snk" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(BuildRoot)src\Core\Core.csproj">
Expand All @@ -214,6 +213,11 @@
<Name>VsChromium.Server.NativeInterop</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="protobuf-net">
<Version>2.0.0.640</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
3 changes: 3 additions & 0 deletions src/Server/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
4 changes: 0 additions & 4 deletions src/Server/packages.config

This file was deleted.

2 changes: 2 additions & 0 deletions src/ServerNativeInterop/ServerNativeInterop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<AssemblyName>VsChromium.Server.NativeInterop</AssemblyName>
<FileAlignment>512</FileAlignment>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
26 changes: 12 additions & 14 deletions src/Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,16 @@
<FileAlignment>512</FileAlignment>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SignAssembly>false</SignAssembly>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Text.Data, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="protobuf-net">
<HintPath>$(BuildRoot)src\packages\protobuf-net.2.0.0.640\lib\net40\protobuf-net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -80,10 +76,6 @@
<Project>{6F70C76F-5A3A-4657-A073-075A08555BAD}</Project>
<Name>VsChromium.Core</Name>
</ProjectReference>
<ProjectReference Include="$(BuildRoot)src\VsChromium\VsChromium.csproj">
<Project>{8ed06aa3-93df-48fe-97c0-f516e99fdb32}</Project>
<Name>VsChromium</Name>
</ProjectReference>
<ProjectReference Include="$(BuildRoot)src\ServerNativeInterop\ServerNativeInterop.csproj">
<Project>{a38dc74b-820c-49a5-a732-23170d953632}</Project>
<Name>VsChromium.Server.NativeInterop</Name>
Expand All @@ -92,9 +84,10 @@
<Project>{F33514B3-E491-4599-AF71-EABCDD70234F}</Project>
<Name>Server</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<ProjectReference Include="..\VsChromium17\VsChromium17.csproj">
<Project>{1eab343d-2ba1-4fd0-b34a-2b3fa0b53542}</Project>
<Name>VsChromium17</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="TestData\chromium\src\base\file_present_three_times.txt" />
Expand All @@ -110,6 +103,11 @@
<Content Include="TestData\chromium\src\test_directory\marker.txt" />
<Content Include="TestData\files\bear.ac3" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="protobuf-net">
<Version>2.0.0.640</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
37 changes: 34 additions & 3 deletions src/Tests/VsChromium/ToolsOptions/TestGlobalSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections.Concurrent;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.Threading;
using VsChromium.Package;
using VsChromium.Settings;
using VsChromium.Threads;
Expand Down Expand Up @@ -36,14 +37,44 @@ public void CheckClassHasNotBeenRenamed() {
Assert.AreEqual("VsChromium.ToolsOptions.DebuggingOptions", typeof(DebuggingOptions).FullName);
}

public class ToolsOptionsPageProviderMock : IToolsOptionsPageProvider {
private class CodingStyleOptionsMock : CodingStyleOptions {
[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "VSSDK005:Avoid instantiating JoinableTaskContext", Justification = "Necessary for tests.")]
public CodingStyleOptionsMock() : base(new JoinableTaskContext()) {
}

public override void SaveSettingsToStorage() {
}
}

private class GeneralOptionsMock : GeneralOptions {
[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "VSSDK005:Avoid instantiating JoinableTaskContext", Justification = "Necessary for tests.")]
public GeneralOptionsMock() : base(new JoinableTaskContext()) {
}

public override void SaveSettingsToStorage() {
}
}

private class ToolsOptionsPageProviderMock : IToolsOptionsPageProvider {
private readonly ConcurrentDictionary<Type, object> _objects = new ConcurrentDictionary<Type, object>();
public T GetToolsOptionsPage<T>() where T : DialogPage, new() {
return (T)_objects.GetOrAdd(typeof (T), key => new T());
return (T)_objects.GetOrAdd(typeof(T), key => this.CreateInstance<T>());
}

object CreateInstance<T>() where T : new() {
switch (typeof(T))
{
case var t when t == typeof(CodingStyleOptions):
return new CodingStyleOptionsMock();
case var t when t == typeof(GeneralOptions):
return new GeneralOptionsMock();
default:
return new T();
}
}
}

public class MyProvider : ISynchronizationContextProvider {
private class MyProvider : ISynchronizationContextProvider {
public ISynchronizationContext DispatchThreadContext {
get {
return new MyContext();
Expand Down
4 changes: 0 additions & 4 deletions src/Tests/packages.config

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:platformUi="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
xmlns:platformUi="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
xmlns:indexServerInfo="clr-namespace:VsChromium.Features.IndexServerInfo"
Title="VsChromium Directory Index Details"
ResizeMode="CanResizeWithGrip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:platformUi="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
xmlns:platformUi="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
xmlns:indexServerInfo="clr-namespace:VsChromium.Features.IndexServerInfo"
xmlns:typedMessages="clr-namespace:VsChromium.Core.Ipc.TypedMessages;assembly=VsChromium.Core"
Title="VsChromium Project Configuration Details"
Expand Down
Loading