Do It Yourself Guide
1. Create Empty Web Application Project
In Visual Studio 2010, create new empty C# Web Application Project as shown below:
2. Copy website files into Web Application project
Download latest
BlogEngine.NET source code and copy lib, BlogEngine.Core and BlogEngine.Test folders to new WAP solution. Your folder structure should look like this (ignore _Resharper and .hg files):
3. Configure Visual Studio Solution
- Open solution in Visual Studio 2010
- Add Core and Tests projects to solution (file -> add -> existing project)
- Add Core project reference to web application (right-click BlogEngine.Web in solution explorer -> add reference -> project reference -> BlogEngine.Core)
- Add reference -> browse -> up to the “lib” folder -> down to “razor” and select all DLLs in that folder -> ok to add
- Set BlogEngine.Web as startup project (right-click in solution explorer, set as startup project)
- Save all, build solution - should be no errors.
4. Convert to Web Application
- Copy all files from BlogEngine.NET to BlogEngine.Web overriding existing
- Rename App_Code folder to AppCode
- In VS solution explorer, click "show all files" icon -> select all files and folders that will show up (except obj) -> right-click -> include in project
- Select BlogEngine.Web in solution explorer -> right-click -> convert to web application -> yes to confirm (in VS 2013 this option moved under "Project" menu)
5. Handle App_Code folder
- For Razor helpers to work, we do need App_Code folder back. Right click BlogEngine.Web in VS solution explorer -> add -> new folder - > App_Code
- Move AppCode/Helpers folder with all files to App_Code folder
- Modify Web.Config from: <add namespace="App_Code.Controls" tagPrefix="blog"/> to: <add assembly="BlogEngine.Web" namespace="App_Code.Controls" tagPrefix="blog"/>
6. Edit location in post-build event
- Select BlogEngine.Core -> Project -> Properties -> Build events
- Change from BlogEngine.NET to BlogEngine.Web
- Build -> build solution - should get no errors.