Thursday, January 5, 2012

Exeception: admin/Menus/DNNActions OR DotNetNuke.UI.Containers.ActionButtonList.get_ModuleActions throws null reference exception

2 comments

Problem:

If you have deleted or your dotnetnuke installation failed to install DDR Menu module, you will get following.

an error has occurred. DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.UI.Containers.ActionButtonList.get_ModuleActions() at DotNetNuke.UI.Containers.ActionButtonList.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

OR

An error has occurred.DotNetNuke.Services.Exceptions.PageLoadException: Couldn't load menu style 'admin/Menus/DNNActions': System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Web.DDRMenu.DNNCommon.DNNContext.get_ModuleFolder() at DotNetNuke.Web.DDRMenu.DNNCommon.PathResolver.Resolve(String path, RelativeTo[] roots) at DotNetNuke.Web.DDRMenu.MenuBase.Instantiate(String menuStyle) ---> System.ApplicationException: Couldn't load menu style 'admin/Menus/DNNActions': System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Web.DDRMenu.DNNCommon.DNNContext.get_ModuleFolder() at DotNetNuke.Web.DDRMenu.DNNCommon.PathResolver.Resolve(String path, RelativeTo[] roots) at DotNetNuke.Web.DDRMenu.MenuBase.Instantiate(String menuStyle) at DotNetNuke.Web.DDRMenu.MenuBase.Instantiate(String menuStyle) at DotNetNuke.Web.DDRMenu.DDRMenuControl.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

Solution

It is a good news if you are installing your new dnn instance, you can download latest installation source from dotnetunke.codeplex.com and that will work just fine.

If you are already having dnn site running and you uninstalled the  DDR menu  by mistake, or you are upgrading the site or DDR menu  and that caused this problem, there are some ways to fix this.

Download and setup local copy of fresh dnn installation and do following:

  1. Open web.config of fresh install, and search ddr in it. Copy the DDR entry from it and paste it to appropriate section of your site's web.config.
  2. from fresh install replace /admin/menus and /desktopmodules/ddrmenu folders to your site folder.
  3. download  http://dnnddrmenu.codeplex.com/releases/70987/download/264940 and paste it into /install/module folder
  4. Browser for yoursite.com/Install/install.aspx?mode=InstallResources and that's it
In my case, we were trying to upgrade the DDR menu and found the broken site that was restored using above steps. 

For more updates and hints visit this thread on dotnetnuke forums

Monday, January 2, 2012

Using dapper .net to log site visitors in sqlite database - Part 1

0 comments
Dapper .net is a simple light weight micro ORM

I came to this library (in fact a single page) while I was learning posts related to how StackOverflow.com is built. I also noticed that the library is independent of the database, and is useful if you are using any database.

I feel it is promising, and I am going to write a very simple site visitor logging component with this. The database I will use will be Sqlite and will log all the page views into database with the user, user agent and url referrer.

There will be following two NuGet packages that I will require:
  1. Dapper .net
  2. System.Data.Sqlite (I am using x86)
I am going to use Application_AuthenticateRequest in Global.asax to add logging.

All the code will be available at https://trickycoders.svn.codeplex.com/svn/WebsiteLogging

stsadmin -o deploysolution: access denied error

0 comments

When

As like 80% of the sharepoing developers, if you are deploying your solutions trough command line.

What

After firing deploysolution, looking at system settings > farm solutions and the error looks something like "Can not overrite xxxx file, access is denied".

Solution

It was due to my source file was read only. I tried by un-checking the read only attribute from properties for source file and tried the command again. I got the same error couple of times and repeating the same solution fixed the problem.

Conclusion

As a social animal, when I get such kind of error first time in my life, I first ask to couple of developers around me if they have seen the same error ever, that helps a lot. When I do same, I got many useful hints that can either quickly solves the problem or useful for some future problems.

Update - 3-Jan-2011:

If you are having more than one application server in farm then you have to go through all of them and uncheck read only to get it working.

Got the same error? Don't worry try above solution and let me know if same OR some other solution worked for you.

Happy sharepoing deployment!