Skip to content

Commit 08e09b0

Browse files
committed
Update to support VS2022, and only VS2022.
1 parent 683fad5 commit 08e09b0

9 files changed

Lines changed: 238 additions & 30 deletions

Microsoft.InteropFormTools.InteropFormProxyGenerator.sln

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

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26403.7
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35506.116 d17.12
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Microsoft.InteropFormTools.InteropFormProxyGenerator", "Microsoft.InteropFormTools.InteropFormProxyGenerator\Microsoft.InteropFormTools.InteropFormProxyGenerator.vbproj", "{5917F213-ECA0-43FE-81F0-444A48D4CC8F}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10-
Debug|Any CPU = Debug|Any CPU
11-
Release|Any CPU = Release|Any CPU
10+
Debug|x64 = Debug|x64
11+
Release|x64 = Release|x64
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{5917F213-ECA0-43FE-81F0-444A48D4CC8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{5917F213-ECA0-43FE-81F0-444A48D4CC8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{5917F213-ECA0-43FE-81F0-444A48D4CC8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{5917F213-ECA0-43FE-81F0-444A48D4CC8F}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{5917F213-ECA0-43FE-81F0-444A48D4CC8F}.Debug|x64.ActiveCfg = Debug|x64
15+
{5917F213-ECA0-43FE-81F0-444A48D4CC8F}.Debug|x64.Build.0 = Debug|x64
16+
{5917F213-ECA0-43FE-81F0-444A48D4CC8F}.Release|x64.ActiveCfg = Release|x64
17+
{5917F213-ECA0-43FE-81F0-444A48D4CC8F}.Release|x64.Build.0 = Release|x64
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE

Microsoft.InteropFormTools.InteropFormProxyGenerator/GenerateInteropFormProxyClasses.vb

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
Imports System
22
Imports System.ComponentModel.Design
3-
Imports System.Globalization
4-
Imports Microsoft.VisualStudio.Shell
5-
Imports Microsoft.VisualStudio.Shell.Interop
63
Imports System.Windows.Forms
7-
Imports EnvDTE
8-
Imports EnvDTE80
94
Imports System.Collections.Generic
105
Imports System.IO
116
Imports System.CodeDom
127
Imports System.CodeDom.Compiler
138
Imports Microsoft.VisualBasic
9+
Imports Microsoft.VisualStudio.Shell
10+
Imports EnvDTE
11+
Imports EnvDTE80
12+
1413

1514
''' <summary>
1615
''' Command handler
@@ -120,17 +119,19 @@ Public NotInheritable Class GenerateInteropFormProxyClasses
120119
#Region " Private Methods "
121120
Private Sub LoadSupportedTypes()
122121
' Load list of types that are allowed to be used in members.
123-
_supportedTypes = New List(Of Type)
124-
_supportedTypes.Add(GetType(Int32))
125-
_supportedTypes.Add(GetType(String))
126-
_supportedTypes.Add(GetType(Boolean))
127-
_supportedTypes.Add(GetType(Object))
122+
_supportedTypes = New List(Of Type) From {
123+
GetType(Integer),
124+
GetType(String),
125+
GetType(Boolean),
126+
GetType(Object)
127+
}
128128
End Sub
129129

130130
Private m_blnProxiesGenerated As Boolean
131131
Private Sub CreateInteropFormProxiesForSolution()
132132
_applicationObject.StatusBar.Text = My.Resources.ADDIN_STATUS_GENERATING
133133
m_blnProxiesGenerated = False
134+
134135
For Each assemblyProj As Project In _applicationObject.Solution.Projects
135136
If assemblyProj.ProjectItems IsNot Nothing AndAlso (assemblyProj.ProjectItems.Count > 0) Then
136137
CreateInteropFormProxiesForProject(assemblyProj, assemblyProj.ProjectItems)

Microsoft.InteropFormTools.InteropFormProxyGenerator/Microsoft.InteropFormTools.InteropFormProxyGenerator.vbproj

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,23 @@
4141
<PropertyGroup>
4242
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
4343
</PropertyGroup>
44+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
45+
<DebugSymbols>true</DebugSymbols>
46+
<DefineDebug>true</DefineDebug>
47+
<DefineTrace>true</DefineTrace>
48+
<OutputPath>bin\x64\Debug\</OutputPath>
49+
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42353,42354,42355</NoWarn>
50+
<DebugType>full</DebugType>
51+
<PlatformTarget>x64</PlatformTarget>
52+
</PropertyGroup>
53+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
54+
<DefineTrace>true</DefineTrace>
55+
<OutputPath>bin\x64\Release\</OutputPath>
56+
<Optimize>true</Optimize>
57+
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42353,42354,42355</NoWarn>
58+
<DebugType>pdbonly</DebugType>
59+
<PlatformTarget>x64</PlatformTarget>
60+
</PropertyGroup>
4461
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4562
<PropertyGroup>
4663
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -51,7 +68,7 @@
5168
<OutputType>Library</OutputType>
5269
<RootNamespace>Microsoft.InteropFormTools.InteropFormProxyGenerator</RootNamespace>
5370
<AssemblyName>Microsoft.InteropFormTools.InteropFormProxyGenerator</AssemblyName>
54-
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
71+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
5572
<GeneratePkgDefFile>true</GeneratePkgDefFile>
5673
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
5774
<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
@@ -114,9 +131,6 @@
114131
<SpecificVersion>False</SpecificVersion>
115132
<HintPath>..\..\..\Program Files (x86)\Microsoft Visual Basic Power Packs\Interop Forms Toolkit 2.1\SDK\Libraries\Microsoft.InteropFormTools.dll</HintPath>
116133
</Reference>
117-
<Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
118-
<EmbedInteropTypes>False</EmbedInteropTypes>
119-
</Reference>
120134
<Reference Include="System" />
121135
<Reference Include="System.Design" />
122136
<Reference Include="System.Windows.Forms" />
@@ -142,10 +156,10 @@
142156
</ItemGroup>
143157
<ItemGroup>
144158
<PackageReference Include="Microsoft.VisualStudio.SDK">
145-
<Version>15.0.1</Version>
159+
<Version>17.12.40392</Version>
146160
</PackageReference>
147161
<PackageReference Include="Microsoft.VSSDK.BuildTools">
148-
<Version>15.0.26201</Version>
162+
<Version>17.12.2069</Version>
149163
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
150164
<PrivateAssets>all</PrivateAssets>
151165
</PackageReference>

Microsoft.InteropFormTools.InteropFormProxyGenerator/My Project/Resources.Designer.vb

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<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">
33
<Metadata>
4-
<Identity Id="Microsoft.InteropFormTools.InteropFormProxyGenerator.Don Benson.5e81461e-5e5e-4eea-bf90-5999952fd0d9" Version="1.2" Language="en-US" Publisher="Don Benson" />
4+
<Identity Id="Microsoft.InteropFormTools.InteropFormProxyGenerator.Don Benson.5e81461e-5e5e-4eea-bf90-5999952fd0d9" Version="1.3" Language="en-US" Publisher="Don Benson" />
55
<DisplayName>Microsoft Interop Form Tools Proxy Generator</DisplayName>
66
<Description xml:space="preserve">Proxy Generator command converted from add-in with Microsoft InteropForms Toolkit 2.1.</Description>
77
</Metadata>
88
<Installation>
9-
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[14.0,17.0)" />
9+
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,18.0)">
10+
<ProductArchitecture>amd64</ProductArchitecture>
11+
</InstallationTarget>
1012
</Installation>
1113
<Dependencies>
12-
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.6,)" />
13-
<Dependency Id="Microsoft.VisualStudio.MPF" DisplayName="Visual Studio MPF" d:Source="Installed" Version="[14.0,17.0)" />
14+
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
1415
</Dependencies>
1516
<Assets>
1617
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
1718
</Assets>
1819
<Prerequisites>
19-
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,)" DisplayName="Visual Studio core editor" />
20+
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[17.0, 18.0)" DisplayName="Visual Studio core editor" />
2021
</Prerequisites>
2122
</PackageManifest>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Imports System.Reflection
2+
Imports System.Runtime.CompilerServices
3+
Imports System.Runtime.InteropServices
4+
Imports Microsoft.VisualBasic
5+
6+
' General Information about an assembly is controlled through the following
7+
' set of attributes. Change these attribute values to modify the information
8+
' associated with an assembly.
9+
<Assembly: AssemblyTitle("VSIXProject1")>
10+
<Assembly: AssemblyDescription("")>
11+
<Assembly: AssemblyConfiguration("")>
12+
<Assembly: AssemblyCompany("")>
13+
<Assembly: AssemblyProduct("VSIXProject1")>
14+
<Assembly: AssemblyCopyright("")>
15+
<Assembly: AssemblyTrademark("")>
16+
<Assembly: AssemblyCulture("")>
17+
18+
' Setting ComVisible to false makes the types in this assembly not visible
19+
' to COM components. If you need to access a type in this assembly from
20+
' COM, set the ComVisible attribute to true on that type.
21+
<Assembly: ComVisible(False)>
22+
23+
' Version information for an assembly consists of the following four values:
24+
'
25+
' Major Version
26+
' Minor Version
27+
' Build Number
28+
' Revision
29+
'
30+
' You can specify all the values or you can default the Build and Revision Numbers
31+
' by using the '*' as shown below:
32+
' [assembly: AssemblyVersion("1.0.*")]
33+
<Assembly: AssemblyVersion("1.0.0.0")>
34+
<Assembly: AssemblyFileVersion("1.0.0.0")>

VSIXProject1/VSIXProject1.vbproj

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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>16.0</MinimumVisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<PropertyGroup>
8+
<OptionExplicit>On</OptionExplicit>
9+
</PropertyGroup>
10+
<PropertyGroup>
11+
<OptionCompare>Binary</OptionCompare>
12+
</PropertyGroup>
13+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
14+
<PropertyGroup>
15+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
16+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
17+
<SchemaVersion>2.0</SchemaVersion>
18+
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
19+
<ProjectGuid>{1B86F030-DDF5-48D4-8098-47AFB2C556B9}</ProjectGuid>
20+
<OutputType>Library</OutputType>
21+
<RootNamespace>VSIXProject1</RootNamespace>
22+
<AssemblyName>VSIXProject1</AssemblyName>
23+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
24+
<GeneratePkgDefFile>true</GeneratePkgDefFile>
25+
<UseCodebase>true</UseCodebase>
26+
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
27+
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
28+
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
29+
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
30+
<CopyOutputSymbolsToOutputDirectory>true</CopyOutputSymbolsToOutputDirectory>
31+
<OptionStrict>Off</OptionStrict>
32+
<OptionInfer>On</OptionInfer>
33+
<StartAction>Program</StartAction>
34+
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
35+
<StartArguments>/rootsuffix Exp</StartArguments>
36+
</PropertyGroup>
37+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
38+
<DebugSymbols>true</DebugSymbols>
39+
<DebugType>full</DebugType>
40+
<Optimize>false</Optimize>
41+
<OutputPath>bin\Debug\</OutputPath>
42+
<DefineDebug>true</DefineDebug>
43+
<DefineTrace>true</DefineTrace>
44+
<ErrorReport>prompt</ErrorReport>
45+
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</NoWarn>
46+
</PropertyGroup>
47+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
48+
<DebugType>pdbonly</DebugType>
49+
<Optimize>true</Optimize>
50+
<OutputPath>bin\Release\</OutputPath>
51+
<DefineDebug>false</DefineDebug>
52+
<DefineTrace>true</DefineTrace>
53+
<ErrorReport>prompt</ErrorReport>
54+
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</NoWarn>
55+
</PropertyGroup>
56+
<ItemGroup>
57+
<None Include="source.extension.vsixmanifest">
58+
<SubType>Designer</SubType>
59+
</None>
60+
</ItemGroup>
61+
<ItemGroup>
62+
<Compile Include="My Project\AssemblyInfo.vb" />
63+
<Compile Include="VSIXProject1Package.vb" />
64+
</ItemGroup>
65+
<ItemGroup>
66+
<Reference Include="System" />
67+
</ItemGroup>
68+
<ItemGroup>
69+
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.12.40392" ExcludeAssets="runtime">
70+
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
71+
</PackageReference>
72+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.12.2069" />
73+
</ItemGroup>
74+
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
75+
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
76+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
77+
Other similar extension points exist, see Microsoft.Common.targets.
78+
<Target Name="BeforeBuild">
79+
</Target>
80+
<Target Name="AfterBuild">
81+
</Target>
82+
-->
83+
</Project>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Imports System
2+
Imports System.Runtime.InteropServices
3+
Imports System.Threading
4+
Imports Microsoft.VisualBasic
5+
Imports Microsoft.VisualStudio.Shell
6+
Imports Task = System.Threading.Tasks.Task
7+
8+
9+
''' <summary>
10+
''' This is the class that implements the package exposed by this assembly.
11+
''' </summary>
12+
''' <remarks>
13+
''' <para>
14+
''' The minimum requirement for a class to be considered a valid package for Visual Studio
15+
''' Is to implement the IVsPackage interface And register itself with the shell.
16+
''' This package uses the helper classes defined inside the Managed Package Framework (MPF)
17+
''' to do it: it derives from the Package Class that provides the implementation Of the
18+
''' IVsPackage interface And uses the registration attributes defined in the framework to
19+
''' register itself And its components with the shell. These attributes tell the pkgdef creation
20+
''' utility what data to put into .pkgdef file.
21+
''' </para>
22+
''' <para>
23+
''' To get loaded into VS, the package must be referred by &lt;Asset Type="Microsoft.VisualStudio.VsPackage" ...&gt; in .vsixmanifest file.
24+
''' </para>
25+
''' </remarks>
26+
<PackageRegistration(UseManagedResourcesOnly:=True, AllowsBackgroundLoading:=True)>
27+
<Guid(VSIXProject1Package.PackageGuidString)>
28+
Public NotInheritable Class VSIXProject1Package
29+
Inherits AsyncPackage
30+
31+
''' <summary>
32+
''' Package guid
33+
''' </summary>
34+
Public Const PackageGuidString As String = "8f368540-07f2-4a8d-bf8a-8a710d0ddd86"
35+
36+
#Region "Package Members"
37+
38+
''' <summary>
39+
''' Initialization of the package; this method is called right after the package is sited, so this is the place
40+
''' where you can put all the initialization code that rely on services provided by VisualStudio.
41+
''' </summary>
42+
''' <param name="cancellationToken">A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down.</param>
43+
''' <param name="progress">A provider for progress updates.</param>
44+
''' <returns>A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method.</returns>
45+
Protected Overrides Async Function InitializeAsync(cancellationToken As CancellationToken, progress As IProgress(Of ServiceProgressData)) As Task
46+
' When initialized asynchronously, the current thread may be a background thread at this point.
47+
' Do any initialization that requires the UI thread after switching to the UI thread.
48+
Await Me.JoinableTaskFactory.SwitchToMainThreadAsync()
49+
End Function
50+
51+
#End Region
52+
53+
End Class
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="VSIXProject1.c64bc67e-57a2-4b9c-8a30-0d2c78220c10" Version="1.0" Language="en-US" Publisher="Don Benson" />
5+
<DisplayName>VSIXProject1</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>

0 commit comments

Comments
 (0)