Subdomain with hosting mvc godaddy

I published the mvc application for godaddy (root, i.e. www.example.com) and everything works fine. Now I need to send some html files to the subdomain (i.e. subdomain.example.com) that I configured. However, now when I look at subdomain.domain.com, I get a web.config error

"Failed to 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. 101: add assembly =" System.Web .Helpers, Version = 1.0.0.0, Culture = Neutral, PublicKeyToken = 31BF3856AD364E35 "/ ...

The only files in the subdomain directory are html files. Why does web.config come into play? I thought the subdomain would separate these virtual directories (root and subdomain)?

+4
source share
2 answers

You mentioned that these are .html files. Of course they are not .cshtml?

Distinctive features of the domain - your host does not have the "System.Web.Helpers" ASP.NET Webpages assembly in its GAC or is otherwise available for your deployment.

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

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

+3
source

I used these instructions from the GoDaddy website to get mine work:

To deploy MVC3 applications with Windows hosting

In your application project, add links to the following assemblies:

  • Microsoft.Web.Infrastructure
  • System.Web.Helpers
  • System.Web.Mvc
  • System.Web.Razor
  • System.Web.WebPages
  • System.Web.WebPages.Deployment
  • System.Web.WebPages.Razor

For each link added, add the Copy Local property to True. Expand the app.

+3
source

Source: https://habr.com/ru/post/1341466/


All Articles