1
我想在我的蛋糕腳本中使用System.Data
來執行一些數據庫操作。如何在Cake腳本中引用系統程序集?
我的腳本是某事像這樣:
#r "System.Data"
void DoSomething()
{
System.Data.SqlConnection conn = new System.Data.SqlConnection(..);
}
然而,這並不編譯導致錯誤 error CS0246: The type or namespace name 'SqlConnection' could not be found (are you missing a using directive or an assembly reference?)
什麼是蛋糕腳本參考系統組件(由GAC)的正確方法?
這顯然如此。在整個生活中習慣於Intellisense會讓你在沒有的時候癱瘓;) –