#16
Still getting that error :|

-deleted and redeployed sql database
-downloaded from YAF-v2.3.3.0-install.zip (btw sample application vb.net is giving a 404)
-set-up (azure) web.config etc.
-using web deploy in visual studio
-ran through install routine


Unable to cast object of type 'YAF.Classes.YafBoardSettings' to type 'YAF.Core.YafLoadBoardSettings'.
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 'YAF.Classes.YafBoardSettings' to type 'YAF.Core.YafLoadBoardSettings'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidCastException: Unable to cast object of type 'YAF.Classes.YafBoardSettings' to type 'YAF.Core.YafLoadBoardSettings'.]
YAF.Core.HttpApplicationStateBaseExtensions.GetOrSet(HttpApplicationStateBase httpApplicationState, String key, Func`1 getValue) +272
YAF.Core.CurrentBoardSettings.get_Instance() +74
YAF.Core.Modules.ServicesModule.<RegisterServices>b__3(IComponentContext k) +46
Autofac.<>c__DisplayClass10`1.<Register>b__f(IComponentContext c, IEnumerable`1 p) +10
Autofac.Builder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +14
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +32
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +48
Autofac.Core.Resolving.InstanceLookup.Execute() +48
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +133
Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters) +44

[DependencyResolutionException: An exception was thrown while executing a resolve operation. See the InnerException for details. ---> Unable to cast object of type 'YAF.Classes.YafBoardSettings' to type 'YAF.Core.YafLoadBoardSettings'. (See inner exception for details.)]
Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters) +112
Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +109
Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance) +74
Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters) +54
YAF.Core.AutoFacServiceLocatorProvider.Get(Type serviceType) +72
YAF.Types.Interfaces.IServiceLocatorExtensions.Get(IServiceLocator serviceLocator) +76
YAF.Types.Interfaces.IServiceLocatorExtensions.Get(IHaveServiceLocator haveLocator) +77
YAF.Core.Services.Logger.YafDbLogger.Log(String message, EventLogTypes eventType, String username, String source, Exception exception) +679
YAF.Core.ServiceLocatorEventRaiser.RaiseIssolated(T eventObject, Action`2 logExceptionAction) +361
YAF.Core.Services.InstallUpgradeService.UpgradeDatabase(Boolean fullText, Boolean upgradeExtensions) +254
YAF.Install._default.Wizard_NextButtonClick(Object sender, WizardNavigationEventArgs e) +1607
System.Web.UI.WebControls.Wizard.OnNextButtonClick(WizardNavigationEventArgs e) +111
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +406
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +114
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +260
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639
Topic Starter
  • salimander
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    55.4%
  • Joined: 24/05/2016
  • Posts: 9
  •  United Kingdom
#17
I try to reproduce the error but on a new install with a clean database the error will not occur because the code is not executed. The only possiblity is that you run the install wizard before and the database you use is not empty.
UserPostedImage
  • tha_watcha
  • Rank: YAF.NET Project Lead
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.
  • Joined: 06/03/2010
  • Posts: 4,014
  •  Germany
  • Thanks: 73 times
  • Was thanked: 1209 time(s) in 1034 post(s)
#18
Originally Posted by: salimander


bbobb: what might the solution to that be?


Most probaly, this piece of code causes the problem. At least, after this it will be clear where exactly the problem is.
Quote:

if (prevVersion < 49)
{
// Reset The UserBox Template
this.Get<YafBoardSettings>().UserBox = Constants.UserBox.DisplayTemplateDefault;


((YafLoadBoardSettings)this.Get<YafBoardSettings>()).SaveRegistry();
}


what is
select * from yaf_registry where name = ' versionname' ?
or execute this: select * from registry_list('versionname'😉
You should set your db prefixes into the object names. like dbo.yaf_registry list.
  • bbobb
  • Rank: YAF Developer
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.Medal of Honor for a YAF Database Key Player: Holds the key to YAF database. Bow down!Medal of Honor for the Support King: Given for answering tons of support questions and generally helping the community.Medal of Honor for the Support Knight: Given to a community member who has answered lots of support questions.
  • Joined: 21/10/2008
  • Posts: 1,558
  •  Man  Russian Federation
  • Location: Moscow
  • Thanks: 51 times
  • Was thanked: 287 time(s) in 253 post(s)
#19
Watcha:
I did a clean install with a newly deployed database; the install routine worked until hitting:

Exception Details: System.InvalidCastException: Unable to cast object of type 'YAF.Classes.YafBoardSettings' to type 'YAF.Core.YafLoadBoardSettings'

I ran the install routine a second (third etc.) time with a partially populated database, and it throws:

There is already an object named 'yaf_drop_defaultconstraint_oncolumn' in the database.

Which can be expected as on error or install it doesnt roll back, delete previous, or check for partaially installed tables.

bbobb:
Sorry, I'm too much of a YAF-noob to spot why that is an error, where to find it, and what to change it to. Can you be a bit more specific of what I need to copy and paste to where? Also my C# isn't that good; it isnt my first language.
Topic Starter
  • salimander
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    55.4%
  • Joined: 24/05/2016
  • Posts: 9
  •  United Kingdom
#20
Originally Posted by: salimander

Watcha:
I did a clean install with a newly deployed database; the install routine worked until hitting:

Exception Details: System.InvalidCastException: Unable to cast object of type 'YAF.Classes.YafBoardSettings' to type 'YAF.Core.YafLoadBoardSettings'

I ran the install routine a second (third etc.) time with a partially populated database, and it throws:

There is already an object named 'yaf_drop_defaultconstraint_oncolumn' in the database.

Which can be expected as on error or install it doesnt roll back, delete previous, or check for partaially installed tables.

bbobb:
Sorry, I'm too much of a YAF-noob to spot why that is an error, where to find it, and what to change it to. Can you be a bit more specific of what I need to copy and paste to where? Also my C# isn't that good; it isnt my first language.



If it's saying there already is an object there, that would somehow mean it wasn't a completely fresh install. I'm not familiar with Azure setups, but I would use a fresh new database with a name I haven't chosen before and give it that a try.
  • Zero2Cool
  • Rank: YAF Leader
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor for the Support Knight: Given to a community member who has assisted lots and lots of people!
  • Joined: 26/04/2011
  • Posts: 1,074
  •  Man  United States
  • Location: in a van down by the river
  • Thanks: 243 times
  • Was thanked: 101 time(s) in 92 post(s)
#21
Originally Posted by: salimander


bbobb:
Sorry, I'm too much of a YAF-noob to spot why that is an error, where to find it, and what to change it to. Can you be a bit more specific of what I need to copy and paste to where? Also my C# isn't that good; it isnt my first language.


You need to run the sql script I have posted. If something can be fixed it will be fixed without you. It's just required to spot the place, because it normally can't be reproduced.

  • bbobb
  • Rank: YAF Developer
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.Medal of Honor for a YAF Database Key Player: Holds the key to YAF database. Bow down!Medal of Honor for the Support King: Given for answering tons of support questions and generally helping the community.Medal of Honor for the Support Knight: Given to a community member who has answered lots of support questions.
  • Joined: 21/10/2008
  • Posts: 1,558
  •  Man  Russian Federation
  • Location: Moscow
  • Thanks: 51 times
  • Was thanked: 287 time(s) in 253 post(s)
#22
Ok I updated the downloads for the install packages again, now the installation should work.
UserPostedImage
  • tha_watcha
  • Rank: YAF.NET Project Lead
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.
  • Joined: 06/03/2010
  • Posts: 4,014
  •  Germany
  • Thanks: 73 times
  • Was thanked: 1209 time(s) in 1034 post(s)
#23
I know I'm 3 years late, but I'm having the exact same issue. Completing the install wizard (clicking next and waiting for it to install) results in either Unable to cast object of type 'YAF.Classes.YafBoardSettings' to type 'YAF.Core.YafLoadBoardSettings' or No candidates for a guest were found for the board 1.. Stack traces are same as posted by OP.
  • ørekrenkelse
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    51.8%
  • Joined: 18/06/2019
  • Posts: 3
  •  Norway
  • Thanks: 1 times
#24
Originally Posted by: ørekrenkelse

I know I'm 3 years late, but I'm having the exact same issue. Completing the install wizard (clicking next and waiting for it to install) results in either Unable to cast object of type 'YAF.Classes.YafBoardSettings' to type 'YAF.Core.YafLoadBoardSettings' or No candidates for a guest were found for the board 1.. Stack traces are same as posted by OP.



I think i found the problem, can you re-download the packages and try again. You need to clear the database!

https://github.com/YAFNE...T/releases/tag/v2.2.4.17 
UserPostedImage
  • tha_watcha
  • Rank: YAF.NET Project Lead
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.
  • Joined: 06/03/2010
  • Posts: 4,014
  •  Germany
  • Thanks: 73 times
  • Was thanked: 1209 time(s) in 1034 post(s)
#25
Thank you for your fast response! I get the same issue during the installation, unfortunately. Every time the install fails I delete the database resource in Azure and create a new.

If it's of any relevance I am publishing to my Azure app service from Visual Studio (can't connect via FTP) using the Connected Services feature. I've set up an ASP.NET Web Application (C#) solution and added the .zip content to a project in that solution. I don't know if this affects the installation in any way...
  • ørekrenkelse
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    51.8%
  • Joined: 18/06/2019
  • Posts: 3
  •  Norway
  • Thanks: 1 times
#26
Did you download the install package?
UserPostedImage
  • tha_watcha
  • Rank: YAF.NET Project Lead
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.
  • Joined: 06/03/2010
  • Posts: 4,014
  •  Germany
  • Thanks: 73 times
  • Was thanked: 1209 time(s) in 1034 post(s)
#27
Yes, from the link you provided
  • ørekrenkelse
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    51.8%
  • Joined: 18/06/2019
  • Posts: 3
  •  Norway
  • Thanks: 1 times
#28
Atleast on my tests it works as expected. Are you using the recommended azure web.config?
UserPostedImage
  • tha_watcha
  • Rank: YAF.NET Project Lead
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.
  • Joined: 06/03/2010
  • Posts: 4,014
  •  Germany
  • Thanks: 73 times
  • Was thanked: 1209 time(s) in 1034 post(s)
Forum Jump  
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved