可以說我有一箇舊的應用程序將嘗試加載外部程序集。如何運行CLR 2應用程序作爲CLR 4應用程序
- 舊的應用程序被編譯爲CLR 2
- 新組件被編譯爲CLR 4
我想能夠運行內部CLR 4.我記得舊的應用程序有一些涉及xml manifest magic。
如何創建該清單xml文件來告訴oldapplication.exe應該在CLR 4下運行?
我發現了一些建議,但它們似乎不適合我。
- http://www.mibuso.com/forum/viewtopic.php?f=23&t=33840&view=next
- http://geekswithblogs.net/technetbytes/archive/2007/06/01/112928.aspx
- http://msdn.microsoft.com/en-us/library/a5dzwzc9.aspx
oldapplication.exe.config:
<?xml version ="1.0"?>
<configuration>
<startup>
<!--set the appropriate .net version-->
<requiredRuntime version="4.0.0.0"/>
</startup>
</configuration>
同時給予再出手,我發現這個文件作爲我的TEMPL吃:
C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.20506 \ Aspnet_regsql.exe.config
<?xml version ="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0.20506"/>
<requiredRuntime version="v4.0.20506" safemode="true"/>
</startup>
</configuration>
我也更新了代碼報告當前CLR:
Console.WriteLine(typeof(object).Assembly.ImageRuntimeVersion);
它現在有效!
+1。也只是要問這個問題,因爲我真的需要.NET 4的64位JIT來支持正確的尾部呼叫。 – leppie 2011-05-12 10:42:12