Hi all welcome back. in this post we will see about how to setting up visual studio for sitecore solution
Let's Move,
Step 1: Choosing the right project and location
Developers use an Asp .net Web Application project using an Visual studio C# in a visual studio to develop Sitecore projects.
Frameworks Supported by the Sitecore
- MVC
- Web Forms
Step 2: Create a Sample Asp .net Web Application.
a. Open Visual Studio as an Administrator and click File => New => Project and in the New Project dialog, browse to Templates, Visual C#, Web.
b. Select ASP.NET Web Application.
c. Create a Empty MVC project.
Step 3: Delete the Web.Config file of Mvc project and replace with Sitecore Web.Config file.
Step 4: Create a folder named as libraries and Copy the below .dll files from your sitecore instance to libraries folder(in Visual Studio) and add these references to your MVC project.
Sitecore.Kernel
Sitecore.Mvc
Sitecore.Analytics
Sitecore.Mvc
Sitecore.Analytics
Note: Referencing Sitecore dll’s directly from bin folder is not recommanded.
Step 5: Replace the Mvc Global.asax file with sitecore Global.asax file.
Right click global.asax => View Markup => replace sitecore Global asax
<%@Application Language='C#' Inherits="Sitecore.Web.Application" %>
<add namespace="Sitecore.Mvc.Presentation" />
In the
Views/web.config
file of your Visual Studio project, add the following Sitecore namespaces to the list of namespaces:<add namespace="Sitecore.Mvc" />
<add namespace="Sitecore.Mvc.Presentation" />
Step 6: Right Click your project and choose Publish and do the below steps
Create a new Profile
Publish method --File system
Target Location -- choose local IIS and give your Sitecore project path.
Click Publish
Step 7: Right click top of your project and Enable one Web click publish.
Step 8: Run your instance and check if it’s works. If you’re facing version issues in System.Web.Mvc related assemblies, please make sure your instance System.Web.Mvc and visual studio System.Web.Mvc ,both have the same version.if not please change to Instance System.Web.Mvc version.
Sitecore vs Visual studio publishing
Sitecore
|
Visual Studio
| |
Action
|
Move content items from master to web
|
Move files from the project root folder to website root folder.
|
Command
|
Publish
|
Deploy
|
Content
|
Sitecore Items
|
Code files,Configuration files,dll’s
|
Tool
|
Sitecore/Sitecore Rocks
|
Visual Studio
|
All now set. Run and work with sitecore. Happy Coding :)
No comments:
Post a Comment