我有一个用ASP.NET MVC编写的Web应用程序。一切都很好,在Visual Studio应用程序工作得很好,但只要我把它放在IIS服务器上,它给了我这个错误: Sequence contains no matching element
。ASP.NET MVC和IIS - 序列不包含匹配元素
这是堆栈跟踪,它给我:
[InvalidOperationException: Sequence contains no matching element]
System.Linq.Enumerable.Single(IEnumerable1 source, Func
2 predicate) +4134530 XSockets.Plugin.Framework.Helpers.PluginHelpers.GetInstance(ImportedType importedType) +143 XSockets.Plugin.Framework.Composable.Compose(T obj) +656 XSocketsServer..ctor() +170
Scyk.MvcApplication.Application_Start() +173[HttpException (0x80004005): Sequence contains no matching element]
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 appContext) +475[HttpException (0x80004005): Sequence contains no matching element]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881540 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12722601
谁能帮助我在这里?我不知道什么是错的,尤其是当一切都在Visual Studio好吗?
编辑:我App_Start():
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
new XSocketsServer();
}
我开始xsockets在那里的服务器,但不管怎么说,如果我注释掉这个XSocketsServer,它仍然给我同样的错误。
至少需要发布你的'Scyk.MvcApplication.Application_Start()'...但基于例外,我想有些DLL在服务器上发送。确保Bin目录在服务器上和本地包含相同的文件。你还应该检查'XSockets'使用的插件。 – nemesv
@nemesv:因为我在visual studio上发布了所有东西,所以它不应该包含任何东西,所以它应该包含所有东西。 – ojek
你使用的是什么版本的XSockets?猜测2.3? – Uffe