Skip to content

Commit 2ec4d12

Browse files
convert 3 x VS2019 to async
1 parent 7f0ec5d commit 2ec4d12

File tree

9 files changed

+33
-24
lines changed

9 files changed

+33
-24
lines changed

src/OpenInVS2019Community/OpenInVS2019Community.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" />
44
<PropertyGroup>
5-
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
6-
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
5+
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
6+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
77
<NuGetPackageImportStamp>
88
</NuGetPackageImportStamp>
99
<UseCodebase>true</UseCodebase>

src/OpenInVS2019Community/VSPackage.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,28 @@
55
using System;
66
using System.Diagnostics.CodeAnalysis;
77
using System.Runtime.InteropServices;
8+
using System.Threading;
9+
using System.Threading.Tasks;
810

911
namespace OpenInVS2019Community
1012
{
11-
[PackageRegistration(UseManagedResourcesOnly = true)]
13+
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
1214
[InstalledProductRegistration(productName: "#110", productDetails: "#112", productId: Vsix.Version, IconResourceID = 400)]
1315
[ProvideMenuResource("Menus.ctmenu", 1)]
1416
[Guid(PackageGuids.guidOpenInAppPackageString)]
1517
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")]
1618
[ProvideOptionPage(typeof(GeneralOptions), Vsix.Name, CommonConstants.CategorySubLevel, 0, 0, true)]
17-
public sealed class VSPackage : Package
19+
public sealed class VSPackage : AsyncPackage
1820
{
1921
public static GeneralOptions Options { get; private set; }
2022

21-
protected override void Initialize()
23+
protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
2224
{
25+
await JoinableTaskFactory.SwitchToMainThreadAsync();
2326
Options = (GeneralOptions)GetDialogPage(typeof(GeneralOptions));
2427

2528
new OpenInAppCommand(this).Initialize();
26-
base.Initialize();
29+
2730
}
2831
}
2932
}

src/OpenInVS2019Community/source.extension.vsixmanifest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
<Tags>open, open in, open in VS2019, VS2019, open in Visual Studio 2019, Visual Studio 2019, community</Tags>
1313
</Metadata>
1414
<Installation>
15-
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[11.0,16.0)" />
15+
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[11.0,17.0)" />
1616
</Installation>
1717
<Dependencies>
1818
</Dependencies>
1919
<Assets>
2020
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
2121
</Assets>
2222
<Prerequisites>
23-
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0.26208.0,16.0)" DisplayName="Visual Studio core editor" />
23+
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0.26208.0,17.0)" DisplayName="Visual Studio core editor" />
2424
</Prerequisites>
2525
</PackageManifest>

src/OpenInVS2019Enterprise/OpenInVS2019Enterprise.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" />
44
<PropertyGroup>
5-
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
6-
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
5+
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
6+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
77
<NuGetPackageImportStamp>
88
</NuGetPackageImportStamp>
99
<UseCodebase>true</UseCodebase>

src/OpenInVS2019Enterprise/VSPackage.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,28 @@
55
using System;
66
using System.Diagnostics.CodeAnalysis;
77
using System.Runtime.InteropServices;
8+
using System.Threading;
9+
using System.Threading.Tasks;
810

911
namespace OpenInVS2019Enterprise
1012
{
11-
[PackageRegistration(UseManagedResourcesOnly = true)]
13+
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
1214
[InstalledProductRegistration(productName: "#110", productDetails: "#112", productId: Vsix.Version, IconResourceID = 400)]
1315
[ProvideMenuResource("Menus.ctmenu", 1)]
1416
[Guid(PackageGuids.guidOpenInAppPackageString)]
1517
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")]
1618
[ProvideOptionPage(typeof(GeneralOptions), Vsix.Name, CommonConstants.CategorySubLevel, 0, 0, true)]
17-
public sealed class VSPackage : Package
19+
public sealed class VSPackage : AsyncPackage
1820
{
1921
public static GeneralOptions Options { get; private set; }
2022

21-
protected override void Initialize()
23+
protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
2224
{
25+
await JoinableTaskFactory.SwitchToMainThreadAsync();
2326
Options = (GeneralOptions)GetDialogPage(typeof(GeneralOptions));
2427

2528
new OpenInAppCommand(this).Initialize();
26-
base.Initialize();
29+
2730
}
2831
}
2932
}

src/OpenInVS2019Enterprise/source.extension.vsixmanifest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
<Tags>open, open in, open in VS2019, VS2019, open in Visual Studio 2019, Visual Studio 2019, enterprise</Tags>
1313
</Metadata>
1414
<Installation>
15-
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[11.0,16.0)" />
15+
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[11.0,17.0)" />
1616
</Installation>
1717
<Dependencies>
1818
</Dependencies>
1919
<Assets>
2020
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
2121
</Assets>
2222
<Prerequisites>
23-
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0.26208.0,16.0)" DisplayName="Visual Studio core editor" />
23+
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0.26208.0,17.0)" DisplayName="Visual Studio core editor" />
2424
</Prerequisites>
2525
</PackageManifest>

src/OpenInVS2019Professional/OpenInVS2019Professional.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" />
44
<PropertyGroup>
5-
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
6-
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
5+
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
6+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
77
<NuGetPackageImportStamp>
88
</NuGetPackageImportStamp>
99
<UseCodebase>true</UseCodebase>

src/OpenInVS2019Professional/VSPackage.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,28 @@
55
using System;
66
using System.Diagnostics.CodeAnalysis;
77
using System.Runtime.InteropServices;
8+
using System.Threading;
9+
using System.Threading.Tasks;
810

911
namespace OpenInVS2019Professional
1012
{
11-
[PackageRegistration(UseManagedResourcesOnly = true)]
13+
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
1214
[InstalledProductRegistration(productName: "#110", productDetails: "#112", productId: Vsix.Version, IconResourceID = 400)]
1315
[ProvideMenuResource("Menus.ctmenu", 1)]
1416
[Guid(PackageGuids.guidOpenInAppPackageString)]
1517
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")]
1618
[ProvideOptionPage(typeof(GeneralOptions), Vsix.Name, CommonConstants.CategorySubLevel, 0, 0, true)]
17-
public sealed class VSPackage : Package
19+
public sealed class VSPackage : AsyncPackage
1820
{
1921
public static GeneralOptions Options { get; private set; }
2022

21-
protected override void Initialize()
23+
protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
2224
{
25+
await JoinableTaskFactory.SwitchToMainThreadAsync();
2326
Options = (GeneralOptions)GetDialogPage(typeof(GeneralOptions));
2427

2528
new OpenInAppCommand(this).Initialize();
26-
base.Initialize();
29+
2730
}
2831
}
2932
}

src/OpenInVS2019Professional/source.extension.vsixmanifest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
<Tags>open, open in, open in VS2019, VS2019, open in Visual Studio 2019, Visual Studio 2019, professional</Tags>
1313
</Metadata>
1414
<Installation>
15-
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[11.0,16.0)" />
15+
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[11.0,17.0)" />
1616
</Installation>
1717
<Dependencies>
1818
</Dependencies>
1919
<Assets>
2020
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
2121
</Assets>
2222
<Prerequisites>
23-
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0.26208.0,16.0)" DisplayName="Visual Studio core editor" />
23+
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0.26208.0,17.0)" DisplayName="Visual Studio core editor" />
2424
</Prerequisites>
2525
</PackageManifest>

0 commit comments

Comments
 (0)