MVC 部署故障排除
我似乎不太幸运地将 MVC 应用程序部署到远程主机。
我刚刚使用 Visual Studio 2010 在 MVC v2 中构建了一个更新的网站,并通过 FTP 将其发布并部署到我的主机,它不起作用。
Source Error:
Line 39: <compilation>
Line 40: <assemblies>
Line 41: <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Line 42: <add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Line 43: <add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
正如您从链接中看到的,第 41 行显然是问题所在,它表示无法加载 MVC 程序集,因为它应该包含清单。
我相当确定我已经提供了所有正确的参考资料和文件版本,那么我还可能缺少什么?通配符应用程序映射已在服务器上实现。
I don't seem to have much luck with deploying MVC applications to my remote host.
I've just built an updated site in MVC v2 using Visual Studio 2010 and, having published and deployed it via FTP to my host, it's not working.
Source Error:
Line 39: <compilation>
Line 40: <assemblies>
Line 41: <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Line 42: <add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Line 43: <add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
As you can see from following the link, line 41 is apparently the problem, saying that the MVC assembly could not be loaded because it was supposed to contain a manifest.
I was fairly certain I'd provided all the correct references and file versions, so what else could I be missing? Wildcard application mappings have been implemented on the server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
asp.net mvc 通常安装在运行它的系统上。当你构建VS项目时,你是否将MVC设置为复制到目标目录?我知道,当服务器上未安装 mvc 1.0 时,将 mvc dll 设置为复制可以在部署 mvc 1.0 时发挥作用。
asp.net mvc typically installs on the system that you run it on. When you built your VS project did you set MVC to copy to the destination directory? I know that setting the mvc dll to copy worked in deploying mvc 1.0 when it wasn't installed on the server.
再次与 Web 主机检查后,问题是我的服务器不支持 MVC2,我必须将项目引用设置为 MVC dll 版本 1.0,网站才能正常工作。
The issue, upon checking again with the web host, was that MVC2 is not supported on my server and I had to set the project reference to version 1.0 of the MVC dll for the site to work.
由于您计划使用驻留在本地 bin 中的程序集而不是 GAC。您可以尝试在 web.config 中不使用全名。
您可以使用 ildasm 检查程序集的清单。在您部署在 Web 服务器上的 mvc 程序集的精确副本上进行尝试,看看是否有任何问题。
Since you plan to use assemblies resides in local bin rather than GAC. You can try not using full name in web.config.
You can check the manifest of the assembly with ildasm. Try it on the exact copy of mvc assembly you deployed on the web server to see if there is any problem with it.