in

Bunker Hollow

Matt Williamson's home on the web, welcome.

Sponsored Link

Matt Williamson's Blog

Personal discoveries of an IT professional.

Working with YAF Source Code from SVN Repository

I've been working with YetAnotherForum for a while now.  It's an open-source .NET forum control written in C#, and it's great software.  I've made some contributions here and there with a smiley pak, an avatar collection, and helping others work problems on the forum.  Today I've decided to take the next step and contribute code to the project.  As an open-source project the YAF source code is available to anyone, it's stored on a SourceForge SubVersion repository at the following address:

https://yafdotnet.svn.sourceforge.net/svnroot/yafdotnet

I'm documenting the steps I took to get the source code up and running locally, for future reference.

Connect and Obtain the Sourcecode from the Repository

  1. Create an account with SourceForge.Net.
      
  2. I'm running Vista x64 Business Edition, so I need a SubVersion (aka SVN) Windows client.  Download and install TortoiseSVN, the best SVN Windows client out there.
     
  3. After installation and a system reboot, you'll notice TortoiseSVN has been incorporated into your right-click context menu.  Choose "SVN Checkout...".  The url of the repository for the YAF project is above, and then choose a local directory that will mirror the repository.
     

Setup Solution for Development and Compile

  1. Create a new local database named yafnet.
     
  2. Open yetanotherforum.net.vs2008.sln with Visual Studio and go through the conversion process (I don't think a backup is necessary).
     
  3. Modify the properties of each project in the solution to use the .NET 3.5 Target Framework.
     
  4. In the website project (YetAnotherForum.NET), delete the web.config file in the root.  This was created automatically when you changed the target framework.  Copy recommended-NETv3.5-web.config from the webconfigs directory into the root and rename it web.config.
     
  5. Edit web.config and change compilation debug to true.
     
  6. Edit web.config and add minRequiredNonAlphanumericCharacters="0" to membership provider string.  During YAF installation in the next steps, when I create a new admin his password doesn't contain any weird characters.  If I don't add this attribute then installation fails with "password invalid" because the default is 1.
     
  7. If you compile the solution at this point and receive 4 errors of:
     
    Compiler Error Message: CS0433: The type 'System.Web.UI.ScriptManager' exists in both 'c:\windows\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c:\windows\assembly\GAC_MSIL\System.Web.Extensions\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.dll'
     
    Edit your web.config and add the following code beneath the <system.webServer> settings:
     
    <runtime>
          <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
              <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
              <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
            <dependentAssembly>
              <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
              <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
          </assemblyBinding>
        </runtime>
     
  8. Compile the solution, should be successful.

Setup Solution to Debug Using IIS

  1. Open IIS and create a new website.  Set the site's physical path to that of the website project directory.
     
  2. In Visual Studio, right-click the website project and choose "Start Options...".  Choose Server -> Use custom server -> Base URL: http://localhost/.

Install YAF Locally

  1. Set website project (YetAnotherForum.NET) as Startup Project.
     
  2. Set /install/default.aspx as Start Page.
     
  3. Edit app.config and set your configPassword for installation.
     
  4. Debug the solution (F5), enter your password, attempt to install full text search support, and install YAF!

Committing Changes

  1. Try and make sure you have the latest source code, by 'Updating', before you edit code and submit changes.
     
  2. Commit changes by right-clicking your modified file and choosing 'SVN Commit...".  Simply enter a description and then your username and password.  If you're just starting out, you won't have permission to commit changes and the process will fail.  Instead, you need to create a patch, as described below.  You will need to contact the YAF admins to be added as a developer with commit privileges.

Creating a Patch

  1. If you do not have YAF repository commit privileges, you will need to create a patch.
     
  2. Verify you have the latest source code before editing it and creating a patch.
     
  3. Right-click your modified file -> TortoiseSVN -> Create Patch...
     
  4. Save your patch locally with an appropriate name and email it to support@yetanotherforum.net.

Enjoy Contributing to the YetAnotherForum Project!

Comments

 

Mek said:

Excellent stuff. Slight note though, your tutorial refers to the YetAnotherForum.NET as a WAP, which isn't the case in 1.93 its just a Website. Previous versions were WAP.

Once again thanks for the contribution, its very much appreciated.

December 6, 2008 12:41 PM
 

Matt Williamson said:

Thanks, I fixed the post.  That raises a question... why is it a website instead of a web application?  All the "websites" I've worked on in projects are always web applications... this website type of project seems to have less (maybe just different) properties/options.

December 6, 2008 1:12 PM
 

Mek said:

A Website project is dynamically compiled, allowing users without Visual Studio the ability to make some small changes in the code-behind without recompilation issues. WAP's aren't. I also believe there were a few other small technical issues which escape me at present.

But a large proportion of our user base doesn't have access to VS.

December 6, 2008 1:22 PM
 

Mek said:

Me again :-)

Thanks to Richards112 on the YAF forum I've found more on this issue, because WAPs aren't dynamically compiled they have issues with certain providers (Profile and Virtual Path Provider being two of them).

Blog entry by someone more knowledgeable than myself:

weblogs.asp.net/.../the-differences-in-profile-between-web-application-projects-wap-and-website.aspx

December 15, 2008 3:19 PM
 

Richard McBride said:

Hi Matt

Just a note. Now that VSWebDev 2008 Express is a free download from Microsoft there might be a lot more people with a compile environment. I am trying to do a compile of 1.9.3 right now using VS WebDev Express using the zip download of source code and am having problems, so your notes here might  be useful.

Thanks

Richard

April 25, 2009 11:49 AM

Leave a Comment

(required)  
(optional)
(required)  
Add
Powered by Community Server (Non-Commercial Edition), by Telligent Systems