Calendar

<<  August 2017  >>
MonTueWedThuFriSatSun
31123456
78910111213
14151617181920
21222324252627
28293031123
45678910

View posts in large calendar

RecentComments

None

 
 
     
 

I downloaded BlogEngine.NET 1.5 from codeplex and installed it easy enough. Setup was a breeze. But it wasn't exactly what I wanted. Version 1.5 doesn't have multiple widget zones which I wanted to get a 3 column blog. Reading various posts this will be supported in one of the upcoming releases so I decided to grab the latest source code from codeplex. 26858 mentioned multiple WidgetZone so I downloaded that and built it. It seemed to work fine. I created a new theme and rearranged my widgets, tested with a few dummy posts and it all seemed ok.

I decided it was ready to upload to my host server but I wanted to put it in a subfolder so that it didn't interfere with other apps. So I locally created a new website and a subfolder 'blog' and copied everything there.

So, some straightforward things -
The config file has to go in the root. Simple move.
The App_Code has to go in the root App_Code folder. Moved it to /App_Code/BlogEngine folder. (This upsets Admin/Settings/Extensions/View but it is tidier.)
The same for App_GlobalResources. (See below)
The bin files have to go in the root bin folder. Moved to bin.
The config file has a setting

<!-- You can e.g. use "~/blog/" if BlogEngine.NET is not 
located in the root of the application
--> <add key="BlogEngine.VirtualPath" value="~/"/>

so I changed it to ~/blog/
Another obvious one

<!--This value is to provide an alterantive 
location for storing data.--> <add key="StorageLocation" value="~/App_Data/"/>

changed to ~/blog/App_Data
The Global.asax needs to go into the root. Simple move.

The blog opened and looked mostly ok except for an error

menuerror

This is down to the \blog\Widgets\Administration\widget.ascx file. It is looking for the administration menu in ~/admin/menu.ascx so I changed

<%@ Register Src="~/admin/menu.ascx" 
TagPrefix="ux" TagName="Menu" %>

to

<%@ Register Src="../../admin/menu.ascx" 
TagPrefix="ux" TagName="Menu" %>

 

and got

The file Web.sitemap required by XmlSiteMapProvider does not exist.

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.InvalidOperationException: The file Web.sitemap required by
XmlSiteMapProvider does not exist.
Source Error:

 

Line 17: private void BindMenu()
Line 18: {
Line 19:    SiteMapNode root = 
SiteMap.Providers["SecuritySiteMap"].RootNode; Line 20: if (root != null) Line 21: {

 

Source File: d:\BlogEngineLive\blog\admin\menu.ascx.cs    Line: 19

wooohhh!

A less obvious setting in the config file is

<add name="SecuritySiteMap" 
description="Used for authenticated users."
type="System.Web.XmlSiteMapProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
"
securityTrimmingEnabled="true"
siteMapFile="Web.sitemap"/>

changed siteMapFile="Web.sitemap" to siteMapFile="/blog/Web.sitemap"

Next I wanted to login to import my current blogML.xml file but when I clicked on the Log In menu and then clicked Log In button it redirected me to the site root /Default.aspx which doesn't exist. This is down to the <asp:Login control in the Login.aspx file. Its default DestinationPageUrl is "/". So I added a line in Login.aspx to set the Login1 control to redirect to the /blog subfolder

Line 47: Login1.DestinationPageUrl = 
BlogEngine.Core.Utils.RelativeWebRoot;

This fixed the login but the Administration links were pointing at the wrong place. All the entries in the Web.Sitemap file needed to be changed to point to the right place.

<siteMapNode url="~/admin/Pages/Add_entry.aspx" 
title="add_entry" 
description="" 
roles="administrators, editors"/>

etc changed to

<siteMapNode url="~/blog/admin/Pages/Add_entry.aspx" 
title="add_entry" 
description="" 
roles="administrators, editors"/>

That fixed the links but the administration pages point to the wrong place for the admin master page. So each of the aspx, ascx pages in \blog\admin... need to be changed

<%@ Page Language="C#" MasterPageFile="~/admin/admin1.master" 
AutoEventWireup="true" CodeFile="Add_entry.aspx.cs"
Inherits="admin_entry"
ValidateRequest="False" EnableSessionState="True" %>

to

<%@ Page Language="C#" MasterPageFile="../../admin/admin1.master" 
AutoEventWireup="true" CodeFile="Add_entry.aspx.cs"
Inherits="admin_entry"
ValidateRequest="False" EnableSessionState="True" %>

But that gave me a page error

Could not find a part of the path 'D:\BlogEngineLive\blog\App_GlobalResources'.

So it seems BlogEngine is looking for resources in 2 places. So I 'copied' them back to the \blog folder and that solved it.

Next thing was to convert it to a Web Application. I much prefer the Web Application approach to the fuzzy wuzzy WebSite approach. It loads much faster as the site doesn't have to be compiled before a page is served. I found a great post over at codeplex by Ben Amadaand that worked perfectly. The App_GlobalResources are compiled into the Web Application dll so they no longer need to be in 2 places when deployed.

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Add comment