我建立在.NET框架4.5的C#應用程序,但我使用是建立與.NET 2.0的dll的一個,所以我嘗試添加混合模式彙編功能。C#混合模式件釋放模式錯誤
這是錯誤我收到:Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
我想這http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx,現在我的app.config看起來是這樣的:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
</configuration>
當我在運行Visual Studio中的應用程序,在釋放模式,它按預期運行,但是當我嘗試在其工作環境中運行它時,它會崩潰並出現上述錯誤。
我沒有成功嘗試,這也[Mixed Mode Error when building in Release Mode]。
我是否缺少別的東西?
並從那裏你調用您的應用程序的位置已經appname.exe.config放置在靠近它的文件?當它從release文件夾本身運行時,它也會直接運行嗎? – Amitd
它運行在一個單獨的目錄中,我將appname.exe.config文件複製到工作目錄,現在它正在運行!謝謝 – desto