another question arises here, similar to the conflict between SignalR 2.0.2 and Owin 2.0.0 . If I run the project as a console application, I'm fine. Otherwise, as a class library, if I ran it from the command line, I received this error from IIS Express, saying:
Could not load file or assembly 'Microsoft.Owin, Version=2.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
But this cannot be, since I installed 3.0.0.0 and in the configuration file I have:
<?xml version="1.0" encoding="utf-8"?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration>
Here is the rest of the application:
namespace katanaIntro { using AppFunc = Func<IDictionary<string, object>, Task>; public class Startup { public void Configuration(IAppBuilder app) { app.Use(async (environment, next) => { Console.WriteLine("Requestion : " + environment.Request.Path); await next(); Console.WriteLine("Response : " + environment.Response.StatusCode); }); ConfigureWebApi(app); app.UseHelloWorld(); } private void ConfigureWebApi(IAppBuilder app) { var config = new HttpConfiguration(); config.Routes.MapHttpRoute( "DefaultApi", "api/{controller}/{id}", new { id = RouteParameter.Optional }); app.UseWebApi(config);
Here is the command from the command line:
"c:\Program Files\IIS Express\iisexpress.exe" /path:"C:\Users\smagistri\Projects\Lab 4.5\katanaIntro\katanaIntro"
I forgot to mention that it works only if I delete ConfigureWebApi (application);
Any ideas?
c # iis-express owin
Stefano magistri
source share