簡體   English   中英

C#使用和編譯Windows.Form

[英]C# Using and Compiling Windows.Form

我正在使用C#編寫GUI代碼。 我正在按照這個簡單的教程開始。 要編譯,我需要引用System.Windows.Forms.DLL System.Drawing.DLL,所以我輸入

csc /r:System.Windows.Forms.DLL /r:System.Drawing.DLL FirstForm.cs

但是,我得到這樣的錯誤:

FirstForm.cs(6,14): error CS0012: The type 'System.ComponentModel.Component' is
    defined in an assembly that is not referenced. You must add a reference
    to assembly 'System, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=b77a5c561934e089'.
c:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Windows.Forms.dll:
    (Location of symbol related to previous error)

我已經在我的路徑中添加了“c:\\ Windows \\ Microsoft.NET \\ Framework \\ v4.0.30319”。 我不知道為什么它告訴我在我已有的時候引用它。

您需要將/r:System.DLL添加到命令行參數中

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM