Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Anders Bjerner 487 posts 2989 karma points MVP 8x admin c-trib
    Dec 12, 2013 @ 20:29
    Anders Bjerner
    0

    NullReferenceException on Azure Website (Umbraco 7)

    Hi, I'm trying out Umbraco 7 and Azure websites for a pet project, but I have run into a rather annoying problem.

    I have used Visual Studio/NuGet to install Umbraco on my local machine, and then pushed the files to a Git repository, and configured the website to automatically pull from that repository. Also I'm using an Azure SQL database. My site works fine when running it locally, but when trying to access it on Azure, I get the following error:

    Object reference not set to an instance of an object.

    [NullReferenceException: Object reference not set to an instance of an object.] Umbraco.Web.UmbracoModule.BeginRequest(HttpContextBase httpContext) +16 Umbraco.Web.UmbracoModule.

    I'm not sure whether this is related to Umbraco 7, since I have had the same problem with Umbraco 6 in an Azure VM. This could however be solved by installing MVC 4 on the server, but I'm not sure how to do this for a website, and if it will solve my problem.

    Thanks, Anders

  • Sahan Rodrigo 25 posts 97 karma points
    Jan 10, 2014 @ 15:26
    Sahan Rodrigo
    0

    Hi Anders

    I am getting the same error when trying to deploy Umbraco 7.0.1 on to Azure with SQL Azure databse, is there any luck on this issue?

    Thanks,

    Sahan

  • Anders Bjerner 487 posts 2989 karma points MVP 8x admin c-trib
    Jan 10, 2014 @ 15:31
    Anders Bjerner
    101

    Actually yes - I had forgotten all about this thread. When deploying from a Git repository, Azure will only include files that are in the Visual Studio project. So if you add Global.asax to your .csproj, and commit the changes, it should work. That was at least what worked for me.

    The problem occurs because the NuGet package won't add all files to the .csproj since not all of them are needed in Visual Studio. You might also have to add some other files, the Global.asax is the one causing the error.

Please Sign in or register to post replies

Write your reply to:

Draft