Unable to cast object of type 'DotNetNuke.Modules.ActiveForums.ForumCollection' to type 'Active.Modules.Forums.ForumCollection

Feb 26, 2013 at 12:06 AM
What could be causing this? I am using latest AF and Dotnetnuke. I cannot even login into my website because of this error. Is there a way I can fix this in the database? Thanks for your time.

Server Error in '/' Application.
Unable to cast object of type 'DotNetNuke.Modules.ActiveForums.ForumCollection' to type 'Active.Modules.Forums.ForumCollection'.
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.InvalidCastException: Unable to cast object of type 'DotNetNuke.Modules.ActiveForums.ForumCollection' to type 'Active.Modules.Forums.ForumCollection'.


Stack Trace:


[InvalidCastException: Unable to cast object of type 'DotNetNuke.Modules.ActiveForums.ForumCollection' to type 'Active.Modules.Forums.ForumCollection'.]
Active.Modules.Forums.Data.ForumsDB.Forums_List(Int32 PortalId, Int32 ModuleId) +229
Active.Modules.Forums.ForumController.GetForumsForUser(String UserRoles, Int32 PortalId, Int32 ModuleId, String PermissionType) +73
Active.Modules.Forums.UserController.DNNGetCurrentUser(Int32 SiteId, Int32 ModuleId) +97
Active.Modules.Forums.Controls.WhatsNewControl.Page_Load(Object sender, EventArgs e) +1110
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

[PageLoadException: Unable to cast object of type 'DotNetNuke.Modules.ActiveForums.ForumCollection' to type 'Active.Modules.Forums.ForumCollection'.]
DotNetNuke.Services.Exceptions.Exceptions.ProcessPageLoadException(Exception exc, String URL) +430
DotNetNuke.Framework.PageBase.OnError(EventArgs e) +629
System.Web.UI.Page.HandleError(Exception e) +86
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8422
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253
System.Web.UI.Page.ProcessRequest() +78
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) +4
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Coordinator
Feb 26, 2013 at 12:51 AM
Active.Modules.Forums.ForumCollection is a reference to the AF 4.0 module. I'm guessing you have some custom templates that need to be updated.

Anything references to "Active.Modules.Forums" needs to be updated to "DotNetNuke.Modules.ActiveForums"

I'm not sure how this could prevent you from logging in unless you have an instance of AF on every page.
Feb 26, 2013 at 1:03 AM
I think it's the redirect problem once I login. I will have to change that tab in db.
Mar 2, 2013 at 10:22 PM
Hmm - my upgrade to AF 5.0.3 was going so smoothly and all was working, then suddenly this started happening.

An IISReset seemed to fix it, however it came back and now no Forum page will load. I have checked all the Templates in the Control Panel and none have Active in them... they are all DotNetNuke... any suggestions please?

Message: DotNetNuke.Services.Exceptions.ModuleLoadException: Unable to cast object of type 'Active.Modules.Forums.ForumCollection' to type 'DotNetNuke.Modules.ActiveForums.ForumCollection'. ---> System.InvalidCastException: Unable to cast object of type 'Active.Modules.Forums.ForumCollection' to type 'DotNetNuke.Modules.ActiveForums.ForumCollection'. at DotNetNuke.Modules.ActiveForums.Data.ForumsDB.Forums_List(Int32 PortalId, Int32 ModuleId) at DotNetNuke.Modules.ActiveForums.ForumController.GetForumsForUser(String UserRoles, Int32 PortalId, Int32 ModuleId, String PermissionType) at DotNetNuke.Modules.ActiveForums.SettingsBase.get_UserForumsList() at DotNetNuke.Modules.ActiveForums.Classic.GetControl(String view, String options) --- End of inner exception stack trace ---
Mar 2, 2013 at 10:26 PM
ps- to double check, you can run this SQL:

SELECT *
FROM activeforums_Templates
WHERE Template LIKE '%Active.Modules%'
Mar 2, 2013 at 10:56 PM
Now it randomly went away (all I did was Save Settings in the Control Panel with no changes) - this is depsite numerous IISResets and Cache clearing.

Could it be the fact that I have the old ActiveForums .dlls in my bin folder?

Active.Modules.Forums.40.dll
Active.Modules.Forums.40.SqlDataProvider.dll
DotNetNuke.Modules.ActiveForums.dll

if I take out the top 2 it stops working... please confirm if they are needed or not
Coordinator
Mar 2, 2013 at 11:10 PM
Definitely don't need either of those DLL's for AF 5.X
Mar 3, 2013 at 7:55 PM
Thanks, the problem is, when I remove them from the Bin the whole site falls over with:

[FileNotFoundException: Could not load file or assembly 'Active.Modules.Forums.40' or one of its dependencies. The system cannot find the file specified.]
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +70
System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +39
System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +62


Is there something in DotNetNuke telling it that it needs that particular dll? I assume it loads them all up when the process recycles, but not sure how to tell it that it is not needed?
Mar 3, 2013 at 9:26 PM
Note: I have posted this problem here too: http://www.dotnetnuke.com/Resources/Forums/forumid/108/threadid/480156/scope/posts.aspx

My theory is that this is the cause of the problem above.
Coordinator
Mar 3, 2013 at 10:28 PM
Do you maybe have a references to an old active forums control in your skin somewhere?
Coordinator
Mar 3, 2013 at 10:30 PM
This is usually caused be a reference in the templates. You need to check all your templates.

Thanks,
Will

On Mar 3, 2013, at 12:56 PM, "PokerDIY" <notifications@codeplex.com> wrote:

From: PokerDIY

Thanks, the problem is, when I remove them from the Bin the whole site falls over with:

[FileNotFoundException: Could not load file or assembly 'Active.Modules.Forums.40' or one of its dependencies. The system cannot find the file specified.]
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +70
System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +39
System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +62


Is there something in DotNetNuke telling it that it needs that particular dll? I assume it loads them all up when the process recycles, but not sure how to tell it that it is not needed?
Coordinator
Mar 3, 2013 at 10:36 PM
Also check the templates in your themes folder.

Thanks,
Will

On Mar 3, 2013, at 2:26 PM, "PokerDIY" <notifications@codeplex.com> wrote:

From: PokerDIY

Note: I have posted this problem here too: http://www.dotnetnuke.com/Resources/Forums/forumid/108/threadid/480156/scope/posts.aspx

My theory is that this is the cause of the problem above.
Mar 4, 2013 at 1:21 AM
Ok, so in my web.config there is a URL handler for Forum Rewriter that references the Active Forums 4 .dll - when I remove this and remove those 2 dlls the site works...

However, ActiveSocial seems to be throwing the error now. and says:

"Please install Active Forums before you configure Active Social" on the ActiveSocial Journal (I am still in the process of migrating to the DotNetNuke journal but this will take weeks still).

If I put the ActiveForums .dlls back into the bin then it fixes it (I commented out the web.config tho) - do I have to leave it in there for AS?

@Will: RE Templates: Do you mean this folder: C:\inetpub\vhosts\pokerdiy.com\httpdocs\DesktopModules\ActiveForums\themes\PokerDIY? There are only images and css it in it (there's nothing in the tables: SELECT * FROM activeforums_Templates WHERE Template LIKE '%Active.Modules%')
Mar 4, 2013 at 1:30 AM
AS seems to throw this error when I remove the AF dlls:

"at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseInternal() at System.Web.UI.TemplateParser.Parse() at System.Web.UI.TemplateParser.ParseTemplateInternal(String content, VirtualPath virtualPath, Boolean ignoreFilter) at System.Web.UI.TemplateParser.ParseControl(String content, VirtualPath virtualPath, Boolean ignoreFilter) at System.Web.UI.TemplateControl.ParseControl(String content) at Active.Modules.Social.Controls.SocialWelcome.Page_Load(Object sender, EventArgs e)"
Mar 7, 2013 at 11:48 PM
So now my forums are unusable... I can't remove the ActiveForum dlls as it kills ActiveSocial... and I can't use the Forums as it tries to use the ActiveForum .dll... sigh
Coordinator
Mar 8, 2013 at 1:47 AM
I still have the old AF DLL's in my bin directory and they are not causing any problems with AF 5.0.

When you leave the old AF DLL's in, what is the exact error message you are seeing?
Mar 10, 2013 at 9:06 PM
The error messages above: (it's random - sometimes the forums (http://www.pokerdiy.com/poker-forums.aspx) work perfectly and other times (usually after an IIS Reset they'll throw this error (on all views of the forum) - any help appreciated as my site forums are unusable as is.

Message: DotNetNuke.Services.Exceptions.ModuleLoadException: Unable to cast object of type 'Active.Modules.Forums.ForumCollection' to type 'DotNetNuke.Modules.ActiveForums.ForumCollection'. ---> System.InvalidCastException: Unable to cast object of type 'Active.Modules.Forums.ForumCollection' to type 'DotNetNuke.Modules.ActiveForums.ForumCollection'. at DotNetNuke.Modules.ActiveForums.Data.ForumsDB.Forums_List(Int32 PortalId, Int32 ModuleId) at DotNetNuke.Modules.ActiveForums.ForumController.GetForumsForUser(String UserRoles, Int32 PortalId, Int32 ModuleId, String PermissionType) at DotNetNuke.Modules.ActiveForums.SettingsBase.get_UserForumsList() at DotNetNuke.Modules.ActiveForums.Classic.GetControl(String view, String options) --- End of inner exception stack trace
Coordinator
Mar 11, 2013 at 1:33 PM
Well, it's definitely something related to the "Active.Modules.Forums.ForumCollection". As I've mentioned before, there should be no references to this anywhere, so it's either still in a skin somewhere or it's cached somewhere.

This evening I will take a look at what exactly that code is trying to do and see if I can get some more insight as to what the problem might be. I'm hoping to have a new beta out this week, so if it's a code issue I should be able to include a fix for it.
Mar 11, 2013 at 10:25 PM
Thanks, I would appreciate that - I believe I have checked all possible code/templates and cleared all caches.
Coordinator
Mar 13, 2013 at 2:19 AM
Ok, I just searched the entire project in visual studio and there are no references at all to "Active.Modules.Forums.ForumCollection".

You have to have a an old template somewhere that hasn't been updated. Here's what I would do.

1) Clear your DNN cache just to make sure.
2) Look at each one of your forums and forum groups in the control panel and verify that the TopicView and TopicViews template is pointing at default. If it's not pointing at default, look at the template that it's pointing to verify that there is no reference to "Active.Modules.Forums" anywhere.

I know that you said that you already did that, but that reference is coming from somewhere, and it's not in the current forum code.
Coordinator
Mar 13, 2013 at 4:28 AM
Also, do a repair install if you haven't done so already.

I just discovered a bug in the DNN file in the 5.0.3 release. I'm going to update it ASAP, but doing a repair install will fix any issues related to this bug.
Mar 13, 2013 at 10:51 PM
Thanks, I will try this.

Can you confirm how the templates work please - I thought they were all data-driven and coming from this table:

SELECT * FROM activeforums_Templates WHERE Template LIKE '%Active.Modules%'

Does it use files anywhere (I could only see CSS and styles in the Themes folder) or persist the database values to disk?
Mar 17, 2013 at 9:37 PM
Any one know how the templates work? Disk or database?
Coordinator
Mar 17, 2013 at 10:19 PM
Default templates are on disk. Custom templates are in the database.

Thanks,
Will

On Mar 17, 2013, at 2:43 PM, "PokerDIY" <notifications@codeplex.com> wrote:

From: PokerDIY

Any one know how the templates work? Disk or database?
Mar 18, 2013 at 3:28 AM
Thanks Will. So I definitely have no old code in the custom templates (SELECT * FROM activeforums_Templates WHERE Template LIKE '%Active.Modules%' )

Is this the only template:
V:\Development Standards\Reports

it has no mention of "Active.Modules"
Coordinator
Mar 18, 2013 at 6:40 PM
In your original post, you say that you can't even log into your website. This seems really odd to me as the Forum module should have no impact on any pages that it's not installed on.

You don't have a reference to any DNN modules hard coded into your skin do you?
Mar 18, 2013 at 10:14 PM
I made the original post. It had What's New module on the home page. I deleted that module and I was able to "login." It was a redirect issue. I have checked all my templates via AF's control panel and all are current. However, in DB there is a mention of Active.Modules in one of the Topic View template. The problem is that I cannot delete that row.

After upgrade. I cannot enter the forum setting anymore. When I click on any tab in the control panel the "circle" just keeps spinning and then page refreshes. Nothing happens.

I still have this error:

[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +9591147
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119
System.String.System.IConvertible.ToInt32(IFormatProvider provider) +46
System.Convert.ToInt32(Object value) +28
DotNetNuke.Modules.ActiveForums.Controls.TopicView.LoadData(Int32 PageId) +4537
DotNetNuke.Modules.ActiveForums.Controls.TopicView.OnLoad(EventArgs e) +1918

[ModuleLoadException: Error: is currently unavailable.]
DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(String FriendlyMessage, Control ctrl, Exception exc, Boolean DisplayErrorMessage) +404

[PageLoadException: Error: is currently unavailable.]
DotNetNuke.Services.Exceptions.Exceptions.ProcessPageLoadException(Exception exc, String URL) +426
DotNetNuke.Services.Exceptions.Exceptions.ProcessPageLoadException(Exception exc) +96
DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(String FriendlyMessage, Control ctrl, Exception exc, Boolean DisplayErrorMessage) +542
DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(Control ctrl, Exception exc, Boolean DisplayErrorMessage) +192
DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(Control ctrl, Exception exc) +40
DotNetNuke.Modules.ActiveForums.SettingsBase.RenderMessage(String Title, String Message, String ErrorMsg, Exception ex) +120
DotNetNuke.Modules.ActiveForums.SettingsBase.RenderMessage(String Message, String ErrorMsg, Exception ex) +38
DotNetNuke.Modules.ActiveForums.Controls.TopicView.OnLoad(EventArgs e) +2181
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
Coordinator
Mar 18, 2013 at 10:58 PM
An outdated template in the database shouldn't cause a problem unless it's actually in use.

If you can't get into the control panel, I suggest you use Fiddler (or a similar tool) to see what is actually happening when you click on the Control Panel link. It's probably an ajax error which fiddler will allow you to see.

As for the error, you just posted, that looks like a common error related to old settings values in the settings table. There's a thread on here that explains how to fix it.
Mar 18, 2013 at 11:01 PM
II think I posted in that thread too but its not working for me. I created a new forum group and then mov3d all the forums there but nada. I am trying the fidller but dont know how that works especially the ajax error thingy. I will try when I have more time. Thanks for responding.
Sep 3, 2013 at 4:26 AM
Edited Sep 3, 2013 at 4:26 AM
It was not the template for me and I do not think it is the problem, What worked for me in dnn 6.2.6 was commenting out all the RewriteRule for forums and social in web.config.
Sep 3, 2013 at 11:02 AM
I gave up on this. My forums were unusable so I deleted them in the end. I don't have forums anymore on PokerDIY.com