更改的框架版本导致:无法加载文件或程序集PresentationFramework? [英] Changed framework version results in: Could not load file or assembly PresentationFramework?

查看:101
本文介绍了更改的框架版本导致:无法加载文件或程序集PresentationFramework?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究WPF应用程序,该应用程序最初是针对3.0框架的.当我尝试使其在4.0上运行时,出现了Exception.

I am working on WPF application, which was first targeted to 3.0 framework. When I tried to make it work on 4.0, I got following Exception.

System.IO.FileNotFoundException原为未处理的消息:无法加载文件或程序集"PresentationFramework"版本= 3.0.0.0,文化=中性,PublicKeyToken = 31bf3856ad364e35'或它的依赖项之一.系统找不到指定的文件.

System.IO.FileNotFoundException was unhandled Message: Could not load file or assembly 'PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

如果我使用.Net 4.0编译应用程序,则可以正常工作.但是3.0 exe无法与4.0一起使用.

If I compile application using .Net 4.0 it is working fine. But 3.0 exes are not working with 4.0.

谢谢.

推荐答案

尝试在Visual Studio项目中删除对PresentationFramework的DLL引用,然后在项目属性"中重新定位应用程序框架,然后再次添加PresentationFramework引用.

Try to remove the DLL reference to the PresentationFramework in your Visual Studio project, then retarget your application framework in the Project Properties, and then add PresentationFramework reference again.

这篇关于更改的框架版本导致:无法加载文件或程序集PresentationFramework?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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