2.5 to 2.6 Admin Themes Error

Topics: Themes
May 22, 2012 at 9:54 PM

After completing the App_Data migration, i started to get an error in the admin module when i access the Themes tab.

Object reference not set to an instance of an object.

Line 71:             @if (tab == "1")
Line 72:             {
Line 73:                 @Helpers.AdminHelper.InstalledThemes()
Line 74:             }
Line 75:             else

I'm guessing the is tag missing out the settings xml, but not sure what its looking for.

Anyone run into this? 

May 23, 2012 at 2:39 PM

Also I get this error.

Anyone help me ?

Thanks.

Coordinator
May 24, 2012 at 8:11 AM

This is probably an error occurring within the InstalledThemes() function.

@sanghino:  Are you upgrading your blog instance like vanadiumtech is, or is this a new installation?

In the control panel, under Settings -> Advanced Settings is a checkbox for "Enable error logging".  Try checking that, Save, and then go back to the Themes tab where the error is occurring.  After the error occurs again, check the App_Data folder to see if there is a logger.txt file.  It may contain error details to better understand the source of the error.

May 24, 2012 at 9:30 AM
Edited May 24, 2012 at 9:30 AM

I upgrade my blog instance in local.

I downloaded be 26 (web) and unzip it in a new folder. After I defined a new virtual folder, and everything seems to work (i try with data migration and without).
I forgot, I use a computer with windows xp professional sp3 with .net framework 4 and i modified configuration of web application for processing razor files.

I gave the write permission on the App_Data folder, and also on the folder themes.
Done all this I still get the error message.

So i try with be 26 (source), i downloaded it and open it with VWD 2010 .... i tried to run application and ..... and everything is working properly !!!

It's possible the problem is in iis ? (5.1 in first test vs 7 express in second test).

Now i try to apply "enable error logging" and after i report the result.

Thanks
PS Sorry for my little english, i hope to be able to explain my problem ;)

Coordinator
May 24, 2012 at 1:02 PM
Edited May 24, 2012 at 1:03 PM

If you don't get any error details with "enable error logging", here's another thing you can try if you are still getting that error.  Replace:

@Helpers.AdminHelper.InstalledThemes()

with......

try
{
	@Helpers.AdminHelper.InstalledThemes()
}
catch (Exception ex)
{
	System.Text.StringBuilder sb = new System.Text.StringBuilder();
	while (ex != null)
	{
		sb.Append(ex.Message);
		sb.Append("<br />------------------<br />");
		sb.Append(ex.StackTrace);
		sb.Append("<br />------------------<br />");
		ex = ex.InnerException;
	}
	Response.Write("Error: " + sb.ToString());
}

This should then report some error details at the top of the page, if an error occurs.

May 24, 2012 at 2:30 PM

Message is in italian ...

Error: Riferimento a un oggetto non impostato su un'istanza di oggetto. (traslated: Object reference not set to an instance of an object)

------------------

in ASP.Helpers.AdminHelper.b__3(TextWriter __razor_helper_writer) in System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) in System.Web.WebPages.WebPageBase.Write(HelperResult result) in ASP._Page_admin_Extensions_Themes_cshtml.Execute() in c:\Inetpub\wwwroot\MyBlog26\admin\Extensions\Themes.cshtml:riga 76

------------------

And this from log file:

Date: 24/05/2012 15.18.25
Url : http://localhost/MyBlog26/admin/Extensions/Themes.cshtml
Raw Url : /MyBlog26/admin/Extensions/Themes.cshtml
Message : Generata eccezione di tipo 'System.Web.HttpUnhandledException'.
Source : System.Web.WebPagesStackTrace :    in System.Web.WebPages.WebPageHttpHandler.HandleError(Exception e)   in System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContext context)   in System.Web.WebPages.WebPageHttpHandler.<>c__DisplayClass1.<ProcessRequest>b__0()   in System.Web.WebPages.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f)   in System.Web.WebPages.SecurityUtil.ProcessInApplicationTrust(Action action)   in System.Web.WebPages.WebPageHttpHandler.ProcessRequest(HttpContext context)   in System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()   in System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)TargetSite : Boolean HandleError(System.Exception)Message : Riferimento a un oggetto non impostato su un'istanza di oggetto.Source : App_Code.tfqaa8flStackTrace :    in ASP.Helpers.AdminHelper.<InstalledThemes>b__3(TextWriter __razor_helper_writer)   in System.Web.WebPages.HelperResult.WriteTo(TextWriter writer)   in System.Web.WebPages.WebPageBase.Write(HelperResult result)   in ASP._Page_admin_Extensions_Themes_cshtml.Execute() in c:\Inetpub\wwwroot\ExtraGeek26\admin\Extensions\Themes.cshtml:riga 73   in System.Web.WebPages.WebPageBase.ExecutePageHierarchy()   in System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors)   in System.Web.WebPages.WebPage.ExecutePageHierarchy()   in System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)   in System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContext context)TargetSite : Void <InstalledThemes>b__3(System.IO.TextWriter)

 

Thanks

Coordinator
May 25, 2012 at 12:50 PM

Thanks for posting these details.  Unfortunately, this stack trace doesn't seem to reveal any extra details on what's causing the error exactly.

If you have the Source version working, then I would suggest continuing to use that.  And if you start getting the same error again with the source version .... because you have VWD, you might want to try putting a breakpoint in there if you are running the code in VWD to see where it's tripping up.  Or if you are running it in IIS 5.1 and getting the error there, I believe you can still debug it in VWD by specifying a Custom Web Server in the website properties ... pointing to the localhost IIS 5.1 website (e.g. http://localhost/blogengine).  You should then be able to run BE in VWD and be able to use breakpoints etc while IIS 5.1 is serving the site.  The Helpers.AdminHelper.InstalledThemes code is in App_Code\Helpers.  So you could try putting some breakpoint(s) in there and watch the code to see where the error is happening.

May 26, 2012 at 2:32 PM

Thanks for your replay.

I try to put same breakpoint in source code, if I find a solution i post it here.

 

bye