开发者

subdomain with mvc godaddy hosting

I've published my mvc app to godaddy (root, ie www.ex开发者_如何学Pythonample.com) and all works great. Now I need to post some html files to a subdomain (ie subdomain.example.com) which I've set up. However now when I browse to subdomain.domain.com I get web.config error

"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" /...

The only files in subdomain directory are html files. Why is web.config coming into play? I thought having a subdomain would separate these virtual directories (root and subdomain)?


You mention these are .html files. Sure they're not .cshtml?

Domain oddities aside - your host doesn't have the "ASP.NET Webpages" System.Web.Helpers assembly in their GAC, or otherwise available for your deployment.

To solve this, you need to bin-deploy the assemblies. Start by creating a bin directory, and uploading the System.Web.Helpers.dll there.

You'll find it on your developer machine at somewhere like C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.Helpers.dll


I used these instructions from the GoDaddy site to get mine working:

To Deploy MVC3 Applications with Windows Hosting

In your application's project, add references to the following assemblies:

  1. Microsoft.Web.Infrastructure
  2. System.Web.Helpers
  3. System.Web.Mvc
  4. System.Web.Razor
  5. System.Web.WebPages
  6. System.Web.WebPages.Deployment
  7. System.Web.WebPages.Razor

For each reference you just added, set the Copy Local property to True. Deploy your application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜