2011-07-05 77 views
0

我想在IIS中託管WCF服務,以便可以從Silverlight應用程序訪問net.tcp綁定。我一直在關注本教程的步驟:
http://msdn.microsoft.com/en-us/library/ms733766.aspx
我可以得到一個簡單的例子,服務類型的工作,但是當我嘗試一個真正的項目中,我碰到了以下內容:向WCF添加程序集引用時出現問題web.config

Line 6: using NUnit.Framework; 
CS0246: The type or namespace name 'NUnit' 
     could not be found (are you missing 
     a using directive or an assembly reference?) 

我知道你的」重新思考,是的,這是真的。我單元測試。

我的目錄結構是這樣的:
根:service.svc和App_Code文件\
的app_code:項目文件,web.config文件,BIN \和大量的代碼在不同的目錄
斌:debug文件夾
調試:nunit dll和項目二進制文件。

我試着添加以下到我的web.config:

<compilation> 
    <assemblies> 
    <add assembly="nunit.framework"/> 
    </assemblies> 
</compilation> 

而且我打過一輪將.dll和路徑名等,但它們都導致:

Could not load file or assembly 
'nunit.framework' or one of its dependencies. 
The system cannot find the file specified. 

我如何讓魔法發生?

工具:VSE2010,IIS7快遞,MS WebMatrix中

編輯: web.config文件更改爲:

<add assembly="nunit.framework, Version=2.5.9.10348, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77"/> 

至於建議由史蒂夫是答案=)

+0

您嘗試使用完全合格的名字嗎?另外,您可以使用Fusion Log來確定發生了什麼。 – Steve

回答