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

Add support for WebAPI2 #14

Closed
CraigKennedy opened this issue Nov 26, 2013 · 5 comments
Closed

Add support for WebAPI2 #14

CraigKennedy opened this issue Nov 26, 2013 · 5 comments

Comments

@CraigKennedy
Copy link

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

@aliostad
Copy link
Owner

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
Copy link
Author

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//issues/14#issuecomment-29302063.

@aliostad
Copy link
Owner

@CraigKennedy
Copy link
Author

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//issues/14#issuecomment-29302703.

@aliostad
Copy link
Owner

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

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

2 participants