03/18/2015 08:11 PM Source Code Getting Started
Virto Commerce

Source Code Getting Started

Updated:

 Before you start

  • Microsoft .NET Framework 4.5 (download link: Microsoft .NET 4.5)
  • Internet Information Services 7 or above
  • Microsoft Visual Studio 2012 or later
  • Microsoft SQL Server 2008 (Express or Full) or above (download link: Microsoft SQL Server 2012 SP1 Express)
  • If using Visual Studio 2012 need to install: Windows Azure SDK for .NET (VS 2012) - 2.4. Web Platform Installer download link
  • If using Visual Studio 2013 need to install: Windows Azure SDK for .NET (VS 2013) - 2.4. Web Platform Installer download link
  • JRE 7 or above (for search server)

Getting started

  1. Download the latest source code from http://virtocommerce.codeplex.com
  2. Unblock the archive file.
  3. Extract the source code project.
  4. Open the VirtoCommerce.sln solution file and build it.
  5. Go to ~\src\Extensions\Setup\VirtoCommerce.PowerShell\ folder right-click and run setup-database.ps1 Powershell script

Powershell v3.0 should be installed (download) or if you have Powershell v2.0 in the system create a file “powershell.exe.config” in the C:\Windows\System32\WindowsPowerShell\v1.0 with content:

<?xml version="1.0"?> 
<configuration> 
  <startup useLegacyV2RuntimeActivationPolicy="true"> 
    <supportedRuntime version="v4.0.30319"/> 
    <supportedRuntime version="v2.0.50727"/> 
  </startup> 
</configuration>

Wait until script finishes database deployment.

  1. Go to ~\Tools\ElasticSearch\bin\ and run elasticsearch.bat batch file.
  1. Browse the following URL: http://localhost:9200/. If you see the page like in the screenshot below, then the server is running successfully.
  1. Index the database. Go to ~\src\Extensions\Setup\VirtoCommerce.PowerShell\ folder and run Powershell script setup-search.ps1
  1. Download assets required for frontend from here, extract the archive to ~\src\Presentation\FrontEnd\StoreWebApp\AppData\Virto folder.
  2. In order to run dataservices and frontend configure IIS to the ~\src\Presentation\FrontEnd\StoreWebApp folder. Set permissions for this folder to allow IIS modify it (IIS_IUSRS user).

Your Web application basic configuration should look similar to the screenshot below:

The Alias name must contain only lower case letters ex. "store" and not "Store"!

If frontend is configured correctly you should be able to browse the sample store

  1. Set Presentation.Application project of the VirtoCommerce solution as startup and Start it. The backend should be launched.
  1. Log in

user: admin password: store base url

Appendix

Appendix A: Internet Information Services configuration

  1. Open Internet Information Services (IIS)
  2. In the left pane go to Server -> Sites -> Default Web Site
  3. Right click it and choose Add application… item
  4. In the popup window enter frontend Alias (e.g. store), select DefaultAppPool in the Application pool and navigate to unzipped solutions frontend folder: (~\src\Presentation\FrontEnd\StoreWebApp) Setup permissions for the frontend folder in order IIS would have required permissions on the folder.

Appendix B: Database setup

There are two options to create database:

  • without sample data
  • with sample data

From the user perspective the difference is if you will or won't have sample store with sample data in the backend and frontend.

If you don't want to deploy sample project with all the sample data you can setup only database structure and minimum required data (e.g. default user). In this case the frontend won't be available until you add or import required data (e.g. catalog, store, items etc.) and configure it. Otherwise all sample data will be added to the database.

To setup database go to ~\src\Extensions\Setup\VirtoCommerce.PowerShell\ folder and run Powershell script below.

  • without sample data:
    setup-database.ps1 -useSample:$false
    
  • with sample data:
    setup-database.ps1
    

If sample data is deployed, assets for the frontend should be downloaded and placed correctly.

Appendix C: Running Powershell scripts

  • Use x86 version of Powershell to run scripts.
  • Powershell should allow to launch not signed scripts. If not you can do one of the following:
    • Right click the script in the windows explorer and select "Run with PowerShell".
    • Use the following command from the command prompt to run the scripts:
      PowerShell.exe -File <FileName> -ExecutionPolicy Bypass
      
    • Run PowerShell (launch with administrator rights) command:
      set-executionpolicy unrestricted;
      

Appendix D: Smtp server

For developing customer service/orders email send/receive functionality you need smtp server. Use smtp4dev (dev enviroment preconfigured to use localhost)

Troubleshooting

Q: Source code doesn't build due to some .dlls are missing.

A: Some file(-s) could be blocked by the system. Go to the source code folder and unblock it.


Q: Error regarding ASP.NET

A: Register the .net framework 4.5 for IIS Server


Q: Can't login to store using Commerce Manager, get error starting with: "There was no endpoint listening at http...".

A: Enable WCF services on web server (starting from Windows version 8): using Programs and Features -> Turn Windows features on or off in the Control Panel. Go to .NET Framework 4.5 Advanced Services -> WCF Services and enable HTTP Activation.


Q: Elastic search batch file fails to run

A: Check the JAVA_HOME variable (C:\Program files\Java\jre7)


Q: Powershell script doesn't run

A: Open Powershell and run command get-host

If it returned version 2.0 then there are two options to troubleshoot the problem.

Install Powershell v3.0 (Download Windows Management Framework) or create a file named “powershell.exe.config” in the C:\Windows\System32\WindowsPowerShell\v1.0 and copy/paste the content below to the file:

<?xml version="1.0"?> 
<configuration> 
  <startup useLegacyV2RuntimeActivationPolicy="true"> 
    <supportedRuntime version="v4.0.30319"/> 
    <supportedRuntime version="v2.0.50727"/> 
  </startup> 
</configuration>