# ASP.NET on .NET Framework in IIS 10 Configuration (not working)

**URL:** <https://discuss.elastic.co/t/asp-net-on-net-framework-in-iis-10-configuration-not-working/320137>\
**Category:** APM\
**Tags:** dotnet, language-clients\
**Created:** [November 30, 2022, 10:43am UTC](https://discuss.elastic.co/t/asp-net-on-net-framework-in-iis-10-configuration-not-working/320137 "2022-11-30T10:43:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![aysekisik\_kisilan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aysekisik_kisilan/32/104385_2.png) [@aysekisik\_kisilan](https://discuss.elastic.co/u/aysekisik_kisilan)\
**Post date:** [November 30, 2022, 10:43am UTC](https://discuss.elastic.co/t/asp-net-on-net-framework-in-iis-10-configuration-not-working/320137/1 "2022-11-30T10:43:30Z")

</div>

Hi,  
I wanted to test apm .net but I couldn't run the MVC [ASP.NET](http://ASP.NET) .net framework (with Profiler Auto instrumentation). Do I need any code changes?

I followed the general steps here for IIS10

> **[Profiler Auto instrumentation | APM .NET Agent Reference \[1.x\] | Elastic](https://www.elastic.co/guide/en/apm/agent/dotnet/current/setup-auto-instrumentation.html)**

 ![app-pool](https://us1.discourse-cdn.com/elastic/original/3X/5/d/5d89764abf6b9b4499664855d64296e5754faed5.png)

**Kibana version** : 8.5.1

**Elasticsearch version** : 8.5.1

**APM Server version** : elastic\_apm\_profiler\_1.18.0

---

<div class="post-metadata">

**Author:** ![Wolfgang\_Ziegler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfgang_ziegler/32/109929_2.png) [@Wolfgang\_Ziegler](https://discuss.elastic.co/u/Wolfgang_Ziegler)\
**Post date:** [December 1, 2022, 6:54am UTC](https://discuss.elastic.co/t/asp-net-on-net-framework-in-iis-10-configuration-not-working/320137/2 "2022-12-01T06:54:40Z")

</div>

Hi @aysekisik_kisilan,

could you give me more details on the issue you are experiencing?  
Do you see anything in Kibana (e.g. Service, metrics but no transactions) or don't you see anything?

The [troubleshooting page](https://www.elastic.co/guide/en/apm/agent/dotnet/current/troubleshooting.html) explains how to collect agent logs. If you could attach those, this would be helpful.

---

<div class="post-metadata">

**Author:** ![aysekisik\_kisilan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aysekisik_kisilan/32/104385_2.png) [@aysekisik\_kisilan](https://discuss.elastic.co/u/aysekisik_kisilan)\
**Post date:** [December 1, 2022, 1:15pm UTC](https://discuss.elastic.co/t/asp-net-on-net-framework-in-iis-10-configuration-not-working/320137/3 "2022-12-01T13:15:40Z")

</div>

Hi ,  
ElasticApmAgentStartupHook logs

No compatible agent for System.Diagnostics.DiagnosticSource 7.0.0.0. Agent not loaded  
No Elastic.Apm.StartupHook.Loader.dll assembly loaded. Agent not loaded  
Get Elastic.Apm.StartupHook.Loader.Loader type

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/3/f33c6a49f5e2f62d5c86e28771ec99ba0d1e3c4f.png)

I am getting this error for APM .net core.  
Also Apm .NET framework does not work at all

Thank you

---

<div class="post-metadata">

**Author:** ![Wolfgang\_Ziegler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfgang_ziegler/32/109929_2.png) [@Wolfgang\_Ziegler](https://discuss.elastic.co/u/Wolfgang_Ziegler)\
**Post date:** [December 1, 2022, 1:39pm UTC](https://discuss.elastic.co/t/asp-net-on-net-framework-in-iis-10-configuration-not-working/320137/4 "2022-12-01T13:39:03Z")

</div>

Hi @aysekisik_kisilan,

it looks like you are using `DOTNET_STARTUP_HOOKS` as well.  
However, `DOTNET_STARTUP_HOOKS` is not yet ready for .NET 7 (see this [issue](https://github.com/elastic/apm-agent-dotnet/issues/1900)).  
However, we are working on that at the moment and a new agent release with .NET 7 support should be available soon.

Are you using the profiler as well? You should not use both approaches (`DOTNET_STARTUP_HOOKS` and the profiler) in the same process.

---

<div class="post-metadata">

**Author:** ![aysekisik\_kisilan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aysekisik_kisilan/32/104385_2.png) [@aysekisik\_kisilan](https://discuss.elastic.co/u/aysekisik_kisilan)\
**Post date:** [December 2, 2022, 7:35pm UTC](https://discuss.elastic.co/t/asp-net-on-net-framework-in-iis-10-configuration-not-working/320137/5 "2022-12-02T19:35:44Z")

</div>

I'm sorry for the late reply,

I was trying in net 6 for testing. DOTNET\_STARTUP\_HOOKS then for .NET 7 I guess. thank you.  
I saw this here ([zero code change setup](https://www.elastic.co/guide/en/apm/agent/dotnet/current/setup-dotnet-net-core.html) )(.NET5+)

2).NET Framework 4.6.1+

I am using a simple application for IIS. I was using this for the .NET Framework 4.6.1+  
(IIS 10), but Services, traces, and metrics do not show up on APM server.

```auto
$appcmd = "$($env:systemroot)\system32\inetsrv\AppCmd.exe"
$appPool = "<application-pool>" 
$profilerHomeDir = "<unzipped directory>" 
$environment = @{
  COR_ENABLE_PROFILING = "1"
  COR_PROFILER = "{FA65FE15-F085-4681-9B20-95E04F6C03CC}"
  COR_PROFILER_PATH = "$profilerHomeDir\elastic_apm_profiler.dll"
  ELASTIC_APM_PROFILER_HOME = "$profilerHomeDir"
  ELASTIC_APM_PROFILER_INTEGRATIONS = "$profilerHomeDir\integrations.yml"
  COMPlus_LoaderOptimization = "1" 
}

$environment.Keys | ForEach-Object {
  & $appcmd set config -section:system.applicationHost/applicationPools /+"[name='$appPool'].environmentVariables.[name='$_',value='$($environment[$_])']"
}

```

This error

`[system.application][error] .NET Runtime version 4.0.30319.0 - Failed to load profiler during CoCreateInstance. Profiler CLSID: '{FA65FE15-F085-4681-9B20-95E04F6C03CC}'. HRESULT: 0x800700c1. Process ID (decimal): 3656. Message ID: [0x2504].`

---

<div class="post-metadata">

**Author:** ![Wolfgang\_Ziegler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfgang_ziegler/32/109929_2.png) [@Wolfgang\_Ziegler](https://discuss.elastic.co/u/Wolfgang_Ziegler)\
**Post date:** [December 5, 2022, 9:29am UTC](https://discuss.elastic.co/t/asp-net-on-net-framework-in-iis-10-configuration-not-working/320137/6 "2022-12-05T09:29:13Z")

</div>

Hi @aysekisik_kisilan,

is your application 32-bit by any chance? The Profiler only works for 64-bit applications.

If you need this feature (32-bit), here is a [GitHub issue](https://github.com/elastic/apm-agent-dotnet/issues/1866) for it. If you leave a comment, this helps us aligning our priorities.

---

<div class="post-metadata">

**Author:** ![aysekisik\_kisilan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aysekisik_kisilan/32/104385_2.png) [@aysekisik\_kisilan](https://discuss.elastic.co/u/aysekisik_kisilan)\
**Post date:** [December 5, 2022, 2:07pm UTC](https://discuss.elastic.co/t/asp-net-on-net-framework-in-iis-10-configuration-not-working/320137/7 "2022-12-05T14:07:04Z")

</div>

this worked. thank you !!

---

<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:** [December 26, 2022, 10:07am UTC](https://discuss.elastic.co/t/asp-net-on-net-framework-in-iis-10-configuration-not-working/320137/8 "2022-12-26T10:07:21Z")

</div>

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