1
votes

I am trying to install a clean Umbraco installation from NuGet in Visual Studio 2012, but when I am trying to run the code I get this 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.<Init>b__8(Object sender, EventArgs e) +253
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Steps on how I do

  1. New Project
  2. ASP.NET MVC 4 Web Application
  3. Empty [Solution template]
  4. Open Package Manager Console
  5. Install nuget; PM> Install-Package UmbracoCms
  6. Build Solution
  7. Getting my error

Note: I am installing version 7.1.1 and using Visual Studio 2012 Professional

3
Sound like you opted NOT to overwrite global.asax (and/or web.config during install). Please try again and answer YES to overwrite web.config and global.asax.sebastiaan
I dont even get the chance to say Yes/No. Noticed this in the console when installing. 'Web.config' already exists. Skipping... 'Global.asax' already exists. Skipping...Sigils
Okay, also make sure to update to the latest version of NuGet, it helps a lot for some of these strange errors.sebastiaan
Thanks sebastiaan, already found the problem, and it was that I needed the latest version of NuGet! :)Sigils

3 Answers

5
votes

Before installing Umbraco cms to an existing VS MVC4 project you have to delete

  1. all the config files in the App_Start folder,
  2. web.config in the 'views' folder and
  3. the global.asax files of the MVC project.

For more details please refer link http://umbraco.tv/videos/developer/fundamentals/surface-controllers/setting-up-the-vs-solution/

1
votes

You can also setup an Umbraco 7 Application by following the steps below,

  1. Install Microsoft WebMatrix (http://www.microsoft.com/web/webmatrix/)
  2. Open WebMatrix -> New -> App Gallery
  3. Select Umbraco CMS and click next and follow the instructions.
  4. Once done you can work on umbraco using the WebMatrix itself, or you can open the created website in Visual Studio to work.
1
votes

Thanks everyone for the alternative solutions, I simply found out that the case it didn't work is because I needed to update Visual Studio 2012 for their new update, version 4.

So if anyone is getting this kind of errors trying to install Umbraco 7 through Visual Studio 2012

Error 1

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.<Init>b__8(Object sender, EventArgs e) +253
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Error 2

The view '/umbraco/install/views/index.cshtml' or its master was not found or no view engine supports the searched locations. The following locations were searched:
/umbraco/install/views/index.cshtml

Solution

Update Visual Studio 2012 to version 4 (the newest)

  1. Tools
  2. Extensions and updates
  3. Updates

Simply update everything there.