Monday, November 26, 2018

Setup Visual Studio Project For Sitecore


Visual Studio solution for Sitecore 9

 

1.      Create a new a new web project,

 

 

 

 

Enter the Name

Location

Solution name

 

 

2.      Select ‘Empty’ ASP.NET Template

Click on ‘MVC’ Check box

Click on OK

 

 

3.      Delete the Global.asax file

Delete the Web.Config file

 

4.      Go to your Sitecore IIS Project. Follow this link https://sitecore4u.blogspot.com/2018/09/sitecore-9-update-2-installation.html, if you are not having Sitecore project in IIS.

 

 

 

Copy Global.asax, Web.Config files and paste in your Visual Studio Project.

 

 

 

5.      Add Nuget package solution for sitecore

 

 

 

 

NuGet V3 feed URL (Visual Studio 2015+)

https://sitecore.myget.org/F/sc-packages/api/v3/index.js

 

6.      Tools -> NuGet Package Manager -> Manage NuGet Packages for Solutions

 

Sitecore.Kernel

Sitecore.Mvc

Sitecore.Mvc.Analytics

 

Click Install

 

7.      Now your project is ready.

 

To set up the publishing deployment, in the Create Publish Settings dropdown in the Visual Studio toolbar, select <New Custom Profile>

In the Publish Web dialog, in the Publish method field, click File System, and in the Target location field, browse to the Website folder of your Sitecore instance, and then click Publish.

 

 


Installing Sitecore eCommerce

                             Installing Sitecore eCommerce

PREREQUISITES:

1.      Download and Install .NET Core 2.1.4 from the below link.

2.      Download and Install .NET Core Windows Server Hosting 2.0.0 from the below link.

3.      Download(Just Download Don’t Install) Sitecore PowerShell Extensions 4.7.2 from the below link




4.      Download(Just Download Don’t Install) Sitecore Experience Accelerator 1.7.1 from the below link

5.      Download(Just Download Don’t Install) the Sitecore XC Update 2 release package from the below link

6.      Create Folders
c:\Sitecore\Deploy
c:\Sitecore\Deploy\assets

7.      Copy
Sitecore PowerShell Extensions 4.7.2
Sitecore Experience Accelerator 1.7.1
To
c:\Sitecore\Deploy\assets

8.       
8.1   Copy
Sitecore XC Update 2 ZIP file
To
c:\Sitecore\Deploy

8.2   Extract
Sitecore XC Update 2 ZIP file
To
c:\Sitecore\Deploy

8.3   Delete
“Sitecore XC Update 2” ZIP file

9.       
9.1    
Extract Below ZIP files
From c:\Sitecore\Deploy

SIF.Sitecore.Commerce.1.2.14.zip
Sitecore.Commerce.Engine.SDK.2.2.72.zip
Sitecore.BizFX.1.2.19.zip

To Same folder (c:\Sitecore\Deploy)

9.2    
      Delete Below ZIP files
From c:\Sitecore\Deploy

SIF.Sitecore.Commerce.1.2.14.zip
Sitecore.Commerce.Engine.SDK.2.2.72.zip
     Sitecore.BizFX.1.2.19.zip

10.  Download MS Build Microsoft Visual Studio Web targets from the below link

10.1             
a)      Change extension of downloaded file from “nupkg” to “zip”
b)     extract zip file
c)      open extracted folder and navigate to
msbuild.microsoft.visualstudio.web.targets.14.0.0.3 -> tools -> VSToolsPath -> Web
d)     Copy “Microsoft.Web.XmlTransform.dll” file into “c:\sitecore\deploy\assets”.

11.   
Copy file “Sitecore.Commerce.Engine.DB.dacpac” from “C:\Sitecore\deploy\Sitecore.Commerce.Engine.SDK.2.2.72” into “C:\sitecore\deploy\assets”
Unzip “C:\sitecore\deploy\Sitecore.Commerce.Engine.2.2.126.zip” into “C:\sitecore\deploy\Sitecore.Commerce.Engine.2.2.126” folder and open “C:\sitecore\deploy\Sitecore.Commerce.Engine.2.2.126\wwwroot\bootstrap\Global.json” file.
a)      Set the “Database” value under “SourceStoreSqlPolicy” to “SitecoreCommerce9_Global”
b)      Set the “Server” value under “SourceStoreSqlPolicy” to “.”
c)      Zip the folder “C:\deploy\Sitecore.Commerce.Engine.2.2.126” as “C:\deploy\Sitecore.Commerce.Engine.2.2.126.zip” file overwriting the existing file “C:\deploy\Sitecore.Commerce.Engine.2.2.126.zip”.
d)      Remove “C:\deploy\Sitecore.Commerce.Engine.2.2.126” folder afterwards

CERTIFICATE FOR SITECORE COMMERCE ENGINE CONNECT:

We create this certificate for Commerce Engine to authenticate with Sitecore XC Engine.
1.      Open PowerShell as Admin
2.      Run the following command

New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname “sc902.engineconnect”

Copy and Save the Thumbprint in notepad.
3.      Export certificate by running the following command

Export-Certificate -Cert cert:\localMachine\my\{Thumbprint} -FilePath ‘C:\sitecore\deploy\assets\sc902.engineconnect.cer’

Replace {Thumbprint} with your generated Thumbprint value from above step.

INSTALLATION:

1.      Check whether you have all your necessary files placed in your deploy(c:\sitecore\deploy) folder
And assets(c:\sitecore\deploy\assets) folder

Pic 1.
Pic 2.





2.      Check your Sitecore Instance

2.1             Rebuild link databases(core, master)


2.2             Rebuild search index




2.3             Sitecore PowerShell Extensions 4.7.2


2.4             Install “Sitecore Experience Accelerator 1.7.1 rev. 180604 for 9.0” package



After Successful installation.

Go to
Sitecore Control Panel -> Indexing Manager -> Select the Below 2 Indexes and Click Rebuild





3.      Running Deploy Script

Copy the Script from this https://gitlab.com/viet.hoang/workshop/blob/master/Scripts%20for%20Sitecore%20Commerce%20902/sc9_com_install.ps1 link, Create a Powel Shell Script “Deploy-Sitecore-Commerce.ps1” file, Save it into c:\sitecore\deploy\SIF.Sitecore.Commerce.1.2.14

               Open PowerShell in Administration mode, run the script.