2011-05-26 53 views
1

我創建了一些C#控制檯程序來測試MSSQL數據庫中的存儲過程。我將連接字符串存儲在app.config中的數據庫中。在項目中的每個類引用連接字符串,但它們都有一個主要的方法,在其中,所以我寫了這個劇本做編譯:App.config和csc.exe

@echo off 

SET csc=C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\csc.exe /nologo 
SET tgt=/target:exe 
SET cfg=/appconfig:app.config 

%csc% /out:Update_Workorder_Status %cfg% %tgt% Update_Workorder_Status.cs 
%csc% /out:Get_Workorders_By_User %cfg% %tgt% Get_Workorders_By_User.cs 
%csc% /out:Get_Workorders_By_Customer %cfg% %tgt% Get_Workorders_By_Customer.cs 

我得到這個錯誤:

CS0103 "The name 'Properties' does not exist in the current context."

有什麼額外的我需要通過編譯器?

回答

1

看來你的類使用的Visual Studio生成的資源文件或設置,因此您需要添加Properties\SomeFile.Designer.cs

0

有一個VS生成的文件名爲Settings.Designer.cs可能是必要的