On Visual Studio I added application insight to a project which creates a ApplicationInsights.config and not sure what other files were added to the project.
Thing is, doing right click and press Add Application Insight was pretty straight forward. Now I'm looking with no success a way to remove the application insight for that project.
How can I achieve that ?
On production server, using DebugView, I see the telemetry logs, even after shutting down the Application Monitor Services on the server.
Any help is appreciated, I want to completely get rid of application insight on that application.
I just wanted to add to the answers already given, having just gone through this process with an ASP.NET MVC 5 project.
Uninstall Using NuGet
As the other answers say, the best way to remove Application Insights is through Nuget: Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution.
I found it best to remove Microsoft.ApplicationInsights.Web and all its dependencies first, then Microsoft.ApplicationInsights.Javascript API.
This removed everything except:
the ApplicationInsights.config file,
a script snippet in _Layout.cshtml,
both of which I removed manually.
What Microsoft has to say
The Microsoft Azure documentation here: https://azure.microsoft.com/en-gb/documentation/articles/app-insights-troubleshoot-faq/, says:
What does Application Insights modify in my project?
The details depend on the type of project. For a web application:
Adds these files to your project:
ApplicationInsights.config.
ai.js
Installs these NuGet packages:
Application Insights API - the core API
Application Insights API for Web Applications - used to send telemetry from the server
Application Insights API for JavaScript Applications - used to send telemetry from the client
The packages include these assemblies:
Microsoft.ApplicationInsights
Microsoft.ApplicationInsights.Platform
Inserts items into:
Web.config
packages.config (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
Remove Manually
To remove Application Insights without NuGet, or if like me you don't trust it and want to know which files are removed, I followed these steps:
Remove application insights from the web.config, under system.webserver.modules, search for ApplicationInsightsWebTracking.
Remove all Microsoft.AI (Application Insights) prefixed references from project references.
Remove all Microsoft.ApplicationInsights packages from package.config.
Delete ApplicationInsights.config file.
Remove script from _Layout.cshtml:
var appInsights=window.appInsights||function(config){
function r(config){t[config]=function(){var i=arguments;t.queue.push(function(){t[config].apply(t,i)})}}var t={config:config},u=document,e=window,o="script",s=u.createElement(o),i,f;for(s.src=config.url||"//az416426.vo.msecnd.net/scripts/a/ai.0.js",u.getElementsByTagName(o)[0].parentNode.appendChild(s),t.cookie=u.cookie,t.queue=[],i=["Event","Exception","Metric","PageView","Trace"];i.length;)r("track"+i.pop());return r("setAuthenticatedUserContext"),r("clearAuthenticatedUserContext"),config.disableExceptionTracking||(i="onerror",r("_"+i),f=e[i],e[i]=function(config,r,u,e,o){var s=f&&f(config,r,u,e,o);return s!==!0&&t["_"+i](config,r,u,e,o),s}),t
}({
instrumentationKey:"RemovedKey"
});
window.appInsights=appInsights;
appInsights.trackPageView();
Remove ai.0.15.0-build58334.js & ai.0.15.0-build58334.min.js from Scripts directory.
Clean & Rebuild all.
Unless I'm misunderstanding the question, you should only have to remove one extension and possibly one nuget package.
Uninstall the Application Insights Tools for Visual Studio extension and remove the Application Telemetry SDK for Services nuget package. The telemetry package is installed along with Application Insights but must be removed separately.
In my experience the telemetry package is not required if you wish to keep using Application Insights' other features. Removing the telemetry package will stop all telemetry logging but Application Insights will continue to report non-telemetry information just fine.
I would prefer to do this:
UnInstall-Package Microsoft.ApplicationInsights.Web -RemoveDependencies
If you use the NuGet Package Manager for the solution (Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution) you can search for ApplicationInsights and uninstall the package, and there is an option to remove dependencies. There may be several. This is the easiest way to cleanup ALL the dependencies, not just some.
With a new ASP.Net Core 1.1 project:
Remove the Microsoft.ApplicationInsights.AspNetCore nuget package
Remove inject Microsoft.ApplicationInsights.AspNetCore.JavaScriptSnippet JavaScriptSnippet from the _Layout.cshtml page
Remove #Html.Raw(JavaScriptSnippet.FullScript) from _Layout.cshtml
Remove .UseApplicationInsights()from program.cs
I solved this by first uninstalling all Application Insight packages from (Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution)
Then ran
Uninstall-Package Microsoft.AspNet.TelemetryCorrelation -Version 1.0.0 -RemoveDependencies
in the Nuget console.
That fixed it for me.
Related
Background:
I have several ASP.NET projects under one solution file. I have a build pipeline for ASP.NET projects and building it with .sln.
Now, we have added a new project to the same .sln which is in .NET CORE.
Problem statement:
In my build pipeline, when I try to build the whole solution, it throws an exception to the newly added project. (.NET CORE)
"The type or namespace name 'Entity' does not exist in the namespace
'System.Data' (are you missing an assembly reference?)"
I believe this is due to framework versions.
Question:
Is it possible to have both projects under one build pipeline, if yes, how can I achieve it? if not, what would be the ideal solution?
Additional information: From the visual studio, everything is building and working fine, but I build the project pipeline it's throwing this error.
Initially build the code from visual studio to avoid errors while building in the azure pipeline.
Used different projects in azure pipeline
Create a repository using Visual Studio or Azure Devops.
Fill the necessary fields while creating a repository
Then it enters into a Git Credential Manager screen and have to choose the account from which you want to create and proceed further.
Create branches if required.
Using Visual Studio, we can sync and push the changes made from the specific branch
Create a pipeline with azure subscription and build the code.
Refer this link for more info.
You could add a reference to System.Data.Entity to test if the exception is thrown again.
Or you could refer to this document for more details about Organize your project to support both .NET Framework and .NET
================================================================
updated on 11/30
This error message indicates the build process can't find the assemblies coming from the restored nuget packages. So you should check the log of the restore task in build-pipeline to make sure the packages are restored successfully.
Make sure you have use nuget tool install and nuget restore tasks before your build task like this, if your build include private feed, please add the nuget authenticate task to restore the project correctly. (Avoid using dotnet related tasks cause your project targets .net framework, and dotnet task could not recognize .sln projects)
I was able to resolve this by updating the NuGet package version for the pipeline. Same as the application version.
Application Insight is working perfectly fine on local dev but giving issue on server with the Status Monitor. Following is the error:
The application is using an older version of Application Insights for
the Visual Studio Online. Remove ApplicationInsights.config and
Application Insights Nuget package references from your project and
Application Insights to your project using Visual Studio 2013 Update 3
or later.
I followed above instruction same result. Mainly I followed this article but I have also tried the following:
Make a copy of ApplicationInsights.config if you customized ApplicationInsights.config.
In Solution Explorer, right-click your project and choose Manage NuGet packages.
Select Browse.
Search for Microsoft.ApplicationInsights.Web, select it and choose Install/Update. You need version 2.2.0 (or later).
Reinstate any customizations you made to ApplicationInsights.config. Most of the changes you'll see when you compare the files are because we removed some modules and made others parameterizable.
Rebuild your solution.
It didn't work.
Is there a way to deploy asp net application with dexexpress components other than using virtual machine with installed libs on it?
I want to deploy it to azure websites but get an error that .dll are missing (dont get that error during debugging on localhost where devexpress installed).
Be sure, that you marked the referenced assemblies that you want to publish on the vm as "copy local = true". You can find that option in the properties of a reference.
The output folder of your web app will be automatically copied over to azure websites. For more information how web pages are packaged have a look How to: Create a Web Deployment Package in Visual Studio
You can try one of these options:
Find a NuGet package which includes the dll's you need. I don't know which components you use but NuGet contains a lot of packages -> https://www.nuget.org/packages?q=devexpress
Include the dll's you need in a 3thPartyLib in your project and then reference these assemblies (with copy local = true) from your project.
Be sure to include the license file in your deployment.
In Visual Studio 2015, when selecting a Web API template, we can now select No authentication, Individual User Accounts, Organizational Accounts, or Windows Authentication. Visual Studio then generates large quantities of code and includes many nugget packages automatically.
If I already have an ASP.NET Web API project without authentication, is it possible to add all of the generated code and packages for one of these authentication options without having to rebuild the solution from scratch or manually add each package?
Thanks -
If you use the nuget package manager to search for identity you should be able to install it from there. There is an equivalent nuget command line incantation for nuget too:
Install-Package Microsoft.AspNet.Identity.Samples -Pre
Be careful though. The current version is prerelease and it may also install a number of dependent components Which may cause issues.
As with all such things, taking a full backup of the solution before starting the process is advisable!
I read about Web API having its own TraceWriter implementation with 2012.2, for example here, among other sources.
I am now using VS2013 with .NET 4.5.1 and the EnableSystemDiagnosticsTracing is nowhere to be found. It's meant to be defined in the HttpConfigurationTracingExtensions class which resides in the System.Web.Http.Tracing.dll. However, this assembly is nowhere to be found - not in list of assemblies in the Add Reference dialog, not in GAC.
Where is this assembly supposed to come from? Docs say it's part of .NET Framework 4, which I have installed. Also installed the ASP.NET Web API 2 Tracing 5.0.0 NuGet package. Is there some update? Should I re-install .NET Framework?
I know it's not a big deal to implement ITraceWriter myself but it bothers me not to know what happened with the built-in implementation.
Just install needed NuGet Package
Install-Package Microsoft.AspNet.WebApi.Tracing -Version 5.0.0
It's a little bit strange, but it is the right package
http://www.nuget.org/packages/microsoft.aspnet.webapi.tracing
If you installed the Tracing 5.0.0 NuGet package, it should be correctly included in your project. The moment it is installed, I believe a separate text file should open in VS showing the code you should include in your WebApiConfig.cs file.
I haven't created a Web API 2 project from scratch (only upgraded from pre-5.0 to 5.0 projects), but this is the code that should reside in your WebApiConfig.cs file:
// To disable tracing in your application, please comment out or remove the following line of code
// For more information, refer to: http://www.asp.net/web-api
config.EnableSystemDiagnosticsTracing();
And that should be it, if the package is installed correctly, tracing should now be used in your project.