在Ubuntu

时间:2015-05-01 18:18:48

标签: asp.net ubuntu mono signalr self-hosting

我刚刚在我的ubuntu计算机上升级到刚刚发布的 Mono版本 4.0.1 。以前安装的mono版本是3.2.7(如果我没记错的话)。

现在问题:

我的第一个问题是关于SignalR和自托管。我有一个.NET 4.5.1控制台应用程序,我使用OWIN自行托管NancyFx,Web Api和SignalR。在mono 3.2.7上运行时,我的知识没有问题但是当我尝试在mono 4.0.1上启动应用程序时,我得到以下堆栈跟踪:

Unhandled Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidProgramException: Invalid IL code in (wrapper delegate-invoke) <Module>:invoke_callvirt_CancellationTokenRegistration_CancellationToken&_Action`1<object>_object (System.Threading.CancellationToken&,System.Action`1<object>,object): IL_0057: castclass 0x00000007

  at Microsoft.AspNet.SignalR.Infrastructure.CancellationTokenExtensions.SafeRegister (CancellationToken cancellationToken, System.Action`1 callback, System.Object state) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.SignalR.Hosting.HostDependencyResolverExtensions.InitializeResolverDispose (IDependencyResolver resolver, CancellationToken hostShutdownToken) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.SignalR.Hosting.HostDependencyResolverExtensions.InitializeHost (IDependencyResolver resolver, System.String instanceName, CancellationToken hostShutdownToken) [0x00000] in <filename unknown>:0 
  at Owin.OwinExtensions.UseSignalRMiddleware[HubDispatcherMiddleware] (IAppBuilder builder, System.Object[] args) [0x00000] in <filename unknown>:0 
  at Owin.OwinExtensions.RunSignalR (IAppBuilder builder, Microsoft.AspNet.SignalR.HubConfiguration configuration) [0x00000] in <filename unknown>:0 
  at Owin.OwinExtensions+<>c__DisplayClass1.<MapSignalR>b__0 (IAppBuilder subApp) [0x00000] in <filename unknown>:0 
  at Owin.MapExtensions.Map (IAppBuilder app, PathString pathMatch, System.Action`1 configuration) [0x00000] in <filename unknown>:0 
  at Owin.MapExtensions.Map (IAppBuilder app, System.String pathMatch, System.Action`1 configuration) [0x00000] in <filename unknown>:0 
  at Owin.OwinExtensions.MapSignalR (IAppBuilder builder, System.String path, Microsoft.AspNet.SignalR.HubConfiguration configuration) [0x00000] in <filename unknown>:0 
  at Owin.OwinExtensions.MapSignalR (IAppBuilder builder, Microsoft.AspNet.SignalR.HubConfiguration configuration) [0x00000] in <filename unknown>:0 
  at Owin.OwinExtensions.MapSignalR (IAppBuilder builder) [0x00000] in <filename unknown>:0 

我不清楚这个错误可能意味着什么,我很乐意为所有人提供帮助。我正在使用Microsoft ASP.NET SignalR Self Host软件包2.2.0版。

作为旁注,我已经在新的单声道版本上编译了所有的程序集。

亲切的问候, 西蒙

1 个答案:

答案 0 :(得分:3)

这是最近修复的Mono问题:https://bugzilla.xamarin.com/show_bug.cgi?id=29665