Skip to content

Commit

Permalink
Remove telemetry collection (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkl authored May 3, 2023
1 parent 490a9aa commit b0ff4a1
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 190 deletions.
1 change: 0 additions & 1 deletion Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<PackageReference Update="Microsoft.VisualStudio.ProjectSystem.SDK" Version="15.8.243" />
<PackageReference Update="Microsoft.VisualStudio.SDK" Version="17.5.33428.388" />
<PackageReference Update="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.5.2145" />
<PackageReference Update="Microsoft.VisualStudio.Telemetry" Version="16.6.9" />
<PackageReference Update="Microsoft.VSSDK.BuildTools" Version="17.5.4074" />
<PackageReference Update="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Update="MSBuild.ProjectCreation" Version="10.0.0" />
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [[email protected]](mailto:[email protected]) 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)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<PackageReference Include="Microsoft.Build.Runtime" IncludeAssets="None" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Build.Utilities.Core" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" />
<PackageReference Include="Microsoft.VisualStudio.Telemetry" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="MSBuild.ProjectCreation" />
<PackageReference Include="Newtonsoft.Json" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<PackageReference Include="Microsoft.Build.Runtime" IncludeAssets="None" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Build.Utilities.Core" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" />
<PackageReference Include="Microsoft.VisualStudio.Telemetry" />
<PackageReference Include="System.Configuration.ConfigurationManager" ExcludeAssets="Runtime" />
</ItemGroup>
<ItemGroup>
Expand Down
49 changes: 0 additions & 49 deletions src/Microsoft.VisualStudio.SlnGen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -35,8 +34,6 @@ static Program()
Debugger.Launch();
}

TelemetryClient = new TelemetryClient();

CurrentAssembly = Assembly.GetExecutingAssembly();

CurrentAssemblyFileInfo = new FileInfo(CurrentAssembly.Location);
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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<ILogger> GetLoggers(ConsoleForwardingLogger consoleLogger, ProgramArguments arguments)
Expand Down Expand Up @@ -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<string, object>
{
["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);
Expand Down
132 changes: 0 additions & 132 deletions src/Microsoft.VisualStudio.SlnGen/TelemetryClient.cs

This file was deleted.

2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down

0 comments on commit b0ff4a1

Please sign in to comment.