我有一個用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