I've been developing using the Logitech io2 Pen SDK recently and also, coincidentally installed .NET 2.0 and Visual Studio 2005 around the same time.

我一直在使用的开发罗技IO2笔SDK最近也不约而同安装了.NET 2.0和Visual Studio 2005在同一时间。

I got this error a few days ago upon docking the pen: "Ticks must be between DateTime.MinValue and DateTime.MaxValue" and noticed that remoting was involved in the stack dump:

几天前,我在停放笔时遇到了这个错误:“ Ticks必须在DateTime.MinValue和DateTime.MaxValue之间”,并注意到堆栈转储中涉及远程处理:

System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Logitech.Pen.Device.IPen.get_LastSynchronizationTime()
   at Logitech.Pen.TrayIcon.PenBalloon.DoRefresh()

System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&msgData,Int32类型) 在Logitech.Pen.Device.IPen.get_LastSynchronizationTime() 在Logitech.Pen.TrayIcon.PenBalloon.DoRefresh()

So, two assemblies were chatting each other up via remoting and something went wrong. Logitech has a number of EXEs that all work together to make io2 Pen Services available in multiple contexts. Don't worry, they don't all run at the same time; they come and go as needed.

因此,两个程序集通过远程相互交谈,出现了问题。 罗技(Logitech)有许多EXE,这些EXE可以一起工作以使io2 Pen Services在多种情况下可用。 不用担心,它们不会同时运行。 他们根据需要来来去去。

I knew that Logitech used .NET 1.1 for their development and I knew that on systems that have both .NET 2.0 and .NET 1.1 that 1.1 EXEs would get the 1.1 CLR loaded by default. However, the only thing that changed was the installation of 2.0.

我知道Logitech使用.NET 1.1进行开发,并且我知道在同时具有.NET 2.0和.NET 1.1的系统上,默认情况下1.1 EXE将加载1.1 CLR。 但是,唯一改变的是2.0的安装。

Which of these was running .NET 2.0? Using Sysinternal's glorious ProcExp that can highlight processes that contain a .NET runtime as well as show exactly what DLLs are loaded in a process's memory space. Looks like Pen.LplsHost.exe gets 2.0 loaded, while EVERY other .EXE gets 1.1.

其中哪个正在运行.NET 2.0? 使用Sysinternal出色的ProcExp可以突出显示包含.NET运行时的进程,并准确显示进程的内存空间中加载了哪些DLL。 看起来Pen.LplsHost.exe获得2.0加载,而其他所有.EXE获得1.1。

That's weird, and it would make sense that if a .NET 1.1 application remoted into a .NET 2.0 application that something odd might happened (Honest question: Doesn't it?).

这很奇怪,并且有道理,如果.NET 1.1应用程序远程到.NET 2.0应用程序中,可能会发生一些奇怪的事情(老实的问题:不是吗? )。

When you install .NET 2.0, does it changed any 1.1 DLLs? Yes and no. The system-wide CLR loader, mscoree.dll changes when you install a new version of the .NET Framework. It's always the last version. This is necessary because the loader ultimately makes the decision of which CLR to load into that process. So, mscoree was updated to make the 1.0, 1.1 or 2.0 decision.

安装.NET 2.0时,它是否更改了1.1个DLL? 是的,没有。 当您安装新版本的.NET Framework时,系统级CLR加载程序mscoree.dll会更改。 它始终是最新版本。 这是必需的,因为加载程序最终决定将哪个CLR加载到该进程中。 因此,mscoree已更新为做出1.0、1.1或2.0决策。

Now, the real question is: What is it about Pen.LplsHost.exe that causes it to load .NET 2.0?

现在,真正的问题是:导致Pen.LplsHost.exe加载.NET 2.0的问题是什么?

Here's why! It's NOT a .NET application! Reflector reminds me that it's an unmanaged C++ application. It does load the CLR though, so it's likely a CLR Host that does something like this to load the CLR:

这就是为什么! 它不是.NET应用程序! Reflector提醒我这是一个不受管理的C ++应用程序。 它确实加载了CLR,因此可能是CLR主机执行了如下操作来加载CLR:

LPWSTR pszFlavor = L"wks";
ICorRuntimeHost *pHost = NULL;
hr = CorBindToRuntimeEx(
                      //version
                      null,      
                      // svr or wks                       
                      pszFlavor,   
                      //domain-neutral"ness" and gc settings
                      STARTUP_LOADER_OPTIMIZATION_MULTI_DOMAIN_HOST |       
                      STARTUP_CONCURRENT_GC,
                      CLSID_CorRuntimeHost,
                      IID_ICorRuntimeHost,
                      (void **)&pHost);

LPWSTR pszFlavor = L“ wks”; ICorRuntimeHost * pHost = NULL; hr = CorBindToRuntimeEx( //版空值, // svr或wks pszFlavor, //与网域无关的“ ness”和gc设置STARTUP_LOADER_OPTIMIZATION_MULTI_DOMAIN_HOST | STARTUP_CONCURRENT_GC, CLSID_CorRuntimeHost, IID_ICorRuntimeHost, (void **)&pHost);

However, if you don't pass in a value for version, MSDN says:

但是,如果您不传递版本值,则MSDN会说:

"If the caller specifies null for pwszVersion, the latest version of the common language runtime is loaded. Passing null gives the host no control over which version of the runtime is loaded. While this may be appropriate in some scenarios, it is strongly recommended that the host supply a specific version to load."

“如果调用者为pwszVersion指定了null,则将加载最新版本的公共语言运行时。传递null将使主机无法控制要加载的运行时版本。尽管在某些情况下这可能是适当的,但强烈建议您主机提供要加载的特定版本。”

So instead, they should note http://msdn.com/library/en-us/cpgenref/html/grfuncorbindtoruntimeex.asp and try this instead:

因此,相反,他们应该注意http://msdn.com/library/en-us/cpgenref/html/grfuncorbindtoruntimeex.asp并尝试以下操作:

LPWSTR pszVer = L"v1.1.4322"; // <!---- Oy!LPWSTR pszFlavor = L"wks";
ICorRuntimeHost *pHost = NULL;
hr = CorBindToRuntimeEx(
                      //version                      pszVer,  // <!---- Oy!                      // svr or wks                       
                      pszFlavor,   
                      //domain-neutral"ness" and gc settings
                      STARTUP_LOADER_OPTIMIZATION_MULTI_DOMAIN_HOST |       
                      STARTUP_CONCURRENT_GC,
                      CLSID_CorRuntimeHost,
                      IID_ICorRuntimeHost,
                      (void **)&pHost);

LPWSTR pszVer = L“ v1.1.4322”; // <!----哦! LPWSTR pszFlavor = L“ wks”; ICorRuntimeHost * pHost = NULL; hr = CorBindToRuntimeEx( //版pszVer,// <!----哦! // svr或wks pszFlavor, //与网域无关的“ ness”和gc设置STARTUP_LOADER_OPTIMIZATION_MULTI_DOMAIN_HOST | STARTUP_CONCURRENT_GC, CLSID_CorRuntimeHost, IID_ICorRuntimeHost, (void **)&pHost);

Speculation: I'd bet $100 that the devs aren't asking for .NET 1.1 in Pen.LplsHost.exe and they should have if they were following best practices. As I said, you can override it with the .config file, but the RIGHT thing to do (in the short term) is to ask for the version you want.

推测:我敢打赌,开发人员在Pen.LplsHost.exe中不要求使用.NET 1.1,如果他们遵循最佳实践,他们应该拥有100美元的赌注。 如我所说,您可以使用.config文件覆盖它,但是正确的做法(短期内)是要求提供所需的版本。

I'm chatting with Logitech Support about this, so until I update this post everything I've said so far is just my opinion and speculation and in no way means to impugn they or there developers. It's a difficult thing to anticipate these things and to include version-specific information, especially as a CLR Host.

我正在与Logitech支持人员聊天,因此,在更新此文章之前,到目前为止,我所说的一切只是我的见解和推测,绝不影响他们或那里的开发人员。 很难预料到这些并包含特定于版本的信息,尤其是作为CLR主机时,这是一件困难的事情。

Short term fix: You can easily force Pen.LplsHost.exe (or any application for that matter) to load the .NET 1.1 framework by dropping the attached file into C:\Program Files\Logitech\io2Software. I have done this and haven't see any problems since and noted with ProcExp that 1.1 is now correctly loaded in this process's space.

短期修复:您可以通过将附加的文件拖放到C:\ Program Files \ Logitech \ io2Software中,轻松地强制Pen.LplsHost.exe(或与此相关的任何应用程序)加载.NET 1.1框架。 我已经完成了此操作,此后再也未发现任何问题,并通过ProcExp注意到现在该进程的空间已正确加载了1.1。

<configuration>
    <startup>
        <requiredRuntime version="v1.1.4322"  />
    </startup>
</configuration>

<配置> <启动> <requiredRuntime version =“ v1.1.4322” /> </ startup> </ configuration>

File Attachment: Pen.LplsHost.exe.config (118 bytes)

文件附件:Pen.LplsHost.exe.config(118字节)

UPDATE: Matt Davis (see the comments for this post) nailed it. I was mistaken. I spoke to the team at Logitech and it was, in fact, C++ calling a .NET Assembly via COM Interop. This  could be controlled via the RunTimeVersion key for the InproServer32 key for this RCW within the Registry. However, everything in this post up to the CorBindToRuntimeEx conclusion holds, and the .exe.config solution is also workable one. Logitech is exploring ways to make this easier. My question is, what about Explorer.exe and hosting multiple shell extensions each written in different versions of .NET?

更新:马特·戴维斯(Matt Davis)(请参阅这篇文章的评论)钉上了它。 我误解了。 我与Logitech的团队进行了交谈,实际上,这是C ++通过COM Interop调用.NET程序集。 可以通过注册表中此RCW的InproServer32密钥的RunTimeVersion密钥进行控制。 但是,直到CorBindToRuntimeEx结论为止,本文中的所有内容都适用,.exe.config解决方案也是可行的。 罗技(Logitech)正在探索使这一过程变得更容易的方法。 我的问题是,Explorer.exe并托管多个分别以不同版本的.NET编写的shell扩展如何?

翻译自: https://www.hanselman.com/blog/when-net-20-applications-attack-debugging-weirdness-after-installing-the-net-runtime

.NET 2.0应用程序攻击时-安装.NET Runtime之后调试怪异现象相关推荐

  1. PB8 0应用程序编译发布技术研究

    分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow 也欢迎大家转载本篇文章.分享知识,造福人民,实现我们中华民族伟大复兴! 摘要:本 ...

  2. PB8.0应用程序编译发布技术研究

     执行文件的建立 1.编译格式的选择 PowerBuilder 8.0对生成可执行文件提供了两种编译格式:伪代码(Pcode,即pseudocode的缩写)和机器代码(Machinecode).伪 ...

  3. R包安装时安装程序包****时退出的状态不是0,或者版本不适的一种解决方法。

    Bioconductor中包几乎都是安装下面代码安装.比如:miRBaseVersions.db包 if (!requireNamespace("BiocManager", qui ...

  4. PHPRAP v1.0.8 版本发布,安装时数据库不存在自动创建

    PHPRAP,是一个PHP轻量级开源API接口文档管理系统,致力于减少前后端沟通成本,提高团队协作开发效率,打造PHP版的RAP. PHPRAP已被评选为码云最有价值开源项目 更新记录 [修复]修复在 ...

  5. python37安装opencv41_Vs2019+opencv4.1.0+python3.7,包安装,vs2019opencv410python37,程序包

    1.上面的安装VS2019,Python开发以及OpenCV,配置环境变量什么的不说了,其他的网上教程很多. 2.创建一个新项目 3.后面安装Opencv-Pyhton, Opencv-contrib ...

  6. Windows安装程序初始化时出错。安装程序将立即关闭。(原)

    安装Microsoft .Net Framework 1.1时出错:Windows安装程序初始化时出错.安装程序将立即关闭.错误如下图所示: [img]http://msdn.iteye.com/up ...

  7. 试图运行项目时出错,无法启动调试。没有正确安装调试器,请运行安装程序安装或恢复调试器。...

            用Visual Studio.net 2003调试项目时,出现错误对话框,显示如下:         试图运行项目时出错,无法启动调试.没有正确安装调试器,请运行安装程序安装或恢复调试 ...

  8. Windows安装.net Framework时安装不上,提示已处理证书链,但是在不受信任提供程序信任的根证书中终止

    解决Windows安装.net Framework时安装不上,提示已处理证书链,但是在不受信任提供程序信任的根证书中终止. 通过网上资料查询找到了以一个可以解决此问题的博客,这里把连接放到这.下次在遇 ...

  9. 解决金仓数据库安装时安装VC++2013报错问题:不受信任提供程序信任的根证书中终止

    解决金仓数据库安装时安装VC++2013报错问题:不受信任提供程序信任的根证书中终止 安装微软的信任证书: 1.点击链接下载微软证书:http://download.microsoft.com/dow ...

最新文章

  1. Bridge网络模式下Linux虚拟机和主机进行通信
  2. shell脚本中的变量
  3. 统计上报---日志上报成功率高的方式
  4. C语言对strtok(),与strdup()介绍
  5. DataGrid中实现输入数量和金额自动计算出总金额
  6. Dancing Naked in the Mind Field
  7. 同样是Java程序员,如何比别人更优秀?
  8. node简介及安装、下载及运行hexo
  9. Objective-C 2.0 with Cocoa Foundation--- 6,NSObject的奥秘
  10. 线上python课程一般多少钱-python培训班一般多少钱?一篇文章告诉你
  11. 数据库架构 - 数据库设计是否要使用外键(转)
  12. netty权威指南 微云_《Netty权威指南》(一)走进 Java NIO
  13. 翻译软件Bob安装教程
  14. python滑稽脸程序
  15. C语言用广播星历求卫星坐标,GPS广播星历计算卫星位置和速度-Read
  16. 三星a60android9,三星A6060官方港版安卓9固件rom线刷包:TGY-A6060ZHU1ASG1
  17. 没事干的时候可以看这些,超全超多…
  18. 实战 SQL:实现百度、高德等地图中的地铁换乘线路查询
  19. 计算机网络的三种交换方式
  20. STM32-定时器输入捕获实验(捕获PWM方波的频率和占空比)

热门文章

  1. 【5G系列】Unified access control(3)——AS层的UAC
  2. Binder(二)简介
  3. 钉钉获取免登用户信息
  4. 微信小程序 腾讯地图根据起点终点绘制线路
  5. 景点旅游项目深入开发精品夜间旅游文化艺术
  6. DCT变换 / DWT变换 ----课堂笔记
  7. 谈C中scanf陷阱
  8. vue项目 vue-quill-editor富文本编辑器+图片上传
  9. WIN7访问远程共享文件:0x80070035 找不到网络路径解决方法
  10. 外网远程唤醒群晖NAS:路由器唤醒/内网树莓派唤醒/手机端WOL软件远程唤醒/网页工具唤醒