aliostad / PerfIt

Performance Monitoring and instrumentation for .NET (4.52+ and Core)
MIT License
123 stars 34 forks source link

Add support for WebAPI2 #14

Closed CraigKennedy closed 10 years ago

CraigKennedy commented 10 years ago

Needs .NET 4.5 as well as System.Web.Http.dll version 5.0.0.0

aliostad commented 10 years ago

Hi, is it breaking? You should be able to use it in .NET 4.5 and 5.0.0.0 as there were no breaking changes. I have not tested it myself.

CraigKennedy commented 10 years ago

The runtime works, but when trying to install the perf counters, it has a dependency on System.Web.Http.dll 4.0.0.0, which is not in my directory. I have 5.0.0.0 and cannot implement a binding redirect like I have in the web.config since the binding redirect would execute from the context of installutil.exe (and therefore installutil.exe.config would need to contain the binding redirect).

Does that make sense?

From: Ali Kheyrollahi [mailto:notifications@github.com] Sent: Tuesday, November 26, 2013 10:38 AM To: aliostad/PerfIt Cc: Craig Kennedy Subject: Re: [PerfIt] Add support for WebAPI2 (#14)

Hi, is it breaking? You should be able to use it in .NET 4.5 and 5.0.0.0 as there were no breaking changes. I have not tested it myself.

— Reply to this email directly or view it on GitHubhttps://github.com/aliostad/PerfIt/issues/14#issuecomment-29302063.

aliostad commented 10 years ago

have you tried things like this http://stackoverflow.com/questions/12643199/installing-windows-service-with-batch-file

CraigKennedy commented 10 years ago

That article makes sense, but in this case, there is a version mismatch between the versions of System.Web.Http.dll. It is looking for version 4.0.0.0 (not in the GAC or installed with the framework). I have version 5.0.0.0 installed from NuGet.

The batch file indicated in the article you sent is for when you need to have the “current directory” changed. In my case, System.Web.Http.dll is in the same directory, but has “Specific Version” set to true, requiring that I have version 4.0.0.0 in my bin folder, which conflicts with WebAPI 2…

An exception occurred during the Install phase. System.TypeInitializationException: The type initializer for 'PerfIt.PerfItRunti me' threw an exception. The inner exception System.IO.FileNotFoundException was thrown with the followin g error message: Could not load file or assembly 'System.Web.Http, Version=4.0.0 .0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies . The system cannot find the file specified..

The Rollback phase of the installation is beginning. See the contents of the log file for the C:\dev\Apps\trunk\Services\IE\IE\bin\ie .dll assembly's progress. The file is located at C:\dev\Apps\trunk\Services\IE\IE\bin\ie.InstallLog. Rolling back assembly 'C:\dev\Apps\trunk\Services\IE\IE\bin\ie.dll'. Affected parameters are: i = logfile = C:\dev\Apps\trunk\Services\IE\IE\bin\ie.InstallLog assemblypath = C:\dev\Apps\trunk\Services\IE\IE\bin\ie.dll logtoconsole =

The Rollback phase completed successfully.

The transacted install has completed. The installation failed, and the rollback has been performed.

From: Ali Kheyrollahi [mailto:notifications@github.com] Sent: Tuesday, November 26, 2013 10:44 AM To: aliostad/PerfIt Cc: Craig Kennedy Subject: Re: [PerfIt] Add support for WebAPI2 (#14)

have you tried things like this http://stackoverflow.com/questions/12643199/installing-windows-service-with-batch-file

— Reply to this email directly or view it on GitHubhttps://github.com/aliostad/PerfIt/issues/14#issuecomment-29302703.

aliostad commented 10 years ago

This is not a problem with PerfIt not supporting ASP.NET Web API v2.0.

It is basically he fact that InstallUtil does not look at the assembly redirect. There is a workaround explained here:

http://stackoverflow.com/questions/3940120/installutil-bindingredirect