关于MVC4项目发布版部署到虚拟机的问题

abz7676 abz7676 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
目前报的错是(下面问号标识处,说找不到System.Web.Mvc):



Server Error in '/' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyTokenXXXX' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error:

Line 40: <add assembly="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=XXX" />
Line 41: <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=XXX" />
??????Line 42: <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=XXX" />??????
Line 43: <add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=XXX" />
Line 44: </assemblies>

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=XXX' could not be loaded.






接下来从头开始讲吧,因为我这边的项目编译的时候不报任何错,但是发布的时候报很多错,如下面所示



错误 1 命名空间“System.Data.Entity”中不存在类型或命名空间名称“Validation”(是否缺少程序集引用?) D:\ABC\ABC.Repository\Infrastructure\GenericUnitOfWork.cs 6 26 ABC.Repository


错误 2 未能找到类型或命名空间名称“DbContext”(是否缺少 using 指令或程序集引用?) D:\ABC\ABC.Repository\Infrastructure\GenericUnitOfWork.cs 10 90 ABC.Repository

错误 3 未能找到类型或命名空间名称“IDbSet”(是否缺少 using 指令或程序集引用?) D:\ABC\ABC.Repository\SelfCommitRepository.cs 17 26 ABC.Repository


错误 4 未能找到元数据文件“D:\ABC\ABC.Repository\bin\Release\ABC.Repository.dll” D:\ABC\ABC.Services\CSC ABC.Services

错误 5 未能找到元数据文件“\ABC.Services\bin\Release\ABC.Services.dll” D:\ABC.Web\CSC ABC.Web




然后我干脆把项目里的ABC.WEB这个目录提出来,将这个目录下面所有的CS文件全部删掉,将ABC.WEB这个目录变成项目的发布版

VMware虚拟机上安装的是IIS 6和 .net framework 4.6 IIS和.NET framework服务启动正常,数据库连接正常


...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
abz7676
.NET社区 62,271 成员 668,968 内容