Skip to content

Commit 3e60b14

Browse files
author
Paul van Brenk
committed
Use Telemetry Nuget Package
1 parent 1c02088 commit 3e60b14

15 files changed

+64
-67
lines changed
-16.5 KB
Binary file not shown.
-16.5 KB
Binary file not shown.
Binary file not shown.
-16.5 KB
Binary file not shown.

Nodejs/Common/Telemetry/TelemetryProperties.cs

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

Nodejs/Product/Nodejs/Nodejs.csproj

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
<UpgradeBackupLocation>
88
</UpgradeBackupLocation>
99
<OldToolsVersion>4.0</OldToolsVersion>
10+
<NuGetPackageImportStamp>
11+
</NuGetPackageImportStamp>
1012
</PropertyGroup>
1113
<Import Project="..\ProjectBefore.settings" />
1214
<PropertyGroup>
@@ -60,6 +62,9 @@
6062
<Reference Include="Microsoft.ApplicationInsights.PersistenceChannel, Version=1.2.3.490, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6163
<HintPath>..\..\packages\Microsoft.ApplicationInsights.PersistenceChannel.1.2.3\lib\net45\Microsoft.ApplicationInsights.PersistenceChannel.dll</HintPath>
6264
</Reference>
65+
<Reference Include="Microsoft.Diagnostics.Tracing.EventSource, Version=1.1.16.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
66+
<HintPath>..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\lib\net45\Microsoft.Diagnostics.Tracing.EventSource.dll</HintPath>
67+
</Reference>
6368
<Reference Include="Microsoft.VisualStudio.ImageCatalog, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
6469
<Reference Include="Microsoft.VisualStudio.Imaging, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
6570
<!--
@@ -69,6 +74,9 @@
6974
<Reference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
7075
<EmbedInteropTypes>True</EmbedInteropTypes>
7176
</Reference>
77+
<Reference Include="Microsoft.VisualStudio.RemoteControl, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
78+
<HintPath>..\..\packages\Microsoft.VisualStudio.RemoteControl.14.0.262-masterA5CACE98\lib\net45\Microsoft.VisualStudio.RemoteControl.dll</HintPath>
79+
</Reference>
7280
<Reference Include="Microsoft.VisualStudio.Setup.Configuration.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
7381
<HintPath>..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Interop.1.8.24\lib\net35\Microsoft.VisualStudio.Setup.Configuration.Interop.dll</HintPath>
7482
<EmbedInteropTypes>True</EmbedInteropTypes>
@@ -88,6 +96,9 @@
8896
<Reference Include="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
8997
<EmbedInteropTypes>True</EmbedInteropTypes>
9098
</Reference>
99+
<Reference Include="Microsoft.VisualStudio.Telemetry, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
100+
<HintPath>..\..\packages\Microsoft.VisualStudio.Telemetry.15.3.789-masterCC863119\lib\net45\Microsoft.VisualStudio.Telemetry.dll</HintPath>
101+
</Reference>
91102
<Reference Include="Microsoft.VisualStudio.Utilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
92103
</ItemGroup>
93104
<ItemGroup>
@@ -103,6 +114,9 @@
103114
<Reference Include="Microsoft.VisualStudio.TextManager.Interop.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
104115
<EmbedInteropTypes>True</EmbedInteropTypes>
105116
</Reference>
117+
<Reference Include="Microsoft.VisualStudio.Utilities.Internal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
118+
<HintPath>..\..\packages\Microsoft.VisualStudio.Utilities.Internal.14.0.72-masterF9EB1D39\lib\net45\Microsoft.VisualStudio.Utilities.Internal.dll</HintPath>
119+
</Reference>
106120
<Reference Include="Microsoft.VisualStudio.Validation, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
107121
<HintPath>..\..\packages\Microsoft.VisualStudio.Validation.15.0.82\lib\net45\Microsoft.VisualStudio.Validation.dll</HintPath>
108122
<Private>True</Private>
@@ -136,9 +150,6 @@
136150
<Reference Include="Microsoft.Build.Utilities.$(MicrosoftBuildAssemblyVersionSuffix), Version=$(MicrosoftBuildAssemblyVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
137151
<Reference Include="Microsoft.CSharp" />
138152
<Reference Include="Microsoft.JScript" />
139-
<Reference Include="Microsoft.NodejsTools.Telemetry">
140-
<HintPath>..\..\Common\Telemetry\Microsoft.NodejsTools.Telemetry.15.0.dll</HintPath>
141-
</Reference>
142153
<Reference Include="microsoft.msxml, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
143154
<EmbedInteropTypes>False</EmbedInteropTypes>
144155
</Reference>
@@ -206,9 +217,6 @@
206217
<ItemGroup>
207218
<Reference Include="Microsoft.VisualStudio.Shell.Framework, Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
208219
</ItemGroup>
209-
<ItemGroup>
210-
<OutputBinariesToSign Include="Microsoft.NodejsTools.Telemetry.$(VSTarget).dll" />
211-
</ItemGroup>
212220
<ItemGroup>
213221
<Compile Include="..\TypeScript\TypeScriptHelpers.cs">
214222
<Link>Project\TypeScriptHelpers.cs</Link>
@@ -459,6 +467,7 @@
459467
<Compile Include="Repl\SaveReplCommand.cs" />
460468
<Compile Include="Repl\VsNodejsReplSite.cs" />
461469
<Compile Include="SourceMapping\SourceMap.cs" />
470+
<Compile Include="Telemetry\TelemetryEvents.cs" />
462471
<Compile Include="TestFrameworks\TestFrameworkDirectories.cs" />
463472
<Compile Include="VsMenus.cs" />
464473
<Compile Include="BaseNodeProjectFactory.cs" />
@@ -525,14 +534,7 @@
525534
<Compile Include="GlobalSuppressions.cs" />
526535
<Compile Include="NodejsPackage.cs" />
527536
<Compile Include="Properties\AssemblyInfo.cs" />
528-
<Compile Include="Telemetry\NodejsTelemetryExtensions.cs" />
529-
</ItemGroup>
530-
<ItemGroup>
531-
<TelemetryFiles Include="..\..\Common\Telemetry\*.cs" />
532-
<Compile Include="@(TelemetryFiles)">
533-
<Link>Telemetry\%(TelemetryFiles.FileName).cs</Link>
534-
<Visible>true</Visible>
535-
</Compile>
537+
<Compile Include="Telemetry\TelemetryHelper.cs" />
536538
</ItemGroup>
537539
<ItemGroup>
538540
<EmbeddedResource Include="ImportWizardResources.cs.resx" />
@@ -866,11 +868,6 @@
866868
<ZipProject Include="ProjectTemplates\NodejsWebApp\Preview.png" />
867869
<ZipProject Include="ProjectTemplates\AzureNodejsApp\Preview.png" />
868870
<ZipProject Include="ProjectTemplates\NodejsConsoleApp\Preview.png" />
869-
<Content Include="..\..\Common\Telemetry\Microsoft.NodejsTools.Telemetry.$(VSTarget).dll">
870-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
871-
<IncludeInVSIX>true</IncludeInVSIX>
872-
<VSIXSubPath>.</VSIXSubPath>
873-
</Content>
874871
<Content Include="$(OutputPath)\Newtonsoft.Json.dll">
875872
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
876873
<IncludeInVSIX>true</IncludeInVSIX>
@@ -1046,6 +1043,7 @@
10461043
<Content Include="TestFrameworks\Tape\tape.js">
10471044
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
10481045
</Content>
1046+
<Resource Include="version.txt" />
10491047
<Content Include="VSTemplateStore.pkgdef">
10501048
<IncludeInVSIX>false</IncludeInVSIX>
10511049
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -1284,6 +1282,7 @@
12841282
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
12851283
</PropertyGroup>
12861284
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
1285+
<Error Condition="!Exists('..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets'))" />
12871286
</Target>
12881287
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
12891288
Other similar extension points exist, see Microsoft.Common.targets.
@@ -1319,4 +1318,5 @@
13191318
<Target Name="_DeleteAfterCreatePkgDef" AfterTargets="GeneratePkgDef">
13201319
<Delete Files="@(_CopiedForCreatePkgdef)" />
13211320
</Target>
1321+
<Import Project="..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets" Condition="Exists('..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets')" />
13221322
</Project>

Nodejs/Product/Nodejs/NodejsPackage.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ internal sealed partial class NodejsPackage : CommonPackage
7070
internal static NodejsPackage Instance;
7171
internal HashSet<ITextBuffer> ChangedBuffers = new HashSet<ITextBuffer>();
7272
private NodejsToolsLogger _logger;
73-
private ITelemetryLogger _telemetryLogger;
7473
// Hold references for the subscribed events. Otherwise the callbacks will be garbage collected
7574
// after the initialization
7675
private List<EnvDTE.CommandEvents> _subscribedCommandEvents = new List<EnvDTE.CommandEvents>();
@@ -185,20 +184,15 @@ private void InitializeLogging()
185184

186185
private void InitializeTelemetry()
187186
{
188-
var thisAssembly = typeof(NodejsPackage).Assembly;
189-
190-
// Get telemetry logger
191-
this._telemetryLogger = TelemetrySetup.Instance.GetLogger(thisAssembly);
192-
193-
TelemetrySetup.Instance.LogPackageLoad(this._telemetryLogger, Guid.Parse(Guids.NodejsPackageString), thisAssembly, Application.ProductVersion);
187+
// Fetch the session synchronously on the UI thread; if this doesn't happen before we try using this on
188+
// the background thread then the VS process will deadlock.
189+
TelemetryHelper.Initialize();
194190
}
195191

196192
public new IComponentModel ComponentModel => this.GetComponentModel();
197193

198194
internal NodejsToolsLogger Logger => this._logger;
199195

200-
internal ITelemetryLogger TelemetryLogger => this._telemetryLogger;
201-
202196
/// <summary>
203197
/// Makes the debugger context available - this enables our debugger when we're installed into
204198
/// a SKU which doesn't support every installed debugger.

Nodejs/Product/Nodejs/Project/ImportWizard/ImportSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public Task<string> CreateRequestedProjectAsync()
262262
{
263263
WriteProjectXml(writer, projectPath, sourcePath, filters, startupFile, typeScriptVersion, true, out projectGuid);
264264
}
265-
NodejsPackage.Instance?.TelemetryLogger.LogProjectImported(projectGuid);
265+
TelemetryHelper.LogProjectImported();
266266
success = true;
267267
return projectPath;
268268
}

Nodejs/Product/Nodejs/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.PressAnyKey", CodeBase = "Microsoft.NodejsTools.PressAnyKey.exe", Version = "1.0.0.0")]
2323
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.ProjectWizard", CodeBase = "Microsoft.NodejsTools.ProjectWizard.dll", Version = "1.0.0.0")]
2424
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.TestAdapter", CodeBase = "Microsoft.NodejsTools.TestAdapter.dll", Version = "1.0.0.0")]
25-
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.Telemetry.15.0", CodeBase = "Microsoft.NodejsTools.Telemetry.15.0.dll", Version = "15.0.1.0")]
2625

2726
[assembly: InternalsVisibleTo("TestUtilities.NodeJS, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
2827
[assembly: InternalsVisibleTo("NodeTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]

Nodejs/Product/Nodejs/Telemetry/NodejsTelemetryExtensions.cs

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

0 commit comments

Comments
 (0)