问题描述
大家好,
Hi All,
我想在旧的Win.Forms桌面应用程序中使用App Insights作为试用版但我的理解是,如果我决定取消该服务,我需要删除所有代码并发布我的软件的新版本
(我不想这样做)。
I want to use App Insights in an old Win.Forms desktop application as a trial but my understanding is that if I ever decide to cancel the service, I need to remove all the code and release a new version of my software(which I don't want to do).
有没有人有这方面的经验或者可以提供任何解决方案?
Does anyone have any experience with this or can offer any solutions?
提前致谢!
推荐答案
感谢您使用Application Insights! 作为一种快速解决方案,:
Thank you for using Application Insights! As a quick solution, you can set TelemetryConfiguration.Active.DisableTelemetry:
TelemetryConfiguration.Active.DisableTelemetry = true;
如果你们都希望完全删除所有应用程序的痕迹Insights,我的建议是在安装Application Insights之前和之后获得差异(这是我们正在努力改进的过程)。 我们有一个常见问题解答,涵盖
,更详细地添加到您的项目中的内容可以在这里找到:
If you every want to completely removal of all traces of Application Insights, my recommendation would be to get a diff prior to and after installation of Application Insights (this is a process we are working on improving). We have an FAQ that covers exactly what is added to your project in more detail which can be found here:
https://docs.microsoft.com/en-us/azure/azure-monitor/app/troubleshoot-faq#q14
详细信息取决于项目。对于Web应用程序:
The details depend on the type of project. For a web application:
-
将这些文件添加到您的项目中:
Adds these files to your project:
- ApplicationInsights.config。
- ai.js
安装这些NuGet包:
Installs these NuGet packages:
-
Application Insights API - 核心API
Application Insights API - the core API
适用于Web应用程序的Application Insights API s - 用于从服务器发送遥测
Application Insights API for Web Applications - used to send telemetry from the server
适用于JavaScript应用程序的Application Insights API - 用于从客户端发送遥测
Application Insights API for JavaScript Applications - used to send telemetry from the client
包包括这些程序集:
Microsoft.ApplicationInsights
Microsoft.ApplicationInsights
Microsoft.ApplicationInsights.Platform
Microsoft.ApplicationInsights.Platform
将项目插入:
- Web.config
- packages.config
(仅限新项目 - 如果您将Application Insights添加到现有项目,您必须手动执行此操作。)将片段插入客户端
和服务器代码以进行初始化它们带有Application Insights资源ID。例如,在MVC应用程序中,代码被插入到母版页中Views / Shared / _Layout.cshtml
(New projects only - if you add Application Insights to an existing project, you have to do this manually.) Inserts snippets into the client and server code to initialize them with the Application Insights resource ID. For example, in an MVC app, code is inserted into the master page Views/Shared/_Layout.cshtml
这篇关于如何在不发布新版软件的情况下测试App Insights的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!