是否有可能在&QUOT指定.NET服务包; supportedRuntime"在app.config中? [英] Is it possible to specify .NET service pack in "supportedRuntime" in app.config?

查看:490
本文介绍了是否有可能在&QUOT指定.NET服务包; supportedRuntime"在app.config中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行良好的。NET 2.0 SP2,但未能在.NET 2.0 RTM正常运行的应用程序。 (供参考:它调用一个方法的托管DLL,它是一个包装了原生的DLL USB编程失败时)

I have an application that runs fine on .Net 2.0 SP2, but fails to run properly on .NET 2.0 RTM. (FYI: It fails when calling a method a managed DLL that is a wrapper for a native DLL for USB programming).

我知道你可以给支持运行时在C#.NET应用程序

I know you can give supported runtimes in the app.config of a C# .NET application

  <startup>
    <supportedRuntime version="v2.0.5727" />
    <supportedRuntime version="v4.0" />
  </startup>

不过,是不是也可以指定一个特定的服务包版本?

However, is it also possible to specify a specific Service Pack version?

谢谢!

编辑:我现在发现哪种方法之间的2.0和2.0 SP2失败。它是WaitHandle.WaitOne(INT),将其加入2.0 SP。

I did now find out which method fails between 2.0 and 2.0 SP2. It is WaitHandle.WaitOne(int) which was added in 2.0 SP1.

一个技巧其他人有问题,编译器不会说什么,但如果你NGEN有问题的运行可执行文件,它确实给你确切的错误。

A tip for everyone else having the problem, the compiler doesn't say anything but if you ngen the executable with the problematic runtime, it does give you the exact error.

例如:

Warning: System.MissingMethodException: Method not found: 'Boolean System.Threading.WaitHandle.WaitOne(Int32)'. while resolving 0xa0000e1 - System.Threading.WaitHandle.WaitOne.
11/11/2010 01:54:07 [3620]: Method not found: 'Boolean System.Threading.WaitHandle.WaitOne(Int32)'. while compiling method XXX

罗吉尔

推荐答案

很好的解释可以发现<一href="http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.languages.csharp/2009-02/msg00610.html"相对=nofollow>此处为什么这是不可能的。你可以找到一个SO响应<一href="http://stackoverflow.com/questions/199080/how-to-detect-what-net-framework-versions-and-service-packs-are-installed">here以满足您的需求。

Great explanation can be found here on why this is not possible. You can locate a SO response here to address your needs.

&LT; supportedRuntime&GT; 不实际工作的方式,因为3.5框架使用2.0运行时。您只能指定的运行时的那样,不是的框架的,而元素只EX presses preference,没有需求。

<supportedRuntime> doesn't actually work that way, because the 3.5 framework uses the 2.0 runtime. You can only specify runtimes that way, not frameworks, and the element only expresses preference, not demand.

这篇关于是否有可能在&QUOT指定.NET服务包; supportedRuntime&QUOT;在app.config中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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