# Procedure to Instrument APM agent for ASP.Net based application

**URL:** <https://discuss.elastic.co/t/procedure-to-instrument-apm-agent-for-asp-net-based-application/273959>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [May 25, 2021, 2:36pm UTC](https://discuss.elastic.co/t/procedure-to-instrument-apm-agent-for-asp-net-based-application/273959 "2021-05-25T14:36:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdamera](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@mdamera](https://discuss.elastic.co/u/mdamera)\
**Post date:** [May 25, 2021, 2:36pm UTC](https://discuss.elastic.co/t/procedure-to-instrument-apm-agent-for-asp-net-based-application/273959/1 "2021-05-25T14:36:26Z")

</div>

Team,

For the first time I am trying to instrument APM for [ASP.NET](http://ASP.NET) application, would like to understand the Process to do this, from ELK documentation I could see we need to download the package from ([https://nuget.org/](https://nuget.org/)), however after downloading it , I do not understand what steps we need to follow to install it on Windows OS ?

Second question is -

From docs I can see we need to enable auto instrumentation by including the `ElasticApmModule` IIS Module in your application’s `web.config` :

With this, How my agent knows whicch APM server it has to talk ?

If some one quickly summarizes what it takes to onboard ASP\>net application it would be a great help for me

\<?xml version="1.0" encoding="utf-8"?\>

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [May 25, 2021, 3:38pm UTC](https://discuss.elastic.co/t/procedure-to-instrument-apm-agent-for-asp-net-based-application/273959/2 "2021-05-25T15:38:16Z")

</div>

Hi @mdamera ,

NuGet is the standard package manager for .NET applications, and the agent is shipped as a NuGet package. So you need to add the agent package to your application. [Here](https://docs.microsoft.com/en-us/nuget/quickstart/install-and-use-a-package-in-visual-studio) is a doc from Microsoft on how to do it (it shows a different package, but it's a good source to understand NuGet). One prerequisite here is that you'll need to have access to the source code. We have a way to do it without recompiling, but that's only supported for .NET Core (from what you write I assume you are on the old .NET Framework) - docs on zero code change (.NET Core only) [here](https://www.elastic.co/guide/en/apm/agent/dotnet/current/setup-dotnet-net-core.html#zero-code-change-setup).

> How my agent knows whicch APM server it has to talk ?

You can look at [this sample `web.config` file](https://github.com/elastic/apm-agent-dotnet/blob/master/sample/AspNetFullFrameworkSampleApp/Web.config#L20) - similarly to those settings you can add `ElasticApm:ServerUrl` and set `value=[Url to your server]`.

I hope this helps.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 15, 2021, 11:38am UTC](https://discuss.elastic.co/t/procedure-to-instrument-apm-agent-for-asp-net-based-application/273959/3 "2021-06-15T11:38:35Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
