diff --git a/Packages.props b/Packages.props
index de2e329d..be52bbfb 100644
--- a/Packages.props
+++ b/Packages.props
@@ -28,7 +28,6 @@
-
diff --git a/README.md b/README.md
index 1fa52f10..6949840c 100644
--- a/README.md
+++ b/README.md
@@ -61,8 +61,3 @@ More documentation is available at [https://microsoft.github.io/slngen/](https:/
# Contributing
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
-
-# Data Collection
-The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
-
-To opt-out of data collection, please do so by disabling the [Visual Studio Customer Experience Improvement Program](https://docs.microsoft.com/en-us/visualstudio/ide/visual-studio-experience-improvement-program)
diff --git a/src/Microsoft.VisualStudio.SlnGen.UnitTests/Microsoft.VisualStudio.SlnGen.UnitTests.csproj b/src/Microsoft.VisualStudio.SlnGen.UnitTests/Microsoft.VisualStudio.SlnGen.UnitTests.csproj
index 49fcd007..5d660ed3 100644
--- a/src/Microsoft.VisualStudio.SlnGen.UnitTests/Microsoft.VisualStudio.SlnGen.UnitTests.csproj
+++ b/src/Microsoft.VisualStudio.SlnGen.UnitTests/Microsoft.VisualStudio.SlnGen.UnitTests.csproj
@@ -14,7 +14,6 @@
-
diff --git a/src/Microsoft.VisualStudio.SlnGen/Microsoft.VisualStudio.SlnGen.csproj b/src/Microsoft.VisualStudio.SlnGen/Microsoft.VisualStudio.SlnGen.csproj
index c8f70753..9ddf16dc 100644
--- a/src/Microsoft.VisualStudio.SlnGen/Microsoft.VisualStudio.SlnGen.csproj
+++ b/src/Microsoft.VisualStudio.SlnGen/Microsoft.VisualStudio.SlnGen.csproj
@@ -25,7 +25,6 @@
-
diff --git a/src/Microsoft.VisualStudio.SlnGen/Program.cs b/src/Microsoft.VisualStudio.SlnGen/Program.cs
index 0f263029..0f6740d3 100644
--- a/src/Microsoft.VisualStudio.SlnGen/Program.cs
+++ b/src/Microsoft.VisualStudio.SlnGen/Program.cs
@@ -26,7 +26,6 @@ public static partial class Program
private static readonly Assembly CurrentAssembly;
private static readonly FileInfo CurrentAssemblyFileInfo;
private static readonly IEnvironmentProvider EnvironmentProvider = SystemEnvironmentProvider.Instance;
- private static readonly TelemetryClient TelemetryClient;
static Program()
{
@@ -35,8 +34,6 @@ static Program()
Debugger.Launch();
}
- TelemetryClient = new TelemetryClient();
-
CurrentAssembly = Assembly.GetExecutingAssembly();
CurrentAssemblyFileInfo = new FileInfo(CurrentAssembly.Location);
@@ -208,8 +205,6 @@ internal static int Execute(ProgramArguments arguments, IConsole console)
{
return 1;
}
-
- Program.LogTelemetry(arguments, evaluationTime, evaluationCount, customProjectTypeGuidCount, solutionItemCount, solutionGuid);
}
catch (InvalidProjectFileException e)
{
@@ -295,16 +290,10 @@ private static int Execute(string[] args, IConsole console)
}
catch (Exception e)
{
- TelemetryClient.PostException(e);
-
WriteError(console, e.ToString());
return 2;
}
- finally
- {
- TelemetryClient.Dispose();
- }
}
private static IEnumerable GetLoggers(ConsoleForwardingLogger consoleLogger, ProgramArguments arguments)
@@ -352,44 +341,6 @@ private static ProjectCollection GetProjectCollection(params ILogger[] loggers)
#endif
}
- private static void LogTelemetry(ProgramArguments arguments, TimeSpan evaluationTime, int evaluationCount, int customProjectTypeGuidCount, int solutionItemCount, Guid solutionGuid)
- {
- try
- {
- TelemetryClient.PostEvent(
- "execute",
- new Dictionary
- {
- ["AlwaysBuild"] = arguments.EnableAlwaysBuild().ToString(),
- ["AssemblyInformationalVersion"] = ThisAssembly.AssemblyInformationalVersion,
- ["DevEnvFullPathSpecified"] = (!arguments.DevEnvFullPath?.LastOrDefault().IsNullOrWhiteSpace()).ToString(),
- ["EntryProjectCount"] = arguments.Projects?.Length.ToString(),
- ["Folders"] = arguments.EnableFolders().ToString(),
- ["CollapseFolders"] = arguments.EnableCollapseFolders().ToString(),
- ["IsCoreXT"] = CurrentDevelopmentEnvironment.IsCorext.ToString(),
- ["IsNetCore"] = IsNetCore.ToString(),
- ["LaunchVisualStudio"] = arguments.ShouldLaunchVisualStudio().ToString(),
- ["SolutionFileFullPathSpecified"] = (!arguments.SolutionFileFullPath?.LastOrDefault().IsNullOrWhiteSpace()).ToString(),
-#if NETFRAMEWORK
- ["Runtime"] = $".NET Framework {EnvironmentProvider.Version}",
-#elif NETCOREAPP
- ["Runtime"] = $".NET Core {EnvironmentProvider.Version}",
-#endif
- ["UseBinaryLogger"] = arguments.BinaryLogger.HasValue.ToString(),
- ["UseFileLogger"] = arguments.FileLoggerParameters.HasValue.ToString(),
- ["CustomProjectTypeGuidCount"] = customProjectTypeGuidCount,
- ["ProjectCount"] = evaluationCount,
- ["ProjectEvaluationMilliseconds"] = evaluationTime.TotalMilliseconds,
- ["SolutionItemCount"] = solutionItemCount,
- ["VS.Platform.Solution.Project.SccProvider.SolutionId"] = solutionGuid == Guid.Empty ? string.Empty : solutionGuid.ToString("B"),
- });
- }
- catch (Exception)
- {
- // Ignored
- }
- }
-
private static Assembly OnAssemblyResolve(object sender, ResolveEventArgs args)
{
AssemblyName requestedAssemblyName = new AssemblyName(args.Name);
diff --git a/src/Microsoft.VisualStudio.SlnGen/TelemetryClient.cs b/src/Microsoft.VisualStudio.SlnGen/TelemetryClient.cs
deleted file mode 100644
index dbd54ce2..00000000
--- a/src/Microsoft.VisualStudio.SlnGen/TelemetryClient.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-//
-// Licensed under the MIT license.
-
-using Microsoft.VisualStudio.Telemetry;
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace Microsoft.VisualStudio.SlnGen
-{
- ///
- /// Represents a class used for logging telemetry.
- ///
- internal sealed class TelemetryClient : IDisposable
- {
- private readonly TelemetrySession _telemetrySession;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public TelemetryClient()
- : this(SystemEnvironmentProvider.Instance)
- {
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// An instance to use when accessing the environment.
- public TelemetryClient(IEnvironmentProvider environmentProvider)
- {
- if (Utility.RunningOnWindows)
- {
- // Only enable telemetry if the user has opted into it in Visual Studio
- TelemetryService.DefaultSession.UseVsIsOptedIn();
-
- if (TelemetryService.DefaultSession.IsOptedIn)
- {
- _telemetrySession = TelemetryService.DefaultSession;
-
- GitRepositoryInfo repositoryInfo = GitRepositoryInfo.GetRepoInfoForCurrentDirectory(environmentProvider);
-
- if (repositoryInfo?.Origin != null)
- {
- TelemetryContext context = _telemetrySession.CreateContext("GitRepository");
-
- context.SharedProperties["VS.TeamFoundation.Git.OriginRemoteUrlHashV2"] = new TelemetryPiiProperty(repositoryInfo.Origin);
- }
- }
- }
- }
-
- ///
- public void Dispose()
- {
- try
- {
- _telemetrySession?.DisposeToNetworkAsync(CancellationToken.None).Wait(TimeSpan.FromSeconds(2));
- }
- catch (AggregateException e) when (e.InnerException is PlatformNotSupportedException)
- {
- // Ignored
- }
- catch (PlatformNotSupportedException)
- {
- // Ignored
- }
- }
-
- ///
- /// Posts an event to the telemetry pipeline if available.
- ///
- /// The name of the event.
- /// An containing the event properties.
- /// An containing the event properties containing personally identifiable information (PII).
- /// true
if the event was successfully posted, otherwise false
.
- public bool PostEvent(string name, IDictionary properties, IDictionary piiProperties = null)
- {
- if (_telemetrySession == null)
- {
- return false;
- }
-
- TelemetryEvent telemetryEvent = new TelemetryEvent($"microsoft/slngen/{name}");
-
- foreach (KeyValuePair property in properties)
- {
- telemetryEvent.Properties[property.Key] = property.Value;
- }
-
- if (piiProperties != null)
- {
- foreach (KeyValuePair property in piiProperties)
- {
- if (property.Value != null)
- {
- telemetryEvent.Properties[property.Key] = new TelemetryPiiProperty(property.Value);
- }
- }
- }
-
- Task.Run(() =>
- {
- if (_telemetrySession != null && !_telemetrySession.IsDisposed)
- {
- _telemetrySession?.PostEvent(telemetryEvent);
- }
- });
-
- return true;
- }
-
- ///
- /// Posts an exception event to the telemetry pipeline if available.
- ///
- /// The that occurred.
- /// true
if the event was successfully posted, otherwise false
.
- public bool PostException(Exception exception)
- {
- if (_telemetrySession == null)
- {
- return false;
- }
-
- _telemetrySession.PostFault("microsoft/slngen/exception", string.Empty, FaultSeverity.Critical, exception);
-
- return true;
- }
- }
-}
\ No newline at end of file
diff --git a/version.json b/version.json
index c5ee34e7..7b9f0a6c 100644
--- a/version.json
+++ b/version.json
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
- "version": "9.6",
+ "version": "10.0",
"assemblyVersion": "3.0",
"buildNumberOffset": -1,
"publicReleaseRefSpec": [