在VS2010中将.NET 4后端口退回到3.5 SP1 [英] Back port .NET 4 to 3.5 SP1 in VS2010

查看:96
本文介绍了在VS2010中将.NET 4后端口退回到3.5 SP1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个简单的VS2010 WPF应用程序,该应用程序针对 .NET Framework 4客户端配置文件.(实际上,我的应用程序没有使用任何.NET 4功能,但是VS2010只是默认情况下启动了针对.NET 4的项目,因此我无需费心检查它)

I wrote a simple VS2010 WPF application which targeted .NET Framework 4 Client Profile. (In fact, my app does not use any .NET 4 features, but VS2010 just by default started my project targeting .NET 4 so I didn't bother to check it)

我发现所有XP系统甚至各种语言的Window 7都无法启动该应用程序.我决定通过更改解决方案属性中的 Target Framework ,将我的应用程序移植到目标 .NET Framework 3.5 .NET Framework 3.5客户端配置文件.但是该应用程序无法在 System.Xaml Microsoft.CSharp 上编译或生成以下错误:

I found all XP system and even a few Window 7 of various languages failed to start the app. I decided to back port my app to target .NET Framework 3.5 or .NET Framework 3.5 Client Profile, by changing the Target Framework in solution's properties. But the app does not compile or build with the following error on System.Xaml and Microsoft.CSharp:

Warning 1   Could not resolve assembly System.Xaml. The target framework required by this assembly (4.0) is higher than the project target framework. If this reference is required by your code, you may get compilation errors.   test1
Warning 2   The primary reference "Microsoft.CSharp", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "Microsoft.CSharp" or retarget your application to a framework version which contains "Microsoft.CSharp".    test1
Warning 3   The referenced component 'Microsoft.CSharp' could not be found.     
Warning 4   The referenced component 'System.Xaml' could not be found.  

是否可以将VS2010应用程序移植(或返回目标)到.NET 3.5?如果可以,怎么办?

Is it possible to back port (or back target) a VS2010 app to .NET 3.5? If so, how?

我发现有一个控件-DataGrid-设计用于.NET4.我必须安装WPF Tool Kit才能将控件反向移植到3.5.希望有人能对此有所帮助.

I found there was one Control - DataGrid - that is designed to use for .NET 4. I have to install WPF Tool Kit to back port the controls to 3.5. Hope someone find this helpful.

推荐答案

只需删除它们即可.测试它并为我工作.我相信这些程序集仅在.NET 4中引入.例如,System.Xaml中的类型在.NET 3.5中(例如PresentationCore)定义在其他位置.有关更多信息,请参见此文章.

Just remove them. Tested it and works for me. I believe those assemblies were only introduced in .NET 4. The types in System.Xaml, for example, are defined some place else in .NET 3.5 (like PresentationCore for example). See this article for more info.

这篇关于在VS2010中将.NET 4后端口退回到3.5 SP1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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