.net 目标框架场死

.net 目标框架场死,.net,visual-studio-2012,frameworks,.net,Visual Studio 2012,Frameworks,我为Win8启动Visual Studio 2012,为新项目选择C,Windows运行时组件,然后键入“cw+TAB+TAB”打印“Console.WriteLine();” 出现这一行:global::System.Console.WriteLine()我的代码如下: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Task

我为Win8启动Visual Studio 2012,为新项目选择C,Windows运行时组件,然后键入
“cw+TAB+TAB”打印“Console.WriteLine();”

出现这一行:
global::System.Console.WriteLine()我的代码如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WindowsRuntimeComponent1
{
    public sealed class Class1
    {
        global::System.Console.WriteLine();
    }
}
出现以下错误:

Error 1  Invalid token '(' in class, struct, or interface member declaration" ,
Error 2 The type or namespace name 'Console' does not exist in the namespace 'System' (are you missing an assembly 
这些错误的答案在网上都是一样的:我必须将“.NetFramework”从4.5回滚到4.0-但是,当我转到解决方案资源管理器的属性时,目标框架为空且已禁用。我不能做任何事情来改变它,那么我该如何解决这个问题呢


这些错误的解决方案可能不仅仅在于更改NET Framework,请随时分享您对该问题的所有了解。

Microsoft Visual Studio 2012,至少是Express Edition(尚未试用Pro+),提供多个版本-
Microsoft Visual Studio 2012 for Windows 8
专门用于构建Win8应用程序(那些Windows应用商店应用程序,以前称为“Metro”应用程序)。Win8应用程序运行的运行时与CLR不同,在早期的框架版本中不存在CLR,因此出现了blocked target framework下拉列表

如果您正在寻找允许您构建WinForms、WPF和控制台应用程序的“传统”IDE,您需要
Microsoft Visual Studio 2012 for Desktop


如果您正在寻找Web开发,您需要Microsoft Visual Studio 2012 for Web

Win8应用程序运行时与常规.net应用程序运行时不同。如果您想使用
控制台
,可能需要使用CLR版本。谢谢!我觉得这很有帮助!