![](/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.