我已将我的 mvc 应用程序发布到 Godaddy(root,即 www.example.com),并且一切正常。现在我需要将一些 html 文件发布到我设置的子域(即 subdomain.example.com)。
但是现在当我浏览到 subdomain.domain.com 时出现 web.config 错误
"Could not load file or assembly 'System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified." Line 101: add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /...
子域目录中唯一的文件是 html 文件。为什么 web.config 发挥作用?我认为有一个子域可以分隔这些虚拟目录(根和子域)?
最佳答案
你提到这些是 .html 文件。确定它们不是 .cshtml?
抛开域的奇怪之处 - 您的主机在其 GAC 中没有“ASP.NET 网页”System.Web.Helpers 程序集,或以其他方式可用于您的部署。
要解决此问题,您需要对程序集进行 bin-deploy。首先创建一个 bin
目录,并上传 System.Web.Helpers.dll
那里。
你会在你的开发机器上找到它,比如 C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.Helpers.dll
关于asp.net-mvc - 带有 mvc godaddy 托管的子域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5129447/