我啓動Visual Studio 2012的Win8,選擇C#爲新建項目,Windows運行時組件,然後乾脆當我輸入"cw+TAB+TAB" to print "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
對這些錯誤的答案都是一樣的在線:我有滾動」 .NetFrame工作「返回形式4.5到4.0 - 但是,當我去解決方案資源管理器的屬性,目標框架是空白和禁用。我無法做任何改變,所以我該如何解決這個問題?
錯誤的解決方案可能不僅僅是改變.NET Framework,隨意分享你對這個問題的所有了解。
Win8應用程序的運行時間不同於普通的.net應用程序。如果你想使用'Console',你可能想使用一個運行CLR的版本。 –