[英]Visual Studio and namespaces
我試圖將一些代碼從一個VS2008項目移到另一個。
我從中獲取代碼的項目可以正常工作,並且在將代碼復制到新項目中時不會以任何方式更改代碼。
代碼大致如下:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Diagnostics;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace CommonTools
{
public class ColumnCollectionEditor : CollectionEditor
{
.....
}
}
我遇到的問題是,在“新”項目中,VS在提供的名稱空間中找不到“ CollectionEditor”,因此該項目無法構建。
“新”和“舊”項目都針對.NET 3.5
任何我在這里出錯的想法。
確保新項目引用的程序集與舊項目引用的程序集相同。
MSDN說System.ComponentModel.Design.ColectionEditor
在System.Design.dll
。
您是否嘗試過在原始解決方案中的CollectionEditor
上使用“轉到定義”以查看應包含的內容?
您是否包含此“ System.Design.dll”?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.