Code Monkey home page Code Monkey logo

Comments (15)

valeriob avatar valeriob commented on May 17, 2024 1

I like it because it's automatically enabled via env variable on production environment, so it will not run during development, and it's non invasive, can be enabled/disabled in prod without code deploy.

from applicationinsights-profiler-aspnetcore.

xiaomi7732 avatar xiaomi7732 commented on May 17, 2024 1

@valeriob Oh~ that is why. That makes sense. I'll look into how to get that fixed.

from applicationinsights-profiler-aspnetcore.

xiaomi7732 avatar xiaomi7732 commented on May 17, 2024

@valeriob, Thanks for your report. Hosting startup is not supported in 2.0.0-beta1. Please follow the example of Quick Start to enable Profiler.

Also, could you please tell us what is the reason for you to choose to use hosting startup? It will help us decide what's the next priority.

Thanks!

from applicationinsights-profiler-aspnetcore.

xiaomi7732 avatar xiaomi7732 commented on May 17, 2024

Thanks @valeriob for your feedback. Just in case you don't know, this environment variable can be used as a kill switch of the profiler:

ServiceProfiler__IsDisabled

Check out the documentation: Configuration References.

from applicationinsights-profiler-aspnetcore.

valeriob avatar valeriob commented on May 17, 2024

I'm trying 2.0.0-beta2, but it does not work with dotnet core 3.0, i get this error during startup :

System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Diagnostics.PerformanceCounter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.'

from applicationinsights-profiler-aspnetcore.

xiaomi7732 avatar xiaomi7732 commented on May 17, 2024

@valeriob That is interesting. Let's troubleshoot.
I assume the application failed to start at all, right? Are you running it on Windows or Linux? Could you please run dotnet --info and past the output here?

from applicationinsights-profiler-aspnetcore.

valeriob avatar valeriob commented on May 17, 2024

Hi,
i created a brand new aspnet core 3.0 application, added the nuget package, those 2 lines in configure services
services.AddApplicationInsightsTelemetry(); // Enable Application Insights telemetry
services.AddServiceProfiler(); // Add this line of code to Enable Profiler
and this code in the appsettings.json:
"ApplicationInsights": {
"InstrumentationKey": "replace-with-your-instrumentation-key"
}
i get this that exception.

dotnet --info :
.NET Core SDK (reflecting any global.json):
Version: 3.0.100
Commit: 04339c3a26

Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.0.100\

Host (useful for support):
Version: 3.0.0
Commit: 7d57652f33

.NET Core SDKs installed:
2.1.802 [C:\Program Files\dotnet\sdk]
2.2.103 [C:\Program Files\dotnet\sdk]
3.0.100 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

from applicationinsights-profiler-aspnetcore.

xiaomi7732 avatar xiaomi7732 commented on May 17, 2024

@valeriob, so, you are running it locally on your box, right? I ran it in the same environment and didn't have a problem. If possible, could you please run your app as administrator and give it another shoot? Let's see if that is due to permission issue before we try the fancy fuslogvw.

from applicationinsights-profiler-aspnetcore.

valeriob avatar valeriob commented on May 17, 2024

Yes, i never run as admin.
But i can reproduce it on many machines, in vs F5 both admin and normal user.

from applicationinsights-profiler-aspnetcore.

xiaomi7732 avatar xiaomi7732 commented on May 17, 2024

By 'vs', I think you mean Visual Studio? Could you please share the version number for VS?

To sort out visual studio magics, in the project folder, run:

dotnet run

Does it work?

Also, could you please paste your project file(*.csproj), just want to see project references and that may help us repro the issue here.

from applicationinsights-profiler-aspnetcore.

valeriob avatar valeriob commented on May 17, 2024

Yes, visual studio 16.3.6, and it does not work with dot net run eather.

from applicationinsights-profiler-aspnetcore.

xiaomi7732 avatar xiaomi7732 commented on May 17, 2024

@valeriob I tried the same steps in VS 16.3.6 and it worked for me. There must be something I missed. Let me share my project and you can compare it with yours. At the same time, if you will to, share the project with me and I can take a look at it for you as well.

WebApplication.zip

from applicationinsights-profiler-aspnetcore.

valeriob avatar valeriob commented on May 17, 2024

Hi xiaomi,
i saw that you added the guide for .netcore 3 exactly after i opened the issue. i diagnosed the problem, and it's due to the dependency required for Microsoft.ApplicationInsights.AspNetCore must be at least 2.8+, while the nuget package requires only Microsoft.ApplicationInsights.AspNetCore (>= 2.3.0).

I suggest to upgrade the nuget package to reflect the real version dependency.
Thanks
Valerio

from applicationinsights-profiler-aspnetcore.

xiaomi7732 avatar xiaomi7732 commented on May 17, 2024

Hey @valeriob, just FYI, the hosting startup for .NET Core 3.x is coming soon in version 2.1.0-*.

from applicationinsights-profiler-aspnetcore.

valeriob avatar valeriob commented on May 17, 2024

Thanks! i'll keep an eye on that !

from applicationinsights-profiler-aspnetcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.