MVC Template Customization Errors and Fixes
This would be my first blog that is related to my career as a Web Developer. This serves also as a documentation, since I'm not good enough in organizing my files and too young enough to easily forget things.
As the title suggests, this article is all about customization of the defined template for Web Application developed in MVC (Model View Controller). What I mean here is, if your company has established a standard layout for your webpages using MVC Framework which could be used by the different team of developers so that they would not start from scratch.
Template
Company's Template Name : CompanyName
Solution Name : CompanyName
Project Name : CompanyName
Supposing you have to use the example template above for your first web application using MVC Framework, you have to do the following.
1. Copy the folder containing the solution to your desired location.
2. Open the Solution in Visual Studio.
3. Edit the Solution Name to your desired name, ex. MyFirstMVCApp.
4. Edit the Project Name to your desired name, ex. MyFirstMVCApp.
5. Right Click on the Project Name and Remove.
6. Right Click on the Solution Name and select Open Folder in Windows Explorer.
7. Rename the Project folder, ex. MyFirstMVCApp.
8. Right Click on the Solution Name and select Add Existing Project.
7. Find your project.
8. After the project has been added, right click on its name and select Properties.
9. Change the Assemply Name and the Default Assembly Name to your desired value.
10. Click Assembly Information button and modify the values of the fields to your desired value and click OK.
Assembly Information |
11. Change the namespace in Model, Controller and Views.
12. In Solution Explorer, find Global.asax, then right click and select View Markup.
<%@ Application Codebehind="Global.asax.cs" Inherits="MyFirstMVCApp.MvcApplication" Language="C#" %>
Note: Your project name must be the value if the highlighted info to eliminate this kind of error when running your system.
13. In Solution Explorer, right click on Bin folder and select Open Folder in Windows Explorer.
14. Delete all dlls.
Note : This would eliminate this error "Multiple Types were found that match the controller named "Account". etc."
15. Clean and build your project.
16. Test your system.
You are now on the second stage after completing these 16 Steps. Second stage will cover your layouts etc.
Hope this article helps.