This project is read-only.

Step by Step Guideline for Integration

Sep 29, 2013 at 3:44 AM
with VS2012 default ASP.NET MVC4 Web Application project:

This is my personal guide so I will not forget in the future what I did to make it work. Therefore some steps might seem a bit customized, but even so, I tried to make it simple and general, I hope it helps you, I took me many days, not as Andy(Kudos BTW)!

0
Have MS sqlserver express [64] installed, will be required by default setup of this solution, changes (for using other DB providers like mysql) will be done later
http://www.microsoft.com/en-us/download/details.aspx?id=29062

Also have Commit Package openforum-019c57cf6d02 downloaded
https://openforum.codeplex.com/SourceControl/changeset/019c57cf6d02


1
Extract C:\Projects\openforum-019c57cf6d02.zip to openforum-019c57cf6d02\
2
Open C:\Projects\openforum-019c57cf6d02\openforum_019c57cf6d02\OpenForum.sln
3
On Visual Studio 2012, Tools Menu, Extensions and Updates, Search for and install Razor Generator, restart VS2012, it will prompt you to do so
4
On Project OpenForum delete corrupted reference to Commons.Web.Mvc.PrecompiledViews
5
On Project OpenForum add reference to Commons.Web.Mvc.PrecompiledViews, file located on desktop
6
On Project Samples\TEMP delete reference to System.Web.WebPages
7
Right click over Samples folder, create new MVC4 Web Project, no tests, named TEMP2
8
Grab from web.config on TEMP project the connection string line named ApplicationServices and paste it on TEMP2 web.config

<add name="ApplicationServices"
     connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
     providerName="System.Data.SqlClient" />
9
Under TEMP2 project, add reference to OpenForum solution
10
Go to Application_Start() on Global.asax.cs and add as first line of the method
"OpenForum.Core.OpenForumManager.SimpleInitialize();"
11
Set TEMP2 as default startup project, clean solution, build it and run it
12
Delete Entity Framework from OpenForum references
13
On OpenForum add reference to C:\Projects\openforum-019c57cf6d02\openforum_019c57cf6d02\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll
14
On OpenForum go to Packages.config
15
Change Entity Framework version from 4 to 5
<!--<package id="EntityFramework" version="4.1.10311.0" />--> <package id="EntityFramework" version="5.0.20627.0" />
16
On VS Solution Explorer, copy Forum folder (Views\Forum) from OpenForum project to the views folder of TEMP2
17
Clean solution, build it and run it
18
Working...
Sep 29, 2013 at 3:47 AM
Current status, working on Write Lock issues with Lucene, probably will have to update do recent dll, vesion 3 or 4, indexpath works differently
Sep 29, 2013 at 3:51 AM
Sep 29, 2013 at 9:23 AM
19
Added Lucene 3.0.3.0, but it doesn't seem to cooperate at all due to some write lock issue. For this not useful yet step, go to https://www.nuget.org/packages/Lucene.Net/3.0.3
delete reference to this dll on openforum project and add the new one

20
Adjust Searcher file (OpenForum.Core.DataAccess.Searcher.cs) so it can work along with Lucene 3

21
At this point the solution compiles, builds ok, but will produce runtime errors when accessing forum due to lucene write lock bugs (as far as understood so far), therefore, workarounds will save the world!

On OpenForum.Core.DataAccess.Searcher.cs comment the whole content of
private void DeletePostIndex(Post post)
{
/*
COMMENT EVERYTHING
*/
}

This will allow you to navigate the forum posts and create posts, but replies wont be possible yet (runtime errors)

So workaround 2, for replies is way easier, on OpenForumManager.cs, comment the the 4th line
//routes.MapRoute("ForumSubmitReply", "Forum/Reply/{postId}/{id}/{title}", new { controller = "Forum", action = "Reply", postId = "", id = "", title = "" });

22
Test the forum. At this point it is very functional, but searches won't work, although, I am not sure yet if that is my fault or Lucene's, will update later!