Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OWIN Webapi app receiving "System.ArgumentException no conversion available..." when bundled with nuget

Tags:

c#

owin

katana

I'm attempting to setup a self-hosted OWin app (using VS2012) - I think it's close since I can run OwinHost.exe from the directory containing the .csproj and application serves from localhost:5000 correctly. I created a default nuspec file and added the following

<files>
  <file src="bin\*.dll" target="bin" />
  <file src="views\home\home.html" target="content" />
  <file src="web.config" target="content" />
</files>

in AssemblyInfo.cs

[assembly: OwinStartup(typeof(TestA.Startup))]

When I install the package ( nuget install mypackage ) I get the following error...

Starting with the default port: 5000...

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

Let me know if you would like more info

Cheers!

like image 983
MikeW Avatar asked Oct 03 '22 09:10

MikeW


1 Answers

Go into Manage Nuget Packages for Solution... on the solution, choose Updates and click Update All (or select the owin related ones as applicable).

This fixed it for me.

Original Error:

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

After Updating Nuget Packages:

Starting with the default port: 5000 (http://localhost:5000/) Started successfully Press Enter to exit

like image 165
Luke Avatar answered Oct 13 '22 10:10

Luke