RoutineTravel
2020-06-29T14:53:03Z
I am attempting to set up YAF as a standalone forum from the source code for the first time on my local machine. (In due course we want to integrate it into an existing web app, but I wanted to try to get it running on its own first.) I downloaded the latest version from GitHub last week and have followed the instructions at https://github.com/YAFNET/YAFNET/wiki/Installation .

I've had a couple of errors already in Visual Studio: first there were some .js files present in the project and missing on disk, so I removed these from the project and that seemed to be ok. Then there were errors relating to a particular assembly not being "strongly named", which I resolved by turning "signing" on for every assembly using the supplied .snk file.

I have created an empty database and verified that the app can connect to it. But when I go to /install/default.aspx for the first time it throws an exception with the error: Invalid object name 'yaf_Registry'

Debugging shows this is happening when
this.LoadBoardSettingsFromDB();
is called in LoadBoardSettings.cs line 68. But my understanding is that if the forum has not already been set up then the app should create the requisite tables in the database on first run. Is that right? Or is there a script somewhere that I should be running first to populate the database?

Thanks.
Sponsor
tha_watcha
2020-06-29T18:11:09Z
Normally the installer should detect that no version is installed. Atleast with the Latest version 2.31.7. I can not reproduce the issue.

Can you post the full excecption?
UserPostedImage
RoutineTravel
2020-06-30T09:19:26Z
The exception is as follows:

Server Error in '/' Application.
Invalid object name 'yaf_Registry'.
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: Invalid object name 'yaf_Registry'.

Source Error:


Line 46: public IDataReader ExecuteReader()
Line 47: {
Line 48: return dbCmd.ExecuteReader();
Line 49: }
Line 50:

Source File: C:\Projects\YAF2\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteCommand.cs Line: 48

Stack Trace:


[SqlException (0x80131904): Invalid object name 'yaf_Registry'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +3318656
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +334
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4289
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +89
System.Data.SqlClient.SqlDataReader.get_MetaData() +101
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) +624
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +3392
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) +725
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +84
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +312
ServiceStack.OrmLite.OrmLiteCommand.ExecuteReader() in C:\Projects\YAF2\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteCommand.cs:48
ServiceStack.OrmLite.OrmLiteReadCommandExtensions.ExecReader(IDbCommand dbCmd, String sql) in C:\Projects\YAF2\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteReadCommandExtensions.cs:42
ServiceStack.OrmLite.OrmLiteResultsFilterExtensions.ExprConvertToList(IDbCommand dbCmd, String sql, IEnumerable`1 sqlParams, HashSet`1 onlyFields) in C:\Projects\YAF2\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteResultsFilterExtensions.cs:146
ServiceStack.OrmLite.ReadExpressionCommandExtensions.Select(IDbCommand dbCmd, Expression`1 predicate) in C:\Projects\YAF2\yafsrc\ServiceStack\ServiceStack.OrmLite\Expressions\ReadExpressionCommandExtensions.cs:24
ServiceStack.OrmLite.<>c__DisplayClass27_0`1.<Select>b__0(IDbCommand dbCmd) in C:\Projects\YAF2\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteReadExpressionsApi.cs:203
ServiceStack.OrmLite.OrmLiteExecFilter.Exec(IDbConnection dbConn, Func`2 filter) in C:\Projects\YAF2\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteExecFilter.cs:70
ServiceStack.OrmLite.OrmLiteReadExpressionsApi.Exec(IDbConnection dbConn, Func`2 filter) in C:\Projects\YAF2\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteReadExpressionsApi.cs:16
ServiceStack.OrmLite.OrmLiteReadExpressionsApi.Select(IDbConnection dbConn, Expression`1 predicate) in C:\Projects\YAF2\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteReadExpressionsApi.cs:203
YAF.Core.Extensions.<>c__DisplayClass16_0`1.<Get>b__0(IDbCommand db) in C:\Projects\YAF2\yafsrc\YAF.Core\Extensions\IRepositoryExtensions.cs:484
YAF.Core.Data.DbAccessBase.Execute(Func`2 execFunc, IDbCommand cmd, IDbTransaction dbTransaction) in C:\Projects\YAF2\yafsrc\YAF.Core\Data\DbAccessBase.cs:131
YAF.Core.Extensions.IRepositoryExtensions.Get(IRepository`1 repository, Expression`1 criteria) in C:\Projects\YAF2\yafsrc\YAF.Core\Extensions\IRepositoryExtensions.cs:484
YAF.Core.Model.RegistryRepositoryExtensions.List(IRepository`1 repository, Nullable`1 boardId) in C:\Projects\YAF2\yafsrc\YAF.Core\Model\RegistryRepositoryExtensions.cs:115
YAF.Core.LoadBoardSettings.LoadBoardSettingsFromDB() in C:\Projects\YAF2\yafsrc\YAF.Core\BoardSettings\LoadBoardSettings.cs:177
YAF.Core.LoadBoardSettings..ctor(Int32 boardId) in C:\Projects\YAF2\yafsrc\YAF.Core\BoardSettings\LoadBoardSettings.cs:68
YAF.Core.Helpers.CurrentBoardSettings.<get_Instance>b__6_0() in C:\Projects\YAF2\yafsrc\YAF.Core\Helpers\CurrentBoardSettings.cs:116
YAF.Core.Extensions.HttpApplicationStateBaseExtensions.GetOrSet(HttpApplicationStateBase httpApplicationState, String key, Func`1 getValue) in C:\Projects\YAF2\yafsrc\YAF.Core\Extensions\ApplicationStateBaseExtensions.cs:80
YAF.Core.Helpers.CurrentBoardSettings.get_Instance() in C:\Projects\YAF2\yafsrc\YAF.Core\Helpers\CurrentBoardSettings.cs:112
YAF.Core.Modules.<>c.<RegisterServices>b__1_3(IComponentContext k) in C:\Projects\YAF2\yafsrc\YAF.Core\Modules\ServicesModule.cs:152
Autofac.Builder.<>c__DisplayClass0_0`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +18
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +50
Autofac.Core.Resolving.InstanceLookup.CreateInstance(IEnumerable`1 parameters) +158

[DependencyResolutionException: An exception was thrown while activating λ:YAF.Configuration.BoardSettings.]
Autofac.Core.Resolving.InstanceLookup.CreateInstance(IEnumerable`1 parameters) +527
Autofac.Core.Resolving.InstanceLookup.Execute() +516
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request) +214
Autofac.Core.Resolving.ResolveOperation.Execute(ResolveRequest request) +125
Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance) +204
Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters) +70
Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType) +70
YAF.Core.AutoFacServiceLocatorProvider.Get(Type serviceType) in C:\Projects\YAF2\yafsrc\YAF.Core\AutoFacServiceLocatorProvider.cs:144
YAF.Types.Interfaces.IServiceLocatorExtensions.Get(IServiceLocator serviceLocator) in C:\Projects\YAF2\yafsrc\YAF.Types\Interfaces\IServiceLocatorExtensions.cs:57
YAF.Types.Interfaces.IServiceLocatorExtensions.Get(IHaveServiceLocator haveLocator) in C:\Projects\YAF2\yafsrc\YAF.Types\Interfaces\IServiceLocatorExtensions.cs:145
YAF.Core.Context.Start.Startup.ConfigureAuth(IAppBuilder app) in C:\Projects\YAF2\yafsrc\YAF.Core\Context\Start\Startup.Auth.cs:83
YAF.Core.Context.Start.Startup.Configuration(IAppBuilder app) in C:\Projects\YAF2\yafsrc\YAF.Core\Context\Start\Startup.cs:40

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +132
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146
Owin.Loader.<>c__DisplayClass19_1.<MakeDelegate>b__0(IAppBuilder builder) +93
Owin.Loader.<>c__DisplayClass9_0.<LoadImplementation>b__0(IAppBuilder builder) +224
Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action`1 startup) +897
Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action`1 startup) +51
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +101
System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +139
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +160
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +587
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +173
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +255
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +347

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +552
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +122
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +737
tha_watcha
2020-06-30T15:04:11Z
I found the issue, But you downloaded the master branch. Which contains the Current YAF 3.0 Alpha. Please use the stable branch, which contains the latest version 2.31.07
UserPostedImage
RoutineTravel
2020-07-01T12:35:21Z
Thanks, I did originally download v2.31.06 from your website, but there were build errors (there seemed to be a reference to a property of a certain class but that property did not exist - I cannot now remember the details), so I went to GitHub instead and evidently downloaded from the master branch not realising it was not the latest stable release - apologies for that.

I have now downloaded v2.31.07 (source code version) from https://www.yetanotherforum.net/download . Again I've followed the instructions but when I attempt to build the solution before accessing the application for the first time I'm getting an error again (and lots of warnings) - see the screenshots below. Can you help with the error please?

image.png

Click to View Image10 View(s)


image.png

Click to View Image11 View(s)

tha_watcha
2020-07-01T13:05:24Z
Looks like the source is older then the the release.

Use the direct download of the stable branch instead...

https://github.com/YAFNE...AFNET/archive/stable.zip 
UserPostedImage
RoutineTravel
2020-07-02T10:55:51Z
Originally Posted by: tha_watcha 

Looks like the source is older then the the release.

Use the direct download of the stable branch instead...

https://github.com/YAFNE...AFNET/archive/stable.zip 



Thanks - this version is working.
RoutineTravel
2020-07-03T08:46:50Z
Originally Posted by: tha_watcha 

Looks like the source is older then the the release.

Use the direct download of the stable branch instead...

https://github.com/YAFNE...AFNET/archive/stable.zip 


Hello again,

When attempting to publish (using Visual Studio) the YAF project to a web server in a different location I received errors because the following files could not be found:
  • Content\bootstrap\mixins\_navbar-align.scss
  • Scripts\ckeditor\plugins\bbcodeselector\images\yafbbcode.gif
  • Scripts\ckeditor\plugins\table\dialogs\table.js
  • Scripts\ckeditor\yaf_contents.css

I've excluded these files from the project. Can you confirm that they're not needed?

There is also an error for the following file because it could not find a part of the path:
  • Bin\de\YAF.resources.dll

I'm not sure where this reference is. The "bin\de" folder does not exist, but "bin\languages\de\YAF.resources.dll" does exist. Can you help please?

Thanks.
tha_watcha
2020-07-03T10:55:16Z
Quote:

I've excluded these files from the project. Can you confirm that they're not needed?



Only if you want to use the ckeditor. then re-download the stable package from the link above. I re-added the files

Quote:

There is also an error for the following file because it could not find a part of the path:
Bin\de\YAF.resources.dll

I'm not sure where this reference is. The "bin\de" folder does not exist, but "bin\languages\de\YAF.resources.dll" does exist. Can you help please?



In that case you would need to remove the post build events from the YAF Project.

The problem is that the publish function is not really supported. it would add all the source files to the server which are not needed.
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