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

There are no instrumentationInfos found #59

Closed
vgary06 opened this issue Jul 10, 2017 · 10 comments
Closed

There are no instrumentationInfos found #59

vgary06 opened this issue Jul 10, 2017 · 10 comments
Labels

Comments

@vgary06
Copy link

vgary06 commented Jul 10, 2017

Hi,

I always got this exception when I try to install it. (not API 2)
System.InvalidOperationException: There are no instrumentationInfos found by the discoverer!

    `public override void Install(IDictionary stateSaver)
    {
        base.Install(stateSaver);
        PerfItRuntime.Install(Assembly.GetExecutingAssembly(), new FilterDiscoverer());
    }

    public override void Uninstall(IDictionary savedState)
    {
        base.Uninstall(savedState);
        PerfItRuntime.Uninstall(Assembly.GetExecutingAssembly());
    }`

I did what's in the readme but still cannot see the counters in the PerfMon, neither my PerFit web API project name.

Did I miss something? Because I didn't found any similar Issue in here.

Thanks in advanced.

@aliostad
Copy link
Owner

Would it be possible to send a repro? Just the project with any sensitive stuff removed.
Also which version are you using? And also what instrumenters are you using? Web API, MVC, SimpleInstrumentor?

@vgary06
Copy link
Author

vgary06 commented Jul 10, 2017

I just created an asp.net Web Api project with default controller and put the PerfitFilter attribute just like in the readme file. After created the installer like I sent you. In the end I ran cmd and tried to register the counter. Which was totally the same as in the "Getting started" phase.
So it isn't necessary to send any kind of code, because I did what the readme showed me. But on the registration I got the error message in cmd that "System.InvalidOperationException: There are no instrumentationInfos found by the discoverer!"
So, I stuck there and I don't know what kind of instrumentationInfos should I create or add and where.
But if you insist, I can send you just not today, only tomorrow I can.

@aliostad
Copy link
Owner

aliostad commented Jul 10, 2017

Assembly loading issues is a common one. This is from Wiki and could be related:

A common problem is to encounter FileNotFoundException when registering your counters using InstallUtil. This is more common when your use Web API 2. In any case, this is a problem with InstallUtil not honouring your assembly redirects. To solve the problem (and it is just a workaround), simply copy the assembly redirect directives to InstallUtil.exe.config, run the installation and then remove them.

This has been raised a few times (see the issues, for example #11) but the problem is simply the way InstallUtil works - or rather doesn't.

What I found the best solution is to include a copy of InstallUtil.exe and its custom config (which works for your project by copying content of assemblyBinding section of the web.config) along with your deployables and have a script to install the counter, rather than relying on the standard InstallUtil on the box. These files are small and certainly a good solution.

Point is here: include a copy of InstallUtil.exe and its custom config (which works for your project by copying content of assemblyBinding section of the web.config

@vgary06
Copy link
Author

vgary06 commented Jul 10, 2017

I copied it and filled the config with the assemblyBinding section but I cannot run the InstallUtil because it still says that:
"System.IO.FileNotFoundException: A(z) "System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" cannot be loaded, and the system doesn't find the file.

But I have 5.2.3.0. for System.Web.Http. I hope that the .Net Framework 4.6 is not a problem.
Tried to reinstall nuget but still...

@aliostad
Copy link
Owner

you need you run it from your bin. This is the problem with InstallUtil not perfit.

@vgary06
Copy link
Author

vgary06 commented Jul 10, 2017

I did it right now as you said, but the same problem appeared with a little more extra: "the except HRESULT: 0x80131040."
Which means the located assembly's manifest definition does not match the assembly reference. But how's possible?

@aliostad
Copy link
Owner

@aliostad
Copy link
Owner

OK a couple of things

  • you are using PerfIt.WebApi filter against an MVC action. So uninstall Perfit.WebApi and install PerfIt.Mvc. That was the main issue.
  • "GetApiCategory" not a good name for the category. category is usually the while API hence change it to "BdNetApiTest".
  • Use this code for installer:
        public override void Install(IDictionary stateSaver)
        {
            base.Install(stateSaver);
            CounterInstaller.InstallStandardCounters("BdNetApiTest");
        }

        public override void Uninstall(IDictionary savedState)
        {
            base.Uninstall(savedState);
            CounterInstaller.Uninstall("BdNetApiTest");
        }

That should do the trick. Give it a try and let me know.

@vgary06
Copy link
Author

vgary06 commented Jul 11, 2017

Thank you, I'll try it as soon as I can.
Just one thing: Why was a problem to use PerfIt.WebApi on a MVC API project? I used it because
the exact reason of MVC API should work with PerfIt.WebApi.

@vgary06
Copy link
Author

vgary06 commented Jul 11, 2017

Now It's working and can see the counters, but I can't see the instances of the selected objects.
How can I make it showed in the PerfMon?

UPD: I read the closed issues and got the answer.
Thanks for your help, very much :)

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

No branches or pull requests

2 participants