2013-03-05 45 views
1

爲什麼我不能使用下列公共類:不能在我的web服務使用公共類

namespace OrganizerUI.App_code 
{ 
    public class Employee 
    { 

     private string text; 

     public string Text 
     { 
      get { return text; } 
      set { text = value; } 
     } 

    } 
} 

在我web service

enter image description here

+0

你是否在webservice中使用OrganizerUI.App_code? – 2013-03-05 14:15:01

+0

是的,我確實..... – 2013-03-05 14:16:24

+2

您的Web服務代碼文件是否設置爲編譯?默認情況下,添加到App_Code文件夾的代碼被設置爲「content」而不是「compile」。右鍵單擊文件,獲取屬性並檢查。 – Lukos 2013-03-05 14:17:35

回答

5

常(常?),即使它們是.Net代碼,添加到Visual Studio App_Code目錄中的代碼文件也不會被默認設置爲編譯。它們被設置爲「內容」,這意味着它們僅包含在輸出中。如果右鍵單擊該文件並選擇「屬性」,則可以看到/將其更改爲「編譯」而不是「內容」。

相關問題