NullReferenceException only on pre-compiled site

Last post 02-28-2009, 11:43 AM by bdway. 2 replies.
Sort Posts: Previous Next
  •  02-27-2009, 4:37 PM 49343

    NullReferenceException only on pre-compiled site

    Everything works when I test my site using VS2005s built in web server.  If I upload my site to the staging server and allow it to JIT compile everything works fine.  If I try to pre-compile the website and upload it to the staging server I will get a System.NullReferenceException: Object reference not set to an instance of an object. error when I visit the page with the CuteEditor control.
     
    I've got this reference at the top of the page:
     
    <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>
     
    This is my declaration of the control in an EditItemTemplate in a gridview on the page:
     
    <CE:Editor id="Editor1" runat="server" Text='<%# Bind("Body") %>' BreakElement="Br" Width="99%" />
     
    Why does all of this work perfectly when using JIT compile but not when pre-compiling the site?  Note, I have left the Client files out of the compile and add them manually to the deployment folder after the compile finishes.
  •  02-27-2009, 5:26 PM 49346 in reply to 49343

    Re: NullReferenceException only on pre-compiled site

    I thought I had figured this out.  I thought I needed to include a using directive in the code behind page.  It seemed to work at first but still no luck.

  •  02-28-2009, 11:43 AM 49357 in reply to 49343

    Re: NullReferenceException only on pre-compiled site

    This time I really did figure it out!  It turns out that when I precompiled the site the cuteeditor.lic file did not get copied to the Output bin folder.  Normally VS just copies evrything that is not compiled as is, I don't know why it skipped this file.  I can't believe I missed that...
View as RSS news feed in XML