salimander
2016-05-27T18:27:59Z
Nebie here! Hi.

I'm hitting a wall on the install routine. It gets so far then throws:

Unable to cast object of type 'YAF.Classes.YafBoardSettings' to type 'YAF.Core.YafLoadBoardSettings'.

I've searched for this problem but cant find relevant solution. Any quick pointers?

I will post the stack trace if needed

TIA, salimander
Sponsor
tha_watcha
2016-05-28T10:01:08Z
Did you set the IIS .NET Application Pool to .NET 4?
UserPostedImage
salimander
2016-05-28T11:07:00Z
Thanks for reply.

I forgot to say that I was trying to set up an Azure.
I haven't found the equivalent of your recommended setting in Azure yet
TIA
bbobb
  •  bbobb
  • 100% (Exalted)
  • YAF Developer
2016-05-28T13:07:42Z
Originally Posted by: salimander 

[color=blue]
I will post the stack trace if needed


Surely, it's needed.


salimander
2016-05-28T13:57:48Z
My confusion might be coming from the Azure installation guide.

https://github.com/YAFNE...llation-on-Windows-Azure 

Installation on Windows Azure
STEP 2. Configuring the Web App in Azure
3. Make sure that the Application Pool for YAF is set to .NET 4

I can't make sense of what that means, and can find no instruction on how to do it; any ideas?
TIA, salimander

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
bbobb
  •  bbobb
  • 100% (Exalted)
  • YAF Developer
2016-05-30T05:44:08Z
Try to set "YAF.BaseUrlMask" in app.config. It will not necessarily would solve the problem, but will allow to spot the origin.
Anyway, it's a very strange piece of code where the class is being cast to the base class it was inherited. from.
salimander
2016-06-07T20:34:34Z
Just had a go at reinstalling the entire thing from scratch, still the same error.

How do I do that "YAF.BaseUrlMask" thing?
Zero2Cool
2016-06-07T20:44:43Z
Originally Posted by: salimander 

Just had a go at reinstalling the entire thing from scratch, still the same error.

How do I do that "YAF.BaseUrlMask" thing?



Open up the app.config file with a text editor and there should be some kind of documentation within the file that explains what to do.


Edit, I just found it in Administration » Board Settings but.... if you're not even getting installed, that doesn't help you one bit.

Here's the key to add to your app.config
 <add key="YAF.BaseUrlMask" value="http://www.wickedawesome.com/" />
salimander
2016-06-07T20:59:31Z
Yes, that what I would have thought.
I've checked that file again to see if I missed it, did a search and all. but no documentation
So I added this:
<add key="YAF.BaseUrlMask" value="true"/>

Its come back with a different report this time (it did nothing the pervious time i tried it)
Still gibberish to me though :|
.





No candidates for a guest were found for the board 1.
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.Data.SqlClient.SqlException: No candidates for a guest were found for the board 1.

Source Error:


[No relevant source lines]


Source File: d:\local\Temporary ASP.NET Files\root\ccedcf12\8d5d405f\App_Web_venwpwj3.0.cs Line: 0

Stack Trace:


[SqlException (0x80131904): No candidates for a guest were found for the board 1.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +2434922
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5736592
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +3731
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +58
System.Data.SqlClient.SqlDataReader.get_MetaData() +89
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +379
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +2026
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +375
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +53
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +240
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +41
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +12
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +139
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +136
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +88
YAF.Types.Interfaces.Data.<>c__DisplayClass7.<GetDataset>b__6(IDbCommand c) +72
YAF.Core.Data.DbAccessBase.Execute(Func`2 execFunc, IDbCommand cmd, IDbTransaction dbTransaction) +186
YAF.Types.Interfaces.Data.IDbAccessExtensions.GetDataset(IDbAccess dbAccess, IDbCommand cmd, IDbTransaction dbTransaction) +139
YAF.Types.Interfaces.Data.IDbAccessExtensions.GetData(IDbAccess dbAccess, IDbCommand cmd, IDbTransaction dbTransaction) +57
YAF.Classes.Data.LegacyDb.pageload(Object sessionID, Object boardID, Object userKey, Object ip, Object location, Object forumPage, Object browser, Object platform, Object categoryID, Object forumID, Object topicID, Object messageID, Object isCrawler, Object isMobileDevice, Object donttrack) +394

[ApplicationException: Sql Exception with error number 50000 (Tries=0)]
YAF.Classes.Data.LegacyDb.pageload(Object sessionID, Object boardID, Object userKey, Object ip, Object location, Object forumPage, Object browser, Object platform, Object categoryID, Object forumID, Object topicID, Object messageID, Object isCrawler, Object isMobileDevice, Object donttrack) +766
YAF.Core.LoadPageFromDatabase.Handle(InitPageLoadEvent event) +5911
YAF.Core.ServiceLocatorEventRaiser.Raise(T eventObject) +196
YAF.Core.YafContext.InitUserAndPage() +331
YAF.Core.UserPageBase.get_Page() +89
YAF.Core.UserPageBase.get_PageUserID() +15
YAF.ForumPageBase.Page_Error(Object sender, EventArgs e) +289
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
System.Web.UI.TemplateControl.OnError(EventArgs e) +116
System.Web.UI.Page.HandleError(Exception e) +84
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6598
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +245
System.Web.UI.Page.ProcessRequest() +72
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +22
System.Web.UI.Page.ProcessRequest(HttpContext context) +58
ASP.default_aspx.ProcessRequest(HttpContext context) in d:\local\Temporary ASP.NET Files\root\ccedcf12\8d5d405f\App_Web_venwpwj3.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +188
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
tha_watcha
2016-06-08T08:49:07Z
You no longer need to manually set the baseurlmask setting this is automatically set during the installation. And its saved in the board settings not the app.config.

Regarding the error did you use the azure web.config file as i described in the documentation? And did you completed the install process?
UserPostedImage
salimander
2016-06-08T17:19:29Z
Yes, I used the Azure web.config
The install process went well, but didnt get to Setup finished

now when I try to reinstall it is giving me this





FILE:
mssql/install/tables.sql

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

STATEMENT:
CREATE PROCEDURE [dbo].[yaf_drop_defaultconstraint_oncolumn](@tablename varchar(255), @columnname varchar(255)) as
BEGIN
DECLARE @DefName sysname

SELECT
@DefName = o1.name
FROM
sys.objects o1
INNER JOIN sys.columns c ON
o1.object_id = c.default_object_id
INNER JOIN sys.objects o2 ON
c.object_id = o2.object_id
WHERE
o2.name = @tablename AND
c.name = @columnname

IF @DefName IS NOT NULL
EXECUTE ('ALTER TABLE [dbo].[' + @tablename + '] DROP constraint [' + @DefName + ']')
END
tha_watcha
2016-06-08T18:22:15Z
Ok you remember why the setup didn't finish? I think you need to reinstall fresh, delete the database first if possible and create one new.
UserPostedImage
bbobb
  •  bbobb
  • 100% (Exalted)
  • YAF Developer
2016-06-08T22:24:01Z
 // Check if BaskeUrlMask is set and if not automatically write it
                    if (this.Get<YafBoardSettings>().BaseUrlMask.IsNotSet())
                    {
                        this.Get<YafBoardSettings>().BaseUrlMask = BaseUrlBuilder.GetBaseUrlFromVariables();

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

The process was failing here. BaseUrlMask was required to spot the initial error place.
It's clear from the snippet that BaskeUrlMask is/was used to override the registry board setting.

salimander
2016-06-09T14:07:30Z
wacha: if I delete that database (ie error becasue tables already exist), and reinstall, then it fails at this error, with and without the BaseUrlMask setting.

Unable to cast object of type 'YAF.Classes.YafBoardSettings' to type 'YAF.Core.YafLoadBoardSettings'.

bbobb: what might the solution to that be?
tha_watcha
2016-06-09T14:21:31Z
Please download the install packager again i added a fix for the problem
UserPostedImage

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