MVC websites can be run on our Windows Shared Hosting environment, but they must be configured correctly.
Firstly, they must be running on our Windows 2012 servers.
You can check this in your control panel by going to Home > Hosted Domains > [Domain Name] > Web
You'll see a screen like these below:
The Resource needs to be IIS Shared Hosting 2012.
If it's set to 2008, you will need to change to a webspace that is running 2012.
Once it's on a 2012 webspace, you need to ensure that the Website Configuration is set correctly.
Home > Hosted Domains > [Domain Name] > Website Configuration
SSI set to on.
ASP needs to be off, with ASP.NET set to 4.5.
(IMPORTANT) ISAPI rewrite needs to be off.
You'll need FTP on.
PHP and ActivePerl can be turned on if required, and should be running as CGI applications.
You must also ensure the following section for modules is included system.webServer section of your web.config file:
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" preCondition="" />
The Roslyn Compiler cannot be used on our Shared Hosting.
There is a way to compile the site without using Roslyn.
1. Open NuGet Package Manager from tools menu or Use Manage NuGet Packages for Solution. This will allow you to uninstall packages from the project which is using that package.
2. You need to uninstall Microsoft.CodeDom.Providers.DotNetCompilerPlatform using the following command in the Package Manager Console:
Uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform <Your Web project name>
3. You can now rebuild, and republish the project. In your web project publish profile settings, uncheck "Allow precompiled site to be updatable". You can find this under Settings > Precompile during publishing > Configure.