我有一个用 ASP.NET MVC 编写的 Web 应用程序。一切都很好,在 Visual Studio 应用程序中工作得很好,但是一旦我把它放在 IIS 服务器上,它就会给我这个错误:
Sequence contains no matching element
.
这是它给我的堆栈跟踪:
[InvalidOperationException:序列不包含匹配元素]
System.Linq.Enumerable.Single(IEnumerable1 source, Func
2 predicate) +4134530 XSockets.Plugin.Framework.Helpers.PluginHelpers.GetInstance(ImportedType importsType) +143 XSockets.Plugin.Framework.Composable.Compose( T obj) +656 XSocketsServer..ctor() +170
Scyk.MvcApplication.Application_Start() +173[HttpException (0x80004005): 序列不包含匹配元素]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12864673
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
System .Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context)
+304 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr应用上下文)+475[HttpException (0x80004005): 序列不包含匹配元素]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881540 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext上下文)+12722601
有人能帮我一下吗?我不知道出了什么问题,尤其是当视觉工作室一切正常时...
编辑:我的 App_Start():
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
new XSocketsServer();
}
我在那里启动 xsockets 服务器,但无论如何,如果我注释掉这个 XSocketsServer,它仍然会给我同样的错误。