![](/img/trans.png)
[英]CS0234: The type or namespace name 'Description' does not exist in the namespace 'System.Web.Http' (are you missing an assembly reference?)
[英]CS0234: The type or namespace name 'WebPages' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
我建立了一個簡單的Web API項目,該項目從數據庫讀取數據。 我正在使用VS 2012,並且在我的win7機器上可以正常工作。 我已將Web應用程序發布到本地文件夾,並將其部署到其他win7機器上。 但是,在嘗試訪問第二台計算機上的URL時,會出現上述錯誤。
這是錯誤的行:
**
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 'WebPages' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Source Error:
Line 30: <namespaces>
Line 31: <add namespace="System.Web.Routing" />
Line 32: <add namespace="System.Web.WebPages" />
Line 33: </namespaces>
Line 34: </pages>
Source File: c:\inetpub\wwwroot\rcItems\Web.config Line: 32
**
我已檢查兩台計算機上均已安裝Microsoft .NET Framework 4.5.1。
我試圖在我的項目中為System.Web.dll“復制本地True”並再次進行部署。
但是,我注意到第二台計算機上未安裝Microsoft .Net Framework 4.5 Multi-Targeting Pack。
另外,此文件(和文件夾)不在第二台計算機上:
C:\\ Program Files(x86)\\ Reference Assemblies \\ Microsoft \\ Framework.NETFramework \\ v4.5 \\ System.Web.dll
如果有人能對此有所啟發,請多多關照。
謝謝
確保將所有引用添加到項目中並復制本地True,然后再將其部署到可能未安裝組件的第二台計算機上。
謝謝梅森和賽傑。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.