Skip to content

Commit 7fa8ae8

Browse files
author
Stephan
committed
Fix VS2019
1 parent b2b1cca commit 7fa8ae8

File tree

9 files changed

+39
-337
lines changed

9 files changed

+39
-337
lines changed

src/SolutionInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
[assembly: AssemblyVersion("8.0.0")]
3333

3434
// ... good to have a build number ...
35-
[assembly: AssemblyFileVersion("8.0.4")]
35+
[assembly: AssemblyFileVersion("8.0.5")]
3636

3737
// NuGet Package
3838
// Note: could not release "1.8.0" because it was depending on pre-release NuGet packages
3939
// for Roslyn, so had to release 1.8.0-final... starting with 2.1.3 Roslyn has a released
4040
// 1.0 version, so now we can release "2.1.3" without the "-final" extension.
41-
[assembly: AssemblyInformationalVersion("8.0.4")]
41+
[assembly: AssemblyInformationalVersion("8.0.5-zb.1")]
4242
// Do not remove this line.

src/Umbraco.ModelsBuilder.CustomTool/Resources.Designer.cs

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/Umbraco.ModelsBuilder.CustomTool/Resources.resx

Lines changed: 0 additions & 129 deletions
This file was deleted.

src/Umbraco.ModelsBuilder.CustomTool/Umbraco.ModelsBuilder.CustomTool.csproj

Lines changed: 8 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -50,67 +50,10 @@
5050
<DeployExtension>True</DeployExtension>
5151
</PropertyGroup>
5252
<ItemGroup>
53-
<Reference Include="envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
54-
<EmbedInteropTypes>False</EmbedInteropTypes>
55-
</Reference>
56-
<Reference Include="envdte100, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
57-
<EmbedInteropTypes>False</EmbedInteropTypes>
58-
</Reference>
59-
<Reference Include="envdte80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
60-
<EmbedInteropTypes>False</EmbedInteropTypes>
61-
</Reference>
62-
<Reference Include="envdte90, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
63-
<EmbedInteropTypes>False</EmbedInteropTypes>
64-
</Reference>
65-
<Reference Include="Microsoft.CSharp" />
66-
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
67-
<Reference Include="Microsoft.VisualStudio.Shell.Design, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
68-
<Reference Include="Microsoft.VisualStudio.Shell.Framework, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
69-
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
70-
<Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
71-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
72-
<EmbedInteropTypes>True</EmbedInteropTypes>
73-
</Reference>
74-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0" />
75-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0" />
76-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0">
77-
<EmbedInteropTypes>true</EmbedInteropTypes>
78-
</Reference>
79-
<Reference Include="Microsoft.VisualStudio.Shell.11.0">
80-
<EmbedInteropTypes>False</EmbedInteropTypes>
81-
</Reference>
82-
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.11.0" />
8353
<Reference Include="System" />
8454
<Reference Include="System.Configuration" />
85-
<Reference Include="System.Core" />
86-
<Reference Include="System.Data" />
87-
<Reference Include="System.Design" />
88-
<Reference Include="System.Drawing" />
89-
<Reference Include="System.Net.Http" />
90-
<Reference Include="System.Net.Http.WebRequest" />
91-
<Reference Include="System.Windows.Forms" />
9255
<Reference Include="System.Xml" />
9356
</ItemGroup>
94-
<ItemGroup>
95-
<COMReference Include="Microsoft.VisualStudio.CommandBars">
96-
<Guid>{1CBA492E-7263-47BB-87FE-639000619B15}</Guid>
97-
<VersionMajor>8</VersionMajor>
98-
<VersionMinor>0</VersionMinor>
99-
<Lcid>0</Lcid>
100-
<WrapperTool>primary</WrapperTool>
101-
<Isolated>False</Isolated>
102-
<EmbedInteropTypes>False</EmbedInteropTypes>
103-
</COMReference>
104-
<COMReference Include="stdole">
105-
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
106-
<VersionMajor>2</VersionMajor>
107-
<VersionMinor>0</VersionMinor>
108-
<Lcid>0</Lcid>
109-
<WrapperTool>primary</WrapperTool>
110-
<Isolated>False</Isolated>
111-
<EmbedInteropTypes>False</EmbedInteropTypes>
112-
</COMReference>
113-
</ItemGroup>
11457
<ItemGroup>
11558
<Compile Include="..\SolutionInfo.cs">
11659
<Link>Properties\SolutionInfo.cs</Link>
@@ -120,27 +63,16 @@
12063
<Compile Include="CustomTool\UmbracoModelsBuilder.cs" />
12164
<Compile Include="CustomTool\UmbracoCSharpModelsBuilder.cs" />
12265
<Compile Include="Guids.cs" />
123-
<Compile Include="Resources.Designer.cs">
124-
<AutoGen>True</AutoGen>
125-
<DesignTime>True</DesignTime>
126-
<DependentUpon>Resources.resx</DependentUpon>
127-
</Compile>
12866
<Compile Include="GlobalSuppressions.cs" />
12967
<Compile Include="UmbracoModelsBuilder.cs" />
13068
<Compile Include="Properties\AssemblyInfo.cs" />
131-
<Compile Include="VisualStudio2013Package.cs" />
13269
<Compile Include="OptionsDialog.cs">
13370
<SubType>Component</SubType>
13471
</Compile>
13572
<Compile Include="VisualStudioOptions.cs" />
13673
<Compile Include="VisualStudio\VisualStudioHelper.cs" />
13774
</ItemGroup>
13875
<ItemGroup>
139-
<EmbeddedResource Include="Resources.resx">
140-
<Generator>ResXFileCodeGenerator</Generator>
141-
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
142-
<SubType>Designer</SubType>
143-
</EmbeddedResource>
14476
<EmbeddedResource Include="VSPackage.resx">
14577
<MergeWithCTO>true</MergeWithCTO>
14678
<ManifestResourceName>VSPackage</ManifestResourceName>
@@ -177,6 +109,14 @@
177109
</ProjectReference>
178110
</ItemGroup>
179111
<ItemGroup>
112+
<PackageReference Include="Microsoft.VisualStudio.SDK">
113+
<Version>15.9.3</Version>
114+
</PackageReference>
115+
<PackageReference Include="Microsoft.VSSDK.BuildTools">
116+
<Version>15.9.3039</Version>
117+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
118+
<PrivateAssets>all</PrivateAssets>
119+
</PackageReference>
180120
<PackageReference Include="semver">
181121
<Version>2.0.4</Version>
182122
</PackageReference>

src/Umbraco.ModelsBuilder.CustomTool/UmbracoModelsBuilder.cs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
using System.Diagnostics;
1+
using System;
2+
using System.Diagnostics;
23
using System.Globalization;
34
using System.Runtime.InteropServices;
5+
using System.Threading;
46
using Microsoft.VisualStudio;
57
using Microsoft.VisualStudio.Shell;
68
using Microsoft.VisualStudio.Shell.Design.Serialization;
79
using Microsoft.VisualStudio.Shell.Interop;
810
using Umbraco.ModelsBuilder.CustomTool.CustomTool;
11+
using Task = System.Threading.Tasks.Task;
912

1013
namespace Umbraco.ModelsBuilder.CustomTool
1114
{
@@ -21,7 +24,7 @@ namespace Umbraco.ModelsBuilder.CustomTool
2124
/// </summary>
2225

2326
// tells CreatePkgDef.exe utility that this class is a package
24-
[PackageRegistration(UseManagedResourcesOnly = true)]
27+
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
2528

2629
// load when a solution exists - not
2730
//[ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExistsAndFullyLoaded_string)]
@@ -32,13 +35,13 @@ namespace Umbraco.ModelsBuilder.CustomTool
3235
// register infos needed to show this package in the Help/About dialog of VS
3336
[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
3437
[Guid(GuidList.PkgString)]
35-
[DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\11.0")]
38+
//[DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\11.0")]
3639

3740
// register the generator
3841
[ProvideObject(typeof(UmbracoCSharpModelsBuilder))]
3942
[ProvideGenerator(typeof(UmbracoCSharpModelsBuilder), "UmbracoModelsBuilder", "Umbraco ModelsBuilder Custom Tool for C#", "{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}", true)] // csharp
4043

41-
public sealed class UmbracoModelsBuilder : Package, IVsSolutionEvents
44+
public sealed class CustomToolPackage : AsyncPackage, IVsSolutionEvents
4245
{
4346
/// <summary>
4447
/// Default constructor of the package.
@@ -47,7 +50,7 @@ public sealed class UmbracoModelsBuilder : Package, IVsSolutionEvents
4750
/// not sited yet inside Visual Studio environment. The place to do all the other
4851
/// initialization is the Initialize method.
4952
/// </summary>
50-
public UmbracoModelsBuilder()
53+
public CustomToolPackage()
5154
{
5255
Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString()));
5356
}
@@ -59,10 +62,19 @@ public UmbracoModelsBuilder()
5962
/// Initialization of the package; this method is called right after the package is sited, so this is the place
6063
/// where you can put all the initialization code that rely on services provided by VisualStudio.
6164
/// </summary>
62-
protected override void Initialize()
65+
/// <param name="cancellationToken">A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down.</param>
66+
/// <param name="progress">A provider for progress updates.</param>
67+
/// <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>
68+
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
6369
{
64-
Debug.WriteLine (string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
65-
base.Initialize();
70+
// When initialized asynchronously, the current thread may be a background thread at this point.
71+
// Do any initialization that requires the UI thread after switching to the UI thread.
72+
await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
73+
74+
Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
75+
76+
//var dte = await GetServiceAsync(typeof(DTE)) as DTE;
77+
//VisualStudioHelper.DTE = dte;
6678
}
6779

6880
#region IVsSolutionEvents

0 commit comments

Comments
 (0)