2009-01-21 24 views
0

我創造了我的第一個WCF RESTful服務只有一個的GetData和它完全在本地主機,但是當我把它添加到一個託管環境,我得到:Microsoft.ServiceModel.Web是否只能在GAC中使用?

Server Error in '/' Application. 
Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0234: The type or namespace name 'ServiceModel' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 

這是否意味着我需要將DLL文件放在GAC這個工作?它不應該在我的服務的BIN文件夾中工作嗎?

這裏是我的服務文件夾的樣子:

Service.svc 
Service.svc.cs 
web.config 
BIN 
    Microsoft.ServiceModel.Web.dll 
    Microsoft.ServiceModel.Web.pdb 
    MyService.dll 
    MyService.pdb 
PROPERTIES 
    AssemblyInfo.cs 

可我爲了使這項工作做什麼?

+0

是你的web.config中引用的DLL? – Stobor 2009-01-21 00:23:48

回答

1

當我第一次嘗試在IIS 7.5中直接創建虛擬目錄時,在將我的RESTful Web服務發佈到此文件夾之前,我遇到了同樣的問題。

我的解決方案是使用Visual Studio 2008(項目屬性/ Web選項卡/「使用IIS服務器」)來選擇文件夾,然後在同一個選項卡上的「創建虛擬目錄」按鈕來創建虛擬目錄。一切都很好。

相關問題