YAFLogo

Posted by: Coleen - Tuesday, 8 January 2013 15:47:32
I'm very new to Yaf.Net and am trying to get the latest version v1.9.6.1 RTW Binary (Install) Zipped from CodePlex installed on my local host in Visual Studios 2010. I've followed the installation instructions up to running in the DB Installation Wizard. I am getting this error on trying to connect to the existing connection string: [color=red]Failed to connect: The database 'C:\INETPUB\WWWROOT\YAFTESTFORUMS\APP_DATA\DATABASE.MDF' cannot be opened because it is version 661. This server supports version 655 and earlier. A downgrade path is not supported. Could not open new database 'C:\INETPUB\WWWROOT\YAFTESTFORUMS\APP_DATA\DATABASE.MDF'. CREATE DATABASE is aborted. An attempt to attach an auto-named database for file C:\inetpub\wwwroot\YafTestforums\App_Data\Database.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. [/color] Can anyone please help me with this? I do have MS SQL Server 2008. Any help would be greatly appreciated. TIA, Coleen

Posted by: tha_watcha - Wednesday, 9 January 2013 14:36:21
The empty DB that is included with YAF was generated with SQL Server 2008 R2 thats why this DB doesn't work with your older SQL Server Version. But you don't need this Data Base, you can delete that file 'C:\INETPUB\WWWROOT\YAFTESTFORUMS\APP_DATA\DATABASE.MDF. You need to create a new Data base on your SQL Server and modify the db.config in yaf to connect to your sql Server and the new database (You can do this via the YAF Install Wizard)

Posted by: Coleen - Monday, 21 January 2013 21:49:13
Thanks for the response. Sorry I haven't replied - I've been off-line, sick with the flu! Okay, so I deleted the file you said to delete and ran the Instal Wizard again. I get the error below: [color=red]Failed to connect: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)[/color] [IMG]http://i105.photobucket.com/albums/m229/ayliea/YAFDatabaseError_zps1c2fdac7.jpg[/IMG] So I'm not sure where to go from here. Any help would be appreciated. Thanks! Coleen

Posted by: tha_watcha - Tuesday, 22 January 2013 10:55:22
You need to specify the Name of your database Server in the Data Source field, and Initial Catalog is the Database on the Server (Which you need to create if you haven't done already).

Posted by: Coleen - Wednesday, 30 January 2013 19:35:28
Okay, I'm working on this again and have tried to change the connection strings in the db.config - here is what I have in the db.config: This is the error message I am getting now when I try to run the Install Wizard: serviceLocator cannot be null Parameter name: serviceLocator 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.ArgumentNullException: serviceLocator cannot be null Parameter name: serviceLocator I'm sorry, but I truly do not understand what/where I am supposed to be adding the Data Source field. If I can't do this through the Install Wizard, then how do I fix this? I honestly have like Zero experience with SQL Server.... Any help would be greatly appreciated.

Posted by: squirrel - Wednesday, 30 January 2013 20:16:18
Is this a locally hosted site and SQL database (development) or are you trying to get this running on a web hosting server somewhere? If you are trying to get it running on an SQL server in a hosting environment, you need the following: Remote name or address of the SQL Server. Name of the database you are trying to install to. Username that has write permissions to the database (SQL database user) and the password for that user. [color=red][b]DO NOT POST THE USERNAME OR PASSWORD HERE - you just need to know them for your connection string.[/b][/color]. I will help with a connection string once we have a better idea how you are trying to install YAF (public hosted or on a 'local' computer for development)... Then, you must modify the db.config with that information (and uncomment the lines as necessary). The code you posted above has the remote SQL server line enabled, but written as you are using SQL server hosted on the machine trying to host the forum, with a default database name and integrated security - which generally does not work on hosted web applications. The other line won't work because that is for a 'flatfile' database located in your YAF folder. In order for us to help much more, we need to atleast know your hosting configuration. Where and what are you trying to install YAF on. From there, I might be able to help with a connection string...

Posted by: Coleen - Wednesday, 30 January 2013 20:32:09
Thanks so much for the quick response! Currently, I'm trying to get this running on my local host for testing, before I move this up to my hosting service. I realize that the connection strings will have to change between the two, but I am hoping that once I am ready to move this to the host server, my hosting service can help me with the correct connection strings for their SQL Server. For now, I just want to get this running on my local host so I can test it and format it to match my website. I'm using a PC, Windows 7, Visual Studios 2010, .Net Version 4.0.3xxx, Microsoft SQL Server 2008 - SQL Server Express. Although I understand SQL basics (sort-of) I've never had to set up SQL server myself via connection strings. That used to all be done by the Network staff where I worked.. now that I work for myself, I have to learn all of this, and I admit I am confused... Thanks again for your help,it truly is appreciated.

Posted by: squirrel - Thursday, 31 January 2013 08:37:49
In your SQL Management Console, you need to create an empty database. Then you will need to create a login to the SQL server that supports 'SQL Authentication'. I also make the new database the 'default database' for that user login. You also need to assign db_owner rights to that user for that database. Please see Google for help setting up SQL Server Express (primarily in setting up an empty database and assigning it a user (and setting that user to the owner of that database)... Then, you can use the SQLExpress connection string: [code=xml;-1] [/code] Replace the words inside the braces ( { } ) with your information - also remove those braces when you put your information in.

Posted by: Coleen - Wednesday, 6 February 2013 18:26:55
Thanks for your help. I was finally able to get MSSQL 2008 Express completely installed without any errors, created the new DB and was able to login with SQL Authentication. Then when I ran Yaf.Net and changed my db.config to use the connection string as you supplied, I am now getting this error: [color=red]Startup Error: YAF.NET is not setup properly. Please add the to the section of your web.config file[/color] I have my custom errors turned off: and here is my connection string (with my username and password x'd out): I'm at a loss. Also, if I try to run the setup wizard through the install/default.aspx I get this error: [color=red]Server Error in '/YafTestForum' Application. serviceLocator cannot be null Parameter name: serviceLocator 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.ArgumentNullException: serviceLocator cannot be null Parameter name: serviceLocator 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: [ArgumentNullException: serviceLocator cannot be null Parameter name: serviceLocator] YAF.Types.CodeContracts.ArgumentNotNull(T obj, String argumentName) +100 YAF.Types.Interfaces.IServiceLocatorExtensions.Get(IServiceLocator serviceLocator) +52 YAF.Classes.Data.MsSqlDbAccess.get_Current() +42 YAF.Install._default.Page_Init(Object sender, EventArgs e) +31 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnInit(EventArgs e) +91 System.Web.UI.Page.OnInit(EventArgs e) +12 System.Web.UI.Control.InitRecursive(Control namingContainer) +140 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +480 [/color] I am truly at a loss as to what/where to go/do next. Any assistance would be greatly appreciated. Thanks, Coleen

Posted by: tha_watcha - Thursday, 7 February 2013 13:23:14
Did you follow the install Guide?! looks like you are using a different web.config. On the [url=http://yafnet.codeplex.com/wikipage?title=Installation&referringTitle=Documentation]Install Guide[/url] it says: [quote]You need to copy the file [b]recommended-NET-web.config[/b] to your yaf root Folder and rename it to [b]web.config[/b].[/quote]

Posted by: Coleen - Monday, 11 February 2013 15:32:44
Hi Watcha - thank you! I've had some major Internet connectivity issues in the past week so am just now getting back to this. You are right, I did not copy the recommended-NET-web.config file to my yaf root Folder and rename it to web.config, I have done that now and am running the wizard again. I had deleted the entire SQL database structure and started over with a clean slate - which seems to have worked, now that I have copied the web.config file correctly. It did give me an error when it came to the screen to "Upgrade BBCode Extensions, File Extensions and Topic Status Lists" so I un-checked the box and just continued on. So far, so good. However, I do have a question about the email address/account. I do have an email address associated with my website, but don't have one specifically set up for the forums. Do I just set up the mail in the web.config like I did with my website - only with the email address I just created for the forums? When I open the mail.config file, I get an error "The 'smtp' element is not declared." Honestly, I've never set up my email using a mail.config file - I've always set it in the web.config as follows: So how do I declare the smtp element? Are there instructions somewhere on this? Any help would again be greatly appreciated. Thank you very much for all of your assistance. Coleen

Posted by: tha_watcha - Monday, 18 February 2013 15:31:51
[quote=Coleen;58599]Hi Watcha - thank you! I've had some major Internet connectivity issues in the past week so am just now getting back to this. You are right, I did not copy the recommended-NET-web.config file to my yaf root Folder and rename it to web.config, I have done that now and am running the wizard again. I had deleted the entire SQL database structure and started over with a clean slate - which seems to have worked, now that I have copied the web.config file correctly. It did give me an error when it came to the screen to "Upgrade BBCode Extensions, File Extensions and Topic Status Lists" so I un-checked the box and just continued on. So far, so good. However, I do have a question about the email address/account. I do have an email address associated with my website, but don't have one specifically set up for the forums. Do I just set up the mail in the web.config like I did with my website - only with the email address I just created for the forums? When I open the mail.config file, I get an error "The 'smtp' element is not declared." Honestly, I've never set up my email using a mail.config file - I've always set it in the web.config as follows: So how do I declare the smtp element? Are there instructions somewhere on this? Any help would again be greatly appreciated. Thank you very much for all of your assistance. Coleen [/quote] Simply open the mail.config delete all the content and replace it with your smtp content only... [code=xml;-1] [/code]

Posted by: Coleen - Tuesday, 19 February 2013 15:44:49
When I do that, just have this line in the mail.config file: It gives me the error: "The 'mailSettings' element is not declared." and if I delete the tag and just use the tag, I get the same error: "The 'smtp' element is not declared." What am I missing? Do I even need to have a separate mail.config file? Can't I set the mail settings in the main web.config file? Thanks for any assistance, it truly is appreciated. Coleen

Posted by: tha_watcha - Wednesday, 20 February 2013 10:21:12
[quote=Coleen;58666]When I do that, just have this line in the mail.config file: It gives me the error: "The 'mailSettings' element is not declared." and if I delete the tag and just use the tag, I get the same error: "The 'smtp' element is not declared." What am I missing? Do I even need to have a separate mail.config file? Can't I set the mail settings in the main web.config file? Thanks for any assistance, it truly is appreciated. Coleen[/quote] No you don't need the mail.config. You can modify the web.config. The standard web.config from yaf looks like this [code=xml;-1] [/code] but you can change it like you wrote above [code=xml;-1] [/code]

Posted by: Coleen - Wednesday, 20 February 2013 13:57:34
Thank you! That's what I thought, but since I'm new to YAF.Net and haven't used MVC, I wanted to be sure there wasn't something I was missing. Thanks again for all of your help, it is much appreciated!

Posted by: Coleen - Monday, 4 March 2013 18:48:49
I have both MySQL and SQL Server Express. For use with my Yaf.Net forum being tested on my local host, I did use the SQL Server Express. The problem was that it was not working correctly since I had both the version that came with my copy of Visual Studio 2010, and the SQL Server Express 2008 version. Once I COMPLETELY removed both versions (and yes, my husband helped me get into the registry and remove all traces of BOTH versions) then re-install ONLY SQL Server Express, THEN copy over the file recommended-NET-web.config to my yaf root Folder and rename it to web.config. MySQL had nothing to do with it. The local host by and of itself does NOT contain a database. Visual Studio 2010 does, but it was NOT compatible with the Yaf.net forums (newer/older version?) So that is why I had to delete ALL the SQL files and re-install the correct version that does work with Yaf.net. I'm not certain how or if MySQL works with Yaf, so that is a question for another thread, maybe. It DOES work just fine on my local host, and uploading the files that I customized on my local host up to the server worked just fine as well. The bottom line is that if you're using your local host, you do still need a database. If you want to install Yaf.net on your local host, like I said, it DOES work, but it DOES require a database that is compatible with Yaf.net.

Posted by: BrunoSF - Monday, 13 January 2014 21:52:04
Hi everyone!!! Thanks for providing this amazing application. I'm using the YAF for a one year, approximately. However, I found a recent difficulty. I always used the YAF with local database SQLExpress 2008. However, the need has arisen to use YAF with remote connection for SQLServer2008 R2. summarizing: [list][*]Using IIS7.5 in server "A" with YAF-v1.9.6.1-RTW-BIN files inside the virtual directory (application): \SiteForum\forumati The virtual path \forumati is an aplication folder within IIS7.5 SQLServer2008R2 is on server "B", the same subnet.[/list] When i used the sqlexpress on the local machine, everything worked perfectly. I believe it is a problem in db.config. How can i configure the db.config file to establish a connection with sqlserver2008R2 on another machine (the same subnet). Thanks for some help!! obs: Sorry about my english. :( Best regards.

Posted by: tha_watcha - Tuesday, 14 January 2014 12:05:22
[quote]How can i configure the db.config file to establish a connection with sqlserver2008R2 on another machine (the same subnet).[/quote] use the address of the server as datasource (for example the ip adress) [code=xml][/code]