Owinhost.exe has problem with web api

Topics: ASP.NET Web API
Apr 3, 2014 at 10:44 PM

I try to host a Web Api application with OwinHost.exe but I get this error message:

Error: System.ArgumentException
No conversion available between System.Func2[System.Collections.Generic.IDictionary2[System.String,System.Object],System.Threading.Tasks.Task] and Microsoft.Owin.OwinMiddleware.
Parameter name: signature

This is the startup code
public class Startup
    public void Configuration(IAppBuilder app)
        HttpConfiguration config = new HttpConfiguration();


The issue disapear if I remove 'app.WebApi()' line.

this is my package:

<package id="Microsoft.AspNet.WebApi.Client" version="5.1.2" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.1.2" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Owin" version="5.1.2" targetFramework="net45" />
<package id="Microsoft.Owin" version="2.1.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />

Any idea?
Aug 23, 2014 at 10:50 AM
I found the cause of the problem and a workaround. See this issue.