Skip to content

Commit 2f64225

Browse files
committed
Add VS2022 VSIX project
This enables building for 2022+ and 2017-2019 separately. Microsoft's guidance is that eventually we will be able to publish multiple VSIXes to the VS marketplace for people to download version-dependent packages, but currently that's not available. https://docs.microsoft.com/en-us/visualstudio/extensibility/migration/update-visual-studio-extension?view=vs-2022#publish-your-extension
1 parent 5b9a094 commit 2f64225

8 files changed

Lines changed: 275 additions & 3 deletions

File tree

File renamed without changes.

Dev17/Dev17+.csproj

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
8+
<PropertyGroup>
9+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
10+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
11+
<SchemaVersion>2.0</SchemaVersion>
12+
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
13+
<ProjectGuid>{44C3FFA0-A263-4C23-9E6A-ACE9C1EF8A31}</ProjectGuid>
14+
<OutputType>Library</OutputType>
15+
<AppDesignerFolder>Properties</AppDesignerFolder>
16+
<RootNamespace>Dev17</RootNamespace>
17+
<AssemblyName>Dev17</AssemblyName>
18+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
19+
<GeneratePkgDefFile>true</GeneratePkgDefFile>
20+
<UseCodebase>true</UseCodebase>
21+
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
22+
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
23+
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
24+
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
25+
<CopyOutputSymbolsToOutputDirectory>true</CopyOutputSymbolsToOutputDirectory>
26+
<StartAction>Program</StartAction>
27+
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
28+
<StartArguments>/rootsuffix Exp</StartArguments>
29+
</PropertyGroup>
30+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
31+
<DebugSymbols>true</DebugSymbols>
32+
<DebugType>full</DebugType>
33+
<Optimize>false</Optimize>
34+
<OutputPath>bin\Debug\</OutputPath>
35+
<DefineConstants>TRACE;DEBUG;Dev17</DefineConstants>
36+
<ErrorReport>prompt</ErrorReport>
37+
<WarningLevel>4</WarningLevel>
38+
</PropertyGroup>
39+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
40+
<DebugType>pdbonly</DebugType>
41+
<Optimize>true</Optimize>
42+
<OutputPath>bin\Release\</OutputPath>
43+
<DefineConstants>TRACE</DefineConstants>
44+
<ErrorReport>prompt</ErrorReport>
45+
<WarningLevel>4</WarningLevel>
46+
</PropertyGroup>
47+
<ItemGroup>
48+
<Compile Include="Properties\AssemblyInfo.cs" />
49+
<Compile Include="Properties\Settings.Designer.cs" />
50+
</ItemGroup>
51+
<ItemGroup>
52+
<None Include="Properties\Settings.settings" />
53+
<None Include="source.extension.vsixmanifest">
54+
<SubType>Designer</SubType>
55+
</None>
56+
</ItemGroup>
57+
<ItemGroup>
58+
<Reference Include="Microsoft.CSharp" />
59+
<Reference Include="PresentationCore" />
60+
<Reference Include="PresentationFramework" />
61+
<Reference Include="System" />
62+
<Reference Include="System.Design" />
63+
<Reference Include="System.Drawing" />
64+
<Reference Include="System.Transactions" />
65+
<Reference Include="System.Windows.Forms" />
66+
<Reference Include="System.Xaml" />
67+
<Reference Include="System.Xml" />
68+
<Reference Include="System.Xml.Linq" />
69+
<Reference Include="UIAutomationTypes" />
70+
<Reference Include="WindowsBase" />
71+
</ItemGroup>
72+
<ItemGroup>
73+
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.0.0-previews-3-31605-261" ExcludeAssets="runtime" />
74+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.0.4207-preview4" />
75+
</ItemGroup>
76+
<Import Project="..\OpenFileInSolutionShared\OpenFileInSolutionShared.projitems" Label="Shared" />
77+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
78+
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
79+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
80+
Other similar extension points exist, see Microsoft.Common.targets.
81+
<Target Name="BeforeBuild">
82+
</Target>
83+
<Target Name="AfterBuild">
84+
</Target>
85+
-->
86+
</Project>

Dev17/Properties/AssemblyInfo.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.Reflection;
3+
using System.Resources;
4+
using System.Runtime.CompilerServices;
5+
using System.Runtime.InteropServices;
6+
7+
// General Information about an assembly is controlled through the following
8+
// set of attributes. Change these attribute values to modify the information
9+
// associated with an assembly.
10+
[assembly: AssemblyTitle("OpenFileInSolution")]
11+
[assembly: AssemblyDescription("")]
12+
[assembly: AssemblyConfiguration("")]
13+
[assembly: AssemblyCompany("Pernicious Games")]
14+
[assembly: AssemblyProduct("OpenFileInSolution")]
15+
[assembly: AssemblyCopyright("")]
16+
[assembly: AssemblyTrademark("")]
17+
[assembly: AssemblyCulture("")]
18+
[assembly: ComVisible(false)]
19+
[assembly: CLSCompliant(false)]
20+
[assembly: NeutralResourcesLanguage("en-US")]
21+
22+
// Version information for an assembly consists of the following four values:
23+
//
24+
// Major Version
25+
// Minor Version
26+
// Build Number
27+
// Revision
28+
//
29+
// You can specify all the values or you can default the Revision and Build Numbers
30+
// by using the '*' as shown below:
31+
32+
[assembly: AssemblyVersion("1.15.3.0")]
33+
[assembly: AssemblyFileVersion("1.15.3.0")]
34+
35+
36+

Dev17/Properties/Settings.Designer.cs

Lines changed: 86 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dev17/Properties/Settings.settings

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="PerniciousGames.OpenFileInSolution.Properties" GeneratedClassName="Settings">
3+
<Profiles />
4+
<Settings>
5+
<Setting Name="Height" Type="System.Double" Scope="User">
6+
<Value Profile="(Default)">300</Value>
7+
</Setting>
8+
<Setting Name="Width" Type="System.Double" Scope="User">
9+
<Value Profile="(Default)">675</Value>
10+
</Setting>
11+
<Setting Name="Left" Type="System.Double" Scope="User">
12+
<Value Profile="(Default)">0</Value>
13+
</Setting>
14+
<Setting Name="Top" Type="System.Double" Scope="User">
15+
<Value Profile="(Default)">0</Value>
16+
</Setting>
17+
<Setting Name="WindowState" Type="System.Int32" Scope="User">
18+
<Value Profile="(Default)">0</Value>
19+
</Setting>
20+
</Settings>
21+
</SettingsFile>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
3+
<Metadata>
4+
<Identity Id="Dev17.fe76fd33-c38d-4ead-be65-75c060862f5b" Version="1.0" Language="en-US" Publisher="Chris Pickett" />
5+
<DisplayName>Dev17</DisplayName>
6+
<Description>Empty VSIX Project.</Description>
7+
</Metadata>
8+
<Installation>
9+
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0, 18.0)">
10+
<ProductArchitecture>amd64</ProductArchitecture>
11+
</InstallationTarget>
12+
</Installation>
13+
<Dependencies>
14+
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
15+
</Dependencies>
16+
<Prerequisites>
17+
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[17.0,18.0)" DisplayName="Visual Studio core editor" />
18+
</Prerequisites>
19+
<Assets>
20+
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
21+
</Assets>
22+
</PackageManifest>

OpenFileInSolution.sln

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,43 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.31515.178
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31717.71
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenFileInSolution", "OpenFileInSolution.csproj", "{89FE4454-2478-4AD2-BA39-263D5EC38B77}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dev16-", "Dev16-.csproj", "{89FE4454-2478-4AD2-BA39-263D5EC38B77}"
77
EndProject
88
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "OpenFileInSolutionShared", "OpenFileInSolutionShared\OpenFileInSolutionShared.shproj", "{B62F2E7D-CF85-40DF-920F-97208FADC4F6}"
99
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dev17+", "Dev17\Dev17+.csproj", "{44C3FFA0-A263-4C23-9E6A-ACE9C1EF8A31}"
11+
EndProject
1012
Global
1113
GlobalSection(SharedMSBuildProjectFiles) = preSolution
14+
OpenFileInSolutionShared\OpenFileInSolutionShared.projitems*{44c3ffa0-a263-4c23-9e6a-ace9c1ef8a31}*SharedItemsImports = 4
1215
OpenFileInSolutionShared\OpenFileInSolutionShared.projitems*{89fe4454-2478-4ad2-ba39-263d5ec38b77}*SharedItemsImports = 4
1316
OpenFileInSolutionShared\OpenFileInSolutionShared.projitems*{b62f2e7d-cf85-40df-920f-97208fadc4f6}*SharedItemsImports = 13
1417
EndGlobalSection
1518
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1619
Debug|Any CPU = Debug|Any CPU
20+
Debug|x86 = Debug|x86
1721
Release|Any CPU = Release|Any CPU
22+
Release|x86 = Release|x86
1823
EndGlobalSection
1924
GlobalSection(ProjectConfigurationPlatforms) = postSolution
2025
{89FE4454-2478-4AD2-BA39-263D5EC38B77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2126
{89FE4454-2478-4AD2-BA39-263D5EC38B77}.Debug|Any CPU.Build.0 = Debug|Any CPU
27+
{89FE4454-2478-4AD2-BA39-263D5EC38B77}.Debug|x86.ActiveCfg = Debug|Any CPU
28+
{89FE4454-2478-4AD2-BA39-263D5EC38B77}.Debug|x86.Build.0 = Debug|Any CPU
2229
{89FE4454-2478-4AD2-BA39-263D5EC38B77}.Release|Any CPU.ActiveCfg = Release|Any CPU
2330
{89FE4454-2478-4AD2-BA39-263D5EC38B77}.Release|Any CPU.Build.0 = Release|Any CPU
31+
{89FE4454-2478-4AD2-BA39-263D5EC38B77}.Release|x86.ActiveCfg = Release|Any CPU
32+
{89FE4454-2478-4AD2-BA39-263D5EC38B77}.Release|x86.Build.0 = Release|Any CPU
33+
{44C3FFA0-A263-4C23-9E6A-ACE9C1EF8A31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34+
{44C3FFA0-A263-4C23-9E6A-ACE9C1EF8A31}.Debug|Any CPU.Build.0 = Debug|Any CPU
35+
{44C3FFA0-A263-4C23-9E6A-ACE9C1EF8A31}.Debug|x86.ActiveCfg = Debug|x86
36+
{44C3FFA0-A263-4C23-9E6A-ACE9C1EF8A31}.Debug|x86.Build.0 = Debug|x86
37+
{44C3FFA0-A263-4C23-9E6A-ACE9C1EF8A31}.Release|Any CPU.ActiveCfg = Release|Any CPU
38+
{44C3FFA0-A263-4C23-9E6A-ACE9C1EF8A31}.Release|Any CPU.Build.0 = Release|Any CPU
39+
{44C3FFA0-A263-4C23-9E6A-ACE9C1EF8A31}.Release|x86.ActiveCfg = Release|x86
40+
{44C3FFA0-A263-4C23-9E6A-ACE9C1EF8A31}.Release|x86.Build.0 = Release|x86
2441
EndGlobalSection
2542
GlobalSection(SolutionProperties) = preSolution
2643
HideSolutionNode = FALSE

OpenFileInSolutionShared/OpenFileInSolutionPackage.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,11 @@ private void MenuItemCallback(object sender, EventArgs e)
243243
}
244244

245245
var wnd = new ListFiles(projItems.Values);
246+
#if Dev17
247+
wnd.Owner = HwndSource.FromHwnd(GetActiveIDE().MainWindow.HWnd).RootVisual as System.Windows.Window;
248+
#else
246249
wnd.Owner = HwndSource.FromHwnd(new IntPtr(GetActiveIDE().MainWindow.HWnd)).RootVisual as System.Windows.Window;
250+
#endif
247251
wnd.Width = wnd.Owner.Width / 2;
248252
wnd.Height = wnd.Owner.Height / 3;
249253
wnd.ShowDialog();

0 commit comments

Comments
 (0)