I got this problem when publishing my app from Visual Studio 2015 in Azure; it looked like this:
Apparently It didn't load .css files properly (and who knows what else).
I did a lot of investigation but contrary to what I expected, It was very difficult to find the source of the problem, yet in some lost forum I found out that web.config gets Its property changed when being published, my local web.config looks like this:
<system.web>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5.2" />
<httpRuntime targetFramework="4.5.2" />
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
</httpModules>
My remote web.config like this:
<system.web>
<authentication mode="None" />
<compilation targetFramework="4.5.2" />
<httpRuntime targetFramework="4.5.2" />
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
</httpModules>
When I added the debug="true" in compilation it worked properly:
I want to leave this here for helping anyone else having this same problem, and by the way my questions:
1- Why disabling debug affects how .css files (and maybe other files) are loaded?
2- Is there another way to correct this without allowing debug on my remote server?
3- Perhaps there is another workaround with this that I missed in my search for help, if anyone has experienced this before please share your knowledge.
One could expect this would be very common, after all I was only publishing an app in azure xD
It may be important to mention that my app also works with a Data Base, i will now try to learn how to implement that on azure xD
Thanks!
Edit: BundleConfig.cs
using System.Web;
using System.Web.Optimization;
namespace Distribuidora_Saturno
{
public class BundleConfig
{
// Para obtener más información sobre Bundles, visite http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
// Utilice la versión de desarrollo de Modernizr para desarrollar y obtener información. De este modo, estará
// preparado para la producción y podrá utilizar la herramienta de compilación disponible en http://modernizr.com para seleccionar solo las pruebas que necesite.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
bundles.Add(new StyleBundle("~/Content/CSS").Include(
"~/Content/CSS/bootstrap.css",
"~/Content/CSS/site.css"));
}
}
}