我根据专业ASP.NET 3.5 MVC的第13章,由Scott Hanselmen,Phil Haack和Rob Conery将一个ASP.net 4 webform项目转换为Asp.net MVC4,由Wiley Publishing,Inc.出版(ISBN:978-) 0-470-38461-9).我也关注了这个博客.现在我可以添加控制器,视图等.所有引用都设置正确.没有构建错误.但是在启动转换后的项目时,我遇到了编译错误.我在同一台机器上安装了mvc3.我甚至改变了对它的引用.它仍然抱怨.你能帮忙吗?谢谢.
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 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Source Error:
Line 109: <namespaces>
Line 110: <add namespace="System.Web.Helpers"/>
Line 111: <add namespace="System.Web.Mvc"/>
Line 112: <add …Run Code Online (Sandbox Code Playgroud) ASP.NET MVC4应用程序包含包含Razor帮助程序的App_Code文件夹中的Helper.chtml文件.升级到Visual Studio Communitity版本后编译错误
Error CS0234 The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) C:\Users\user\AppData\Local\Temp\Temporary ASP.NET Files\admin\e209c0e0\c74032ba\Sources_App_Code\helper.cshtml.72cecc2a.cs 16
Run Code Online (Sandbox Code Playgroud)
开始发生.生成的代码包含:
namespace ASP {
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq; // Error occurs in this line
using System.Net;
using System.Web;
using System.Web.Helpers;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using System.Web.WebPages.Html;
#line 1 "C:\Web\Erp\App_Code\Helper.cshtml"
using System.Web.Mvc;
#line default
#line hidden
#line 2 "C:\Web\Erp\App_Code\Helper.cshtml"
using System.Threading;
#line default
#line hidden
#line …Run Code Online (Sandbox Code Playgroud) asp.net-mvc visual-studio razor razor-declarative-helpers asp.net-mvc-4
将项目部署到我们客户的某个服务器时,我们遇到错误.该系统在我们的本地开发和登台环境中运行良好.错误是:
命名空间"System.Data"中不存在类型或命名空间名称"Linq"
我们已经做了明显的检查: - 我们在web.config中有System.Data.Linq,System.Core,System.Linq等的引用 - 我们项目的目标框架是3.5 - 我们已经确认了ASP.客户端服务器上的IIS中的.NET版本是2.0.50727 - 我们已确认服务器已安装框架3.5并包含Windows/assemblies文件夹中的System.Data.Linq DLL.
还有其他想法吗?