【发布时间】:2018-09-20 17:21:17
【问题描述】:
所以我有这个 asp.net mvc 项目,它是从 Visual Studio 在 .NetFramework 4.7.2 下为您提供的默认模板创建的,并下载了 sensenet.service.install 和 sensenet.webpages.install 包并运行安装它们的过程。之后,我按 F5 并确认我的机器上一切正常。从那里,我决定在 azure 上发布这个项目,当网页加载时,我受到的欢迎是这个
[Exception: ReflectionTypeLoadException: Could not load types. Affected types:
Lucene.Net.Store.RAMDirectory
Lucene.Net.Search.FieldDoc
Lucene.Net.Search.NumericRangeQuery
Lucene.Net.Search.SortField
Lucene.Net.Index.Term
First message: Type 'Lucene.Net.Store.RAMDirectory' in assembly 'Lucene.Net, Version=2.9.4.301, Culture=neutral, PublicKeyToken=null' has method 'OnDeserialized' with an incorrect signature for the serialization attribute that it is decorated with.]
SenseNet.Services.SenseNetGlobal.get_Instance() in E:\BuildAgent\_work\63\s\src\Services\SenseNetGlobal.cs:74
SenseNet.Portal.Global.Application_Start(Object sender, EventArgs e) in E:\BuildAgent\_work\63\s\src\Services\Global.cs:15
[HttpException (0x80004005): ReflectionTypeLoadException: Could not load types. Affected types:
Lucene.Net.Store.RAMDirectory
Lucene.Net.Search.FieldDoc
Lucene.Net.Search.NumericRangeQuery
Lucene.Net.Search.SortField
Lucene.Net.Index.Term
First message: Type 'Lucene.Net.Store.RAMDirectory' in assembly 'Lucene.Net, Version=2.9.4.301, Culture=neutral, PublicKeyToken=null' has method 'OnDeserialized' with an incorrect signature for the serialization attribute that it is decorated with.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +10062153
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +173
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): ReflectionTypeLoadException: Could not load types. Affected types:
Lucene.Net.Store.RAMDirectory
Lucene.Net.Search.FieldDoc
Lucene.Net.Search.NumericRangeQuery
Lucene.Net.Search.SortField
Lucene.Net.Index.Term
First message: Type 'Lucene.Net.Store.RAMDirectory' in assembly 'Lucene.Net, Version=2.9.4.301, Culture=neutral, PublicKeyToken=null' has method 'OnDeserialized' with an incorrect signature for the serialization attribute that it is decorated with.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10043444
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
在这个 github 问题 https://github.com/dotnet/standard/issues/300 中有一条评论说这已在 .NetFramework 4.7.2 中得到修复,但对我来说似乎并非如此。
所以我的问题是,为什么我在本地运行这个项目而不是在 azure 上发布它时没有发生这个异常?
【问题讨论】:
标签: c# asp.net-mvc azure reflection sensenet