• Home
  • Git
  • Programming
  • Leadership
  • About

Git Fetch Victor

Git, Programming and so much more...

Hosting ASP.NET on Shared Hosting Site

Written by vjpudelski on July 2, 2016

Within the last few weeks I decided to take the venture of moving my host provider from one web hosting company to another. At the same time I decided that I wanted to do Windows hosting going forward so that I could host ASP.NET applications. I figured this would be easier since I know more of C# and .NET than I do PHP and the linux web hosting technologies. Boy, was I wrong…

So the first issue was with the domains. Normally when you transfer domains from one provider to another it can take up to 7 days. For some reason one of my domains transferred in what felt like hours. Instead of a week I received the email that the domain transferred in a day or two. Although I received an email that the domain transferred and it showed on the new provider, the old provider also still displayed the domain. Thus when I deployed my new website and all the files to the new provider it would sometimes display the old provider. Awesome times…

Once that was straightened out my new site starting throwing a 403 – Forbidden error anytime that I browsed to the page. The 403 error seemed consistent but then when I deployed my solution would work and I could browse to the pages without issue for a few minutes until the 403 error would resurface. Contacting the host provider the 403 error appeared to be caused by settings on the server. This lead the provider to ask me to change several things in my web.config file as well. This included code to add the following:


<system.webServer>
<modules runAllManagedModulesForAllRequests="true"></modules>
</system.webServer>

This seemed like a bit of overkill. This also did not fix the issue either. Instead the error continued and given that this didn’t seem to work, I reviewed other solutions and suggestions made online and replaced the above with:


<system.webServer>
<modules>
<remove name="UrlRoutingModule~4.0" />
<add name="UrlRoutingModule~4.0" type="System.Web.Routing.UrlRoutingModule" preCondition=""/>
</modules>
</system.webServer>

Although this code seemed to directly address the issue, it didn’t work either.

The issue at this point was diagnosed to be with ASP.NET and more specifically the MVC routing within. None of the views were being properly executed and the controllers were never being reached. No matter what I did the error would not cease as every time I deployed it worked for a while and then around 30 minutes later it would go back to 403 – Forbidden.

The issue turned out to be an issue with the precompile setting on the publish settings dialog. Below is the settings dialog.

Visual Studio 2015 Publish Settings Dialog
Visual Studio 2015 Publish Settings Dialog

The second checkbox was causing the issue. For some reason checking this box would cause a security issue that would prevent the MVC Routing for executing properly.

Maybe next time I will realize the shortcut isn’t worth it…

Posted In Programming | Troubleshooting
Tagged aspnet | web hosting

Post navigation

PreviousPaying It Forward
NextImpostor Syndrome, my dealings…

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Leaders Eat Last
  • Java calling .NET WebAPI
  • So What Really Mattered?
  • What really matters?
  • Has It Really Been Over a Year!

Recent Comments

  • Jason King on Has It Really Been Over a Year!
  • Sarah Dutkiewicz on Changing the Past
  • Dave Balzer on Team Culture
  • Sarah Dutkiewicz on Team Culture
  • Sarah Dutkiewicz on Impostor Syndrome, my dealings…

Archives

  • April 2019
  • February 2019
  • January 2018
  • October 2017
  • September 2016
  • August 2016
  • July 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • August 2015
  • January 2015

Categories

  • Git
  • Leadership
  • Non-Technical
  • Personal
  • Programming
  • Raspberry Pi
  • Reviews
  • Troubleshooting
  • Unstoppable Course

Tags

aspnet aspnetcore books coaching CodeMagazine cron csharp culture dotnet dotnetcore dreams git iPhone java management nike Nozbe Raspian rsync running samba server source control SubtleArtOfNotGivingAFck teams vscode web hosting

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Copyright © 2025. Git Fetch Victor
Powered By WordPress and Auspicious