我写了一个简单的VS2010 WPF应用程序,它针对.NET Framework 4客户端框架。 (实际上,我的应用程序不使用任何.NET 4功能,但是由于默认情况下,VS2010会开始我的项目以针对.NET 4,因此我没有检查它)
我发现所有XP系统甚至一些各种语言的Window 7无法启动该应用程序。 我决定将我的应用程序回退到针对.NET Framework 3.5或.NET Framework 3.5客户端框架,方法是更改解决方案属性中的“目标框架”。 但是应用程序在System.Xaml和Microsoft.CSharp上编译或构建时出现以下错误:
我发现所有XP系统甚至一些各种语言的Window 7无法启动该应用程序。 我决定将我的应用程序回退到针对.NET Framework 3.5或.NET Framework 3.5客户端框架,方法是更改解决方案属性中的“目标框架”。 但是应用程序在System.Xaml和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?如果可以,如何进行?
[编辑]
我发现有一个控件 - DataGrid - 是为.NET 4设计的。我必须安装WPF工具包才能将控件回溯到3.5。希望对某些人有所帮助。