Copied to clipboard

Flag this post as spam?

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


  • Adam Betts 5 posts 25 karma points
    Jul 16, 2011 @ 18:46
    Adam Betts
    0

    Installing Umbraco and working with Visual Studio 2010

    Hello Umbraco community.

    I'm setting up Umbraco to work locally on IIS 7, and have successfully installed Runway and happily played around with various features.

    However I want to use Visual Studio to develop my website, and use the Umbraco CMS for managing and adding content.

    I have followed the guidance here:

    http://our.umbraco.org/wiki/codegarden-2009/open-space-minutes/working-in-visual-studio-when-developing-umbraco-solutions


    ....but whenever I use any asp.net code I get this message:

     

     

    Object reference not set to an instance of an object.

    Server Error in '/' Application.

    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.presentation.urlRewriter.UrlRewriterFormWriter.WriteAttribute(String name, String value, Boolean fEncode) +439
       System.Web.UI.HtmlControls.HtmlForm.RenderAttributes(HtmlTextWriter writer) +908
       System.Web.UI.HtmlControls.HtmlControl.RenderBeginTag(HtmlTextWriter writer) +70
       System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +30
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +11333553
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +245
       System.Web.UI.Page.Render(HtmlTextWriter writer) +39
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5289
    



    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

     

    To try and strip out any guff to narrow the cuase of the problem I have done the following.  On a non-umbraco website I have ceated a simple html default page, and a test1.aspx page that contains some very simple asp.net code.  This works on the non-umbraco site, but fails when I publish to my umbraco site.  Here is my default page that works on both Umbraco and the non-umbraco site:

     

    default.aspx that works on both....

    <%Response.Write(now())%>

    <%Dim rootPath As String = Server.MapPath("~")%> <%Dim physicalPath as string = System.Web.HttpContext.Current.Server.MapPath("~/") %> ARSE

    Root Path: <%Response.Write(rootpath)%>

    Application Path: <%Response.Write(physicalPath)%>

    test page

     

    test1.aspx that fails on Umbraco

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="test1.aspx.vb" Inherits="adambetts.test1"  %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    test1
    <asp:Menu ID="nob" runat ="server" >
    <Items>
    <asp:MenuItem NavigateUrl ="~/Default.aspx" text ="Text Go home">
    </asp:MenuItem>
    </Items>
    </asp:Menu>
    </div>
    </form>
    </body>
    </html>

     

    I am fairly new to this so hope it is something idiotic, such as me not understanding 'codebehind' or 'inherits' properly, or possibly not understandingthe mechanics of Umbraco.  I've tried various application pools in IIS, and think that the fact that it works on my non-umbraco website suggests it is not an IIS issue?

     

    Can any one help at all?

    PS. I've been stuck at this point for weeks, so this isn't a call for help at the first hurdle!

     

    Thanks, Adam

     

     

     

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jul 16, 2011 @ 18:52
    Sebastiaan Janssen
    0

    Have a look at my blogpost here: http://cultiv.nl/blog/2009/6/1/easily-debug-your-custom-umbraco-user-controls-in-visual-studio/

    This is still mostly how I do it, but in VS2010 now.

  • Adam Betts 5 posts 25 karma points
    Jul 18, 2011 @ 23:43
    Adam Betts
    0

    Thanks for the reply, I'll give your method a go at the weekend.  I'm wondering if my copy commands have overwritten an umbraco dll possibly.

  • Raveendra Bj 5 posts 25 karma points
    Mar 05, 2015 @ 16:33
    Raveendra Bj
    0

    I am looking for setting up umbraco 6 in visual studio 2010.

    Can somebody help me out with this? I am looking kind of step by step process to setup the umbraco.

     

    I already have tried to install umbraco using nuget package and then copied the umbraco folder in local but its not working.

    Please help me out with this.

  • Sören Deger 733 posts 2844 karma points c-trib
    Mar 05, 2015 @ 16:37
    Sören Deger
    0

    Hi Raveendra,

    why do you have copied the umbraco folder? After nuget install you can start the installation wizard from umbraco with F5.

    You can find the step by step process to setup umbraco here:

    https://our.umbraco.org/documentation/Installation/

     

    Hope this helps?
     

    Best,

    Sören

  • Raveendra Bj 5 posts 25 karma points
    Mar 05, 2015 @ 16:43
    Raveendra Bj
    0

    Hi,

    Thanks for reply,

    My problem is, I want to use umbraco with mvc 4.0  in visual studio 2010.

    Now as you suggested me I have installed umbraco using nuget but still some setting required, because I am not able to run umbraco directly.

    can you send me more specific installation guid or links.

     

    Thanks in advanced.

     

  • Sören Deger 733 posts 2844 karma points c-trib
    Mar 05, 2015 @ 16:50
    Sören Deger
    0

    Hi Raveendra,

    Umbraco 6 works default with webforms. You must change the defaultRenderingEngine in umbracoSettings.config from webforms to MVC. Maybe this can solve your problem.

    Here is an other link:

    http://www.ben-morris.com/using-umbraco-6-to-create-an-asp-net-mvc-4-web-applicatio/

     

    Best, 

    Sören

  • Raveendra Bj 5 posts 25 karma points
    Mar 05, 2015 @ 18:37
    Raveendra Bj
    0
    Hi Soren,
    In given link they are are asking for download this - Umbraco Installation zip archive, 
    ok,

    now when I open this link there is nothing to doanload.
    Please suggest me where  I can get Umbraco Installation zip archive.
    I have downloaded one from CodePlex using serch option, but not sure whether it is a right version.
    Thanks,
    Raveendra
  • Sören Deger 733 posts 2844 karma points c-trib
    Mar 05, 2015 @ 18:50
    Sören Deger
    0

    You find here all umbraco releases:

     

    https://our.umbraco.org/download

     

    Cheers,

    Sören

Please Sign in or register to post replies

Write your reply to:

Draft