aliostad/PerfIt

FileLoadException

aadamsx opened this issue · 5 comments

Hi,

I followed your April 1st instructions on installing and configuring this tool. I installed version 0,1.5 from nuget.

I placed the,

config.MessageHandlers.Add(new
PerfItDelegatingHandler(config, "My test app"));

code in my WebApiConfig.Register() method

And added Installer template file (I named it PerfitInstaller), but it didn't have any Install/Uninstall virtual methods to be overwritten, only,

[RunInstaller(true)]
public partial class PerfItInstaller 
    : Installer
{
    public PerfItInstaller()
    {
        InitializeComponent();
    }
}

So the only way I deviated from your post was that I didn't implement the,

public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
PerfItRuntime.Install();
}

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

as you said... I just left everything alone in this file.

Then added,

    [PerfItFilter(Description = "Gets tenant by id",
        Counters = new[] { CounterTypes.TotalNoOfOperations, 
        CounterTypes.AverageTimeTaken })]

as an attribute on one of my Get(int id) methods.

Opened the vs command line and InstallUtil.exe -i Proto.Api.dll, it stated the commit phase completed successfully.

The log file looks like so,

Committing assembly 'D:\xxx\xxx\xxx\Proto3\Proto.Api\bin\Proto.Api.dll'.
Affected parameters are:
i =
logfile = D:\xxx\xxx\xxx\Proto3\Proto.Api\bin\Proto.Api.InstallLog
assemblypath = D:\xxx\xxx\xxx\Proto3\Proto.Api\bin\Proto.Api.dll
logtoconsole =

I do a F5, and it throws on

Application_Start => WebApiConfig.Register()

The exception is:

{"Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"}

didn't mean to hit closed...

Hi,

First of all, the step you have omitted means you will not be able to install the counters and you would not be able to use them.

After that, try this to see why it is not loading.

Thanks for the feedback and opening up this tool to us (also you have a kick-butt blog).

So how/where should I implement these two?

public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
PerfItRuntime.Install();
}

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

After this, if I'm still running into issues, I'll follow the link to the work around.

Thanks again --

Thanks. Let me know what happens.

Same as #14