Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in Azure Web App Virtual Directory: "Could not load file or assembly 'Microsoft.AspNet.TelemetryCorrelation' or one of its dependencies." #21

Open
BryanWilhite opened this issue Oct 27, 2017 · 19 comments

Comments

@BryanWilhite
Copy link

In an Azure Virtual Directory with just index.html and a minimal Web.config throws this error:

Could not load file or assembly 'Microsoft.AspNet.TelemetryCorrelation' or one of its dependencies.

This error is thrown when navigating to / instead of /index.html. An error will occur when Web.config is not present (but no error message is shown).

The parent/root application is, of course, configured for App Insights telemetry. Is this expected behavior for an expected error condition? Do we need to have App Insights installed for every Virtual Directory?

BTW: this is the minimal Web.config:

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>
@SergeyKanzhelev
Copy link
Contributor

@BryanWilhite few questions:

  • what framework you application was compiled against?
  • where app deployed? Local IIS or Azure Web App?
  • was Application Insights enabled from Visual Studio or using Status Monitor or Azure WebApp extension?

@BryanWilhite
Copy link
Author

@SergeyKanzhelev this was on Azure configured for .NET and Application Insights was enabled from Visual Studio.

@SergeyKanzhelev
Copy link
Contributor

So you enabled Application Insights and then cleaned up web.config? Or config wasn't properly updated?

BTW, do you call Application Insights explicitly? If not - I wonder how it got initialized at all without the mention of Application Insights http module there.

(What FW version? 4.6?)

@BryanWilhite
Copy link
Author

steps to repeat:

  • set up a root Web App in Azure with Application Insights
  • add virtual directory, /foo, under the root Web App with the index.html and Web.config mentioned above

I expect that going to /foo would just display index.html. This is not happening for me.

@SergeyKanzhelev
Copy link
Contributor

@clguimanMSFT, @iusafaro can you please take a look

@clguiman
Copy link

@BryanWilhite What do you mean by "set up a root Web App in Azure with Application Insights"?
Did you click on "Configure Application Insights" from the project contextual menu in Visual Studio? Or did you select an Application Insights resource when publishing the Web App?

@SergeyKanzhelev
Copy link
Contributor

@BryanWilhite
Copy link
Author

Let's go with click on "Configure Application Insights" from the project contextual menu in Visual Studio; let's assume the simplest Visual-Studio-based scenario so misunderstanding does not run wild.

@Guiroux555
Copy link

I have the same problem. I have an ASP.NET WebSite with ApplicationInsight installed and a virtual application configured. A simple html file in the application. If i load the file with absolute URL, it work but not if i load the racine of the virtual application

@vikram77
Copy link

@BryanWilhite i had the same issue and a quick workaround was to add Microsoft.AspNet.TelemetryCorrelation package to the virtual application. This resolved the issue for me. Hope that works for you.

@Michaelvsk
Copy link

Hi,

any updates on this topic? Currently facing the exact same problem. I have a ASP.NET (.NET Framework) based application using AppInsights deployed to the root virtual application and a NodeJS App running inside another virtual application using AppInsights, too.
Both work when deployed to seperate app services but when using a virtual application, I get the same error as Bryan for the non-root virtual app.

@SergeyKanzhelev
Copy link
Contributor

@clguimanMSFT @Mikhail-Pranovich can you please confirm that the next release with the global module will address this issue? If not - can you please track this issue and give updates?

@Mikhail-msft
Copy link
Contributor

@SergeyKanzhelev, the issue is not related to WebApps ApplicationInsights extension, and is not related to ApplicationInsights SDK. According to repro I saw this is purely within 'Microsoft.AspNet.TelemetryCorrelation' where if it is used in web.config of root application, the subapplication would try to load it as well.

@denisky
Copy link

denisky commented Jul 4, 2019

Hi,
I had the same issue, our root web site is using ASP.NET MVC with ApplicationInsights and a virtual application in Vue.js.

My solution was to add the following to the Web.Config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="false">
      <remove name="TelemetryCorrelationHttpModule" />
      <remove name="ApplicationInsightsWebTracking" />
    </modules> 
  </system.webServer>
</configuration>

@ptorkaman
Copy link

Hi,
i had same problem and i install with nuget package manages and brows Microsoft.AspNet.TelemetryCorrelation and installed it

@jwisener
Copy link

jwisener commented Jul 8, 2020

Is this still an on going issue for over 3 years now?

@boyukbas
Copy link

Hi,
I had the same issue, our root web site is using ASP.NET MVC with ApplicationInsights and a virtual application in Vue.js.

My solution was to add the following to the Web.Config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="false">
      <remove name="TelemetryCorrelationHttpModule" />
      <remove name="ApplicationInsightsWebTracking" />
    </modules> 
  </system.webServer>
</configuration>

I was having a similar problem and that worked for me. Thanks

@jordanrbaker
Copy link

jordanrbaker commented Apr 20, 2022

@Mikhail-msft - FYSA, this bug still exists and was observed on 04/20/2022.

The solution offered by @boyukbas was successful in resolving our issue.

@raelshark
Copy link

Still the same in Dec 2023. Virtual applications under Azure App Service web apps using TelementryCorreletion also try to load this library.

I also solved it with the modules config solution from denisky above. Doesn't seem like it should be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests