YAF 1.9.3 and N2

Topics: Developer Forum
Mar 3, 2009 at 4:54 PM
Hi, I just wanted to say that I successfully installed YAF 1.9.3 with N2 using some of the files that came with the forum add-on. Now, I have integrated login across both applications using the YAF membership/role/profile providers. I have disabled the login/registration functions within the forum, so that users have to register via N2 and it works flawlessly. When users login to N2 they are automatically signed into the forums. I've done all of this on .NET 3.5 and IIS 7.0. It was an easy process, mostly merging web.config files.
Mar 5, 2009 at 5:26 PM
Hi bitterSTAR,

Are you averse to giving some less able mortals a clue on how to start achieving this ?

I'm just getting up to speed with C# & ASP.NET in general.

Your help might make the difference in my first dealings with C# !!

Pity a poor FORTRAN oldster (lol)
Mar 5, 2009 at 6:56 PM
Edited Mar 5, 2009 at 6:57 PM
Hi moggsie31, in order to achieve this I did not need to delve into the code at all. I have have very little experience with C# as I've used mainly VB. It took a lot of messing about with my web.config file.
  1. I downloaded N2 and YAF 1.9.3RC2.
  2. I then downloaded the Forum plugin, and copied over the forum.dll and yaf.dll to N2's bin folder
  3. I then copied the Forum plugin folder to the root, and then replaced the YAF folder with 1.9.3RC2's YAF folder.
  4. Then I messed with the web.config files, until it worked.
I'd be happy to post up my config files, however they are specific to .NET 3.5 SP1 on IIS 7.0! So they would need further modification if you're using a different version of .NET or IIS.
Mar 6, 2009 at 6:32 PM
Hey bitterSTAR,

Thanks for the hints. I won't trouble you further for now.

There's nothing like a bit of persistance to give you a nice kick at the end.

Wish me luck !
Mar 12, 2009 at 7:46 AM
Edited Mar 12, 2009 at 7:51 AM
Hi, guys. I have installed YAF 1.9.3. at my site too. And I using YAF Providers instead N2, cause in my version of engine, N2 providers incorrect process ProviderUserKey property of MembershipUser(It's always null). But, I also have a YAF bug(( When site is not requsted by users more that 3-4 hours, there appears this error: "Unable to find stored procedure yaf prov_role_getroles". And when someone requests forum page, error disappears. So:), my question is "Have you similar errors?"

P.S. My DataBase has this procedure. I have checked up it.
P.S. StackTrace:

Could not find stored procedure 'prov_role_getroles'.

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: Could not find stored procedure 'prov_role_getroles'.

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: 

[SqlException (0x80131904): Could not find stored procedure 'prov_role_getroles'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +925466   
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800118   
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186   
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932   
System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31   
System.Data.SqlClient.SqlDataReader.get_MetaData() +62   
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297   
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1005   
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132   
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32   
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122   
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12   
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7   
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141   
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137   
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +86   YAF.Classes.Data.DBAccess.GetDatasetBasic(SqlCommand cmd, Boolean transaction) +410   
YAF.Classes.Data.DBAccess.GetData(SqlCommand cmd, Boolean transaction) +63   YAF.Classes.Data.DBAccess.GetData(SqlCommand cmd) +7   
YAF.Providers.Roles.DB.GetRoles(Object appName, Object username) +131   YAF.Providers.Roles.YafRoleProvider.GetRolesForUser(String username) +202   
System.Web.Security.RolePrincipal.IsInRole(String role) +272   N2.Security.SecurityManager.IsInRole(IPrincipal user, String[] roles) +96   
N2.Security.SecurityManager.IsAdmin(IPrincipal user) +129   N2.Security.SecurityManager.IsAuthorized(ContentItem item, IPrincipal principal) +65   
N2.Security.SecurityEnforcer.AuthorizeRequest() +105   N2.Web.BaseController.AuthorizeRequest(IPrincipal user, ISecurityEnforcer security) +34   
N2.Web.RequestLifeCycleHandler.Application_AuthorizeRequest(Object sender, EventArgs e) +97   
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92   
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64