Copied to clipboard

Flag this post as spam?

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


  • Niclas Schumacher 67 posts 87 karma points
    Jan 13, 2014 @ 09:45
    Niclas Schumacher
    0

    Visual studio and umbraco 7

     

    Hello guys. 

    Has anyone successfully installed Umbraco 7.0.1 via nuget? 

    Im on windows 8, Visual Studio 2012. Im creating a .NET 4.0 mvc project.
    Each time i try, i get the same error: 

    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace: 

    [NullReferenceException: Object reference not set to an instance of an object.]
       Umbraco.Web.UmbracoModule.BeginRequest(HttpContextBase httpContext) +58
       Umbraco.Web.UmbracoModule.<Init>b__8(Object sender, EventArgs e) +320
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

     

    Is there anyone who knows how to do this ? I just what the best and easiest way to install umbraco 7.0.1 and having the project inside visual studio. Any surgestions ? - Niclas Schumacher

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jan 13, 2014 @ 12:08
    Jeroen Breuer
    0

    Hello,

    Instead of nuget I do something similar to the Umbraco Visual Studio Project.

    I also use the Hybrid Framework.

    Jeroen

  • Andy Butland 422 posts 2334 karma points MVP 4x hq c-trib
    Jan 13, 2014 @ 23:34
    Andy Butland
    0

    Hi Niclas

    I generally start an empty ASP.Net application, and then pull in Umbraco.Cms from Nuget.  Maybe as you've already added MVC and the files that includes, that might be the issue.

    I have also seen that error before, and it was because I didn't have a global.asax page deployed.  Obviously that was for a deployed site not a local development one, but mentioning in case that gives a clue to your issue.

    Hope that helps.

    Andy

  • Niclas Schumacher 67 posts 87 karma points
    Jan 14, 2014 @ 09:25
    Niclas Schumacher
    0

    Andy - I think you are right.. because i just made a clean umbraco installation yesterday at home, and that went well.. 

  • steve_cdi 2 posts 22 karma points
    Jun 05, 2014 @ 04:28
    steve_cdi
    0

    I had the same issue when I solved another issue of the faliure of the framework to execute Application_Start method of the class configured in my Global.asax file. The solution was to inherit the class contained in Global.asax.cs from  Umbraco.Web.UmbracoApplication rather than System.Web.HttpApplication.

    Some detail...

    The default ASP Global.asax.cs class is not updated automatically and will look something like this:

    public class MyUmbracoApplication : System.Web.HttpApplication
    {
    etc...
    }

    Similarly, the default Global.asax file is (right click it  -> show markup):

      <%@ Application Codebehind="Global.asax.cs" Inherits="System.Web.HttpApplication" Language="C#" %>

    The config Inherits= should be the namespace qualified class name contained in the Global.asax.cs class file. The class should inherit from Umbraco.Web.UmbracoApplication and the OnApplicationStarted function should be overriden. The Global.asax.cs class file should look something like :

    namespace MyNamespace
    {
    public class MyUmbracoApplication : Umbraco.Web.UmbracoApplication
    {
    protected override void OnApplicationStarted(object sender, EventArgs e) {
    base.OnApplicationStarted(sender, e);
    //Put your code here
    }
    }

    Note that you must inherit from Umbraco.Web.UmbracoApplication.

    And the Global.asax config behind should look like this:

     <%@ Application Codebehind="Global.asax.cs" Inherits="MyNamespace.MyUmbracoApplication" Language="C#" %>

    This was 'doin' my head in' as they say. So I hope it's of help to others.

     

    Edit: There are good threads here:
    http://our.umbraco.org/forum/core/general/41599-How-are-people-developing-MVC-apps-within-Umbraco-v6
    http://our.umbraco.org/Documentation/Reference/Events/application-startup ;

     

  • steve_cdi 2 posts 22 karma points
    Jun 05, 2014 @ 04:35
    steve_cdi
    0

    Niclas - I think the reason that the fresh install works is that it probably takes care of these adjustments. Googling around a bit, it seems that this detail is overlooked by many ASP packages or the the naming of the project has changed at some point and the link between the Global.asax class name and config has been broken. A fresh install seemed like a drastic way of solving the issue so I hope it helps others to avoid having to resort to that.

  • Mike Stephenson 7 posts 28 karma points
    Jun 06, 2014 @ 04:59
    Mike Stephenson
    0

    I found it installs via nuget perfectly in an empty mvc project targeting 4.5, not 4.0

Please Sign in or register to post replies

Write your reply to:

Draft