升级到.NET 4.6.2后的公共语言运行时错误 [英] Common Language Runtime error after upgradation to .NET 4.6.2

查看:215
本文介绍了升级到.NET 4.6.2后的公共语言运行时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我们的应用程序已从.NET FW 4.5.2升级到.NET FW 4.6.2.该应用程序是一个包含2个解决方案的Web应用程序,其中一个前端解决方案托管在IIS上,一个服务解决方案具有第三方集成以及 ADO.NET覆盖的方法.

Very recently, our application was upgraded from .NET FW 4.5.2 to .NET FW 4.6.2. The application is a web application with 2 solutions, the front end solution which is hosted on IIS and the Services solution which has third-party integrations as well as ADO.NET overridden methods.

该应用程序用作安装为Windows服务的WCF服务,以连接2个解决方案以进行同步调用.

The application uses as WCF services installed as a Windows service to connect the 2 solutions for synchronous calls.

现在,当我们将框架升级到4.6.2时,该服务无法启动.我们收到以下错误-

Now, when we upgraded our framework to 4.6.2 the service did not start. We got the following error -

登录名:应用
来源:       WindowsService的名称
日期: 2016/11/17上午7:03:29
事件ID: 2055
任务类别:无
级别:错误
关键字:经典
用户:       不适用
电脑: ComputerName
说明:
Web服务引擎 NameofWindowsService "无法启动.
公共语言运行时检测到无效程序.
  在System.ServiceModel.Dispatcher.DispatchRuntime..ctor(共享SharedRuntimeState)处
  在System.ServiceModel.Dispatcher.DispatchRuntime..ctor(EndpointDispatcher endpointDispatcher)处
  在System.ServiceModel.Dispatcher.EndpointDispatcher..ctor(EndpointAddress地址,字符串contractName,字符串contractNamespace,布尔值isSystemEndpoint)
  在System.ServiceModel.Description.DispatcherBuilder.BuildDispatcher(ServiceHostBase服务,ServiceDescription serviceDescription,ServiceEndpoint端点,ContractDescription contractDescription,EndpointFilterProvider提供程序)
  在System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(服务描述,ServiceHostBase serviceHost)上
  在System.ServiceModel.ServiceHostBase.InitializeRuntime()
  在System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan超时)
  在System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan超时)处
  在 PathOfFile 中的 NameofWindowsService .OnStart(String [] args):行101
事件Xml:
<事件xmlns =由于msdn规则而修改的链接文本">
  <系统>
    < Provider Name =" WindowsService的名称" />
    < EventID Qualifiers ="0"> 2055</EventID>
    < Level> 2</Level>
    < Task> 0</Task>
    <关键字> 0x80000000000000</关键字>
    < TimeCreated SystemTime =" 2016-11-17T12:03:29.000000000Z" />
    < EventRecordID> 143974</EventRecordID>
    < Channel>应用程序</Channel>
    < Computer> ComputerName </Computer>
    <安全性/>
  </System>
  < EventData>
    < Data> Web服务引擎'COP WebService Engine服务(PROD01)'无法启动.
公共语言运行时检测到无效程序.
  在System.ServiceModel.Dispatcher.DispatchRuntime..ctor(共享SharedRuntimeState)处
  在System.ServiceModel.Dispatcher.DispatchRuntime..ctor(EndpointDispatcher endpointDispatcher)处
  在System.ServiceModel.Dispatcher.EndpointDispatcher..ctor(EndpointAddress地址,字符串contractName,字符串contractNamespace,布尔值isSystemEndpoint)
  在System.ServiceModel.Description.DispatcherBuilder.BuildDispatcher(ServiceHostBase服务,ServiceDescription ServiceDescription,ServiceEndpoint端点,ContractDescription contractDescription,EndpointFilterProvider提供程序)处
  在System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(服务描述,ServiceHostBase serviceHost)上
  在System.ServiceModel.ServiceHostBase.InitializeRuntime()
  在System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan超时)
  在System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan超时)处
  在 PathOfFile 中的 NameofWindowsService .OnStart(String [] args):行101</Data>
  </EventData></Event>

Log Name:      Application
Source:        NameofWindowsService
Date:          11/17/2016 7:03:29 AM
Event ID:      2055
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      ComputerName
Description:
Web Service Engine NameofWindowsService' failed to start.
Common Language Runtime detected an invalid program.
   at System.ServiceModel.Dispatcher.DispatchRuntime..ctor(SharedRuntimeState shared)
   at System.ServiceModel.Dispatcher.DispatchRuntime..ctor(EndpointDispatcher endpointDispatcher)
   at System.ServiceModel.Dispatcher.EndpointDispatcher..ctor(EndpointAddress address, String contractName, String contractNamespace, Boolean isSystemEndpoint)
   at System.ServiceModel.Description.DispatcherBuilder.BuildDispatcher(ServiceHostBase service, ServiceDescription serviceDescription, ServiceEndpoint endpoint, ContractDescription contractDescription, EndpointFilterProvider provider)
   at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost)
   at System.ServiceModel.ServiceHostBase.InitializeRuntime()
   at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at NameofWindowsService.OnStart(String[] args) in PathOfFile:line 101
Event Xml:
< Event xmlns="link text modified due to msdn rules">
  <System>
    <Provider Name="NameofWindowsService" />
    <EventID Qualifiers="0">2055</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2016-11-17T12:03:29.000000000Z" />
    <EventRecordID>143974</EventRecordID>
    <Channel>Application</Channel>
    <Computer>ComputerName</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Web Service Engine 'COP WebService Engine Service(PROD01)' failed to start.
Common Language Runtime detected an invalid program.
   at System.ServiceModel.Dispatcher.DispatchRuntime..ctor(SharedRuntimeState shared)
   at System.ServiceModel.Dispatcher.DispatchRuntime..ctor(EndpointDispatcher endpointDispatcher)
   at System.ServiceModel.Dispatcher.EndpointDispatcher..ctor(EndpointAddress address, String contractName, String contractNamespace, Boolean isSystemEndpoint)
   at System.ServiceModel.Description.DispatcherBuilder.BuildDispatcher(ServiceHostBase service, ServiceDescription serviceDescription, ServiceEndpoint endpoint, ContractDescription contractDescription, EndpointFilterProvider provider)
   at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost)
   at System.ServiceModel.ServiceHostBase.InitializeRuntime()
   at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at NameofWindowsService.OnStart(String[] args) in PathOfFile:line 101</Data>
  </EventData></Event>

引发此异常的代码-

ServiceHost serviceHost =新的ServiceHost(serviceHostData.Type);

ServiceHost serviceHost = new ServiceHost(serviceHostData.Type);

serviceHost.Open();

serviceHost.Open();

我们在6台服务器中有4台在生产中遇到此错误.我们不知道为什么它可以在2台服务器上工作,但是却为我们省去了很多麻烦.我们尝试了一切-重新安装固件,修复固件,清除临时文件等,但是有效的方法是更新 使用以下代码的服务配置-

We got this error on production in 4 out of 6 servers. We have no idea why this worked on 2 servers but that saved us major embarrassment. We tried everthing - reinstalling the FW, repairing the FW, clearing temporary files etc but what worked was updating the service config with the following code -

<配置>
  < runtime>
    < useLegacyJit enabled ="1" />
  </runtime>
< /configuration>

<configuration>
  <runtime>
    <useLegacyJit enabled="1" />
  </runtime>
< /configuration>

我希望这可以帮助面临相同问题但遇到问题的人-

I hope this helps someone who is facing the same issue but I have questions -

1. Microsoft已经提到在4.6.2版本中,这些问题将得到解决,但是似乎他们错过了这一问题.我们可以期待一个修复程序吗?

1. Microsoft has mentioned that with the 4.6.2 release these issues would be fixed but it seems they missed this one. Can we expect a hotfix?

2.进行此更改有什么影响?

2. What is the impact of making this change?

3.可以使用旧版编译器编译的此服务引用在新JIT编译器中编译的dll吗?新的第三方程序集可能很快就会提供给我们,我们希望确定.

3. Can a dll compiled in the new JIT compiler be referenced by this service which was compiled with the legacy compiler? New third party assemblies might be available to us soon and we want to be sure.

感谢您的帮助.

推荐答案

N_Kaul,

Hi N_Kaul,

我怀疑这是产品问题,建议您在 连接 .顺便说一句,我还建议您将复制演示作为附件添加,MS来的人会更好地了解您的问题.

I suspect it's a product issue and I would recommend you submit a feedback in Connect . By the way, I also suggest you add your reproduce demo as an attachment, someone who comes MS will be better to understand your issue.

最诚挚的问候,

克里斯汀 


这篇关于升级到.NET 4.6.2后的公共语言运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆