You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/remove-application-insights.md
+85-49Lines changed: 85 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,13 +10,11 @@ ms.date: 03/25/2020
10
10
11
11
This article will show you how to remove the ASP.NET and ASP.NET Core Application Insights SDK in Visual Studio.
12
12
13
-
## ASP.NET
13
+
To remove Application Insights, you'll need to remove the NuGet packages and references from the API in your application. You can remove NuGet packages by using the Package Management Console or Manage NuGet Solution in Visual Studio. The following sections will show you how to remove NuGet Packages and what was automatically added in your project. Be sure to confirm the files added and areas with in your own code in which you made calls to the API are removed.
14
14
15
-
To remove Application Insights, you'll need to remove the NuGet packages and references from the API in your application.
15
+
## What is created when you add Application Insights
16
16
17
-
You can remove ASP.NET NuGet packages by using the Package Management Console or Manage NuGet Solution in Visual Studio. The following sections will show you how to remove NuGet Packages and what was automatically added in your project. Be sure to confirm the files added and areas with in your own code in which you made calls to the API are removed.
18
-
19
-
### ASP.NET: What is created when you add Application Insights
17
+
# [.NET](#tab/net)
20
18
21
19
When you add Application Insights Telemetry to a Visual Studio ASP.NET template project, it adds the following files:
22
20
@@ -98,47 +96,7 @@ The following pieces of code are added:
98
96
}
99
97
```
100
98
101
-
### ASP.NET: Using the Package Management Console
102
-
103
-
1. To open the Package Management Console, in the top menu select Tools > NuGet Package Manager > Package Manager Console.
104
-
105
-

106
-
1. Enter the following command: `Uninstall-Package Microsoft.ApplicationInsights.Web -RemoveDependencies`
107
-
108
-
After entering the command, the Application Insights package and all of its dependencies will be uninstalled from the project.
109
-
110
-

111
-
112
-
### ASP.NET: Using the Visual Studio NuGet UI
113
-
114
-
1. In the *Solution Explore* on the right, right click on **Solution** and select **Manage NuGet Packages for Solution**
115
-
You'll then see a screen that allows you to edit all the NuGet packages that are part of the project.
116
-
117
-

118
-
119
-
1. Click on the "Microsoft.ApplicationInsights.Web" package. On the right, check the checkbox next to **Project** to select all projects.
120
-
121
-
1. To remove all dependencies when uninstalling, select the **Options** dropdown button below the section where you selected project.
122
-
123
-
Under *Uninstall Options*, select the checkbox next to *Remove dependencies*.
124
-
125
-
1. Select Uninstall
126
-
127
-

128
-
129
-
A dialog box will display that shows all of the dependencies to be removed from the application. Select **ok** to remove them.
130
-
131
-

132
-
133
-
1. After everything is uninstalled, you may still see "ApplicationInsights.config" and "AiHandleErrorAttribute.vb" in the *Solution Explore*. You can delete the two files manually.
134
-
135
-
## ASP.NET Core
136
-
137
-
To remove Application Insights, you'll need to remove the NuGet packages and references from the API in your application.
138
-
139
-
You can remove ASP.NET Core NuGet packages by using the Package Management Console or Manage NuGet Solution in Visual Studio. The following sections will show you how to remove NuGet Packages and what was automatically added in your project. Be sure to confirm the files added and areas with in your own code in which you made calls to the API are removed.
140
-
141
-
### ASP.NET Core: What is created when you add Application Insights
99
+
# [.NET Core](#tab/netcore)
142
100
143
101
When you add Application Insights Telemetry to a Visual Studio ASP.NET Core template project, it adds the following code:
144
102
@@ -186,14 +144,56 @@ When you add Application Insights Telemetry to a Visual Studio ASP.NET Core temp
186
144
}
187
145
```
188
146
189
-
### ASP.NET Core: Using the Package Management Console
Ifyouendupwithanothererrorthatyoucan't uninstall "Microsoft.ApplicationInsights.TraceListener" because another package or packages depend on it you can look through those packages and find one that doesn'tdoesnotdependonanythingtobeuninstalledfirst.
GobacktouninstallMicrosoft.ApplicationInsights.Webbutthistimein*UninstallOptions*select"Force uninstall even if there are dependencies on it" ("Remove dependencies"shouldstillbeselected). Thiswilluninstallthepackageevenifit's still being referenced in the project. This option could lead to broken reference in your project; if that happens you make need to [reinstall](https://docs.microsoft.com/nuget/consume-packages/reinstalling-and-updating-packages) those other packages. Then uninstall "Microsoft.ApplicationInsights.TraceListener".
IfyouwouldliketoonlyuninstallMicrosoft.ApplicationInsights.TraceListener, followthestepsin"Unable to uninstall because another NuGet package depends on it error"butinsteadforceuninstallingMicrosoft.ApplicationInsights.Web, forceuninstall"Microsoft.ApplicationInsights.TraceListener".
0 commit comments