Surendra Sharma

Surendra Sharma

Search This Blog

Saturday, October 1, 2016

How to use Visual Studio 2013 for Sitecore 8.2




I received Sitecore 8.2 EXE file and was trying my hand with new features of Sitecore 8.2. I created web project in Visual Studio 2013 with .NET framework 4.5. I copied Sitecore.Kernel.dll and Sitecore.Client.dll from Sitecore 8.2 bin folder and included their reference in my web project.

I write below test code and at design time it looks fine to me. 

Design Time Code
Design Time Code


But when tried to compile it, VS started to giving me error “The type or namespace name 'Sitecore' could not be found (are you missing a using directive or an assembly reference?)” as

Compile Time Errors
Compile Time Errors


I was trying to figure it out what is the problem and how to fix it?

Problem:

I check .NET framework version for my VS project and it was set as 4.5 as

Target Framework 4.5
Target Framework 4.5

Then I check the version of Sitecore 8.2 installed instance in its web.config file which showing it as 4.5.2 as


Sitecore Instance Version
Sitecore Instance Version


So I was referring higher version of DLL in lower version of .NET framework Visual Studio project which obviously not allowed by any framework.

How to fix it?

We have to create our web project in .net framework 4.5.2 or higher version.

From where to download?

  • Right click web project in Visual Studio
  • Select “Properties
  • Select “Installed other frameworks…” from target framework dropdown list as
 
Install Other frameworks
Install Other frameworks
 
  • This action redirects you to framework download page.
  • Download appropriate .NET framework according to your Visual Studio version. I select Visual Studio 2013 and downloaded Developer framework pack 4.5.2 and 4.6.2 as
 
Targeting .NET Platforms
Targeting .NET Platforms


Post Download steps:

  • I installed first framework 4.5.2 and then framework 4.6.2.
  • I change my Visual Studio project version from 4.5 to 4.5.2.

Dot net framework 4.5.2
Dot net framework 4.5.2
 
  • Ignore Visual studio warning on framework version change. 
  • This action include web.config file in our web project. 
  • Note:- Make sure to delete this new web.config file otherwise on build this config file replace our web.config file in publish folder which crash your Sitecore instance.
  • Build the solution.
 
OMG my project is compile successfully now and I am able to get required result in Sitecore 8.2 :)

Conclusion:

If you have Visual Studio 2013 and want to work with Sitecore 8.2, make sure you have created your web project in .NET framework 4.5.2 or higher.
 
This is another Sitecore learning lesson for me. Please leave your comments or share this learning lesson if it’s useful for you.

Saturday, September 24, 2016

How to Architect a high-performing and scalable Sitecore environment in the cloud


This is regarding attended webinar "How to Architect a High-Performing and Scalable Sitecore Environment in the Cloud" by Torry Williams, Senior Cloud Architect.

Below are the points covered by speaker.

Sitecore Development Options
-      Physical Servers
  • Good for : hybrid environments, database workloads
  • Dedicated resources built for unique environment
-      Public Cloud
  • Good for smaller, separated Sitecore roles
  • Cost effective & scalable
-      Private Cloud
  • Good for security conscious virtual SC deployments
  • Secure & efficient
-      AWS/Azure
  •  Good for: clients wanting yo move to hyper scale public cloud
  • Sitecore design & management expertise applied to AWS/Azure infrastructure
-      Colocation
  • Good for those who prefer to managing the environment
  • Client responsible of server configuration, proactive support and continuous business planning

According to Torry - Hybrid combination is the best.

What is scaling?

The ability of system, network or process to handle a growing amount of work.
There are two types of scaling

·         Horizontal scaling: adding or removing compute nodes
o    Example-Admission time in college, xMas, new year, Offer period, Holiday time etc. increase the traffic on website.
·         Vertical Scaling : adding or removing resources from a single node

Sitecore working depend upon its server roles and each role can be configured individually on distributed basis such as we can have different server for CD, session, collection, reporting, CM etc.

We can increase or decrease configuration of any particular role depend upon its usage

Example :-
If your management want daily or hourly reports, then you need to increase processing/aggregation role.

If there are 50 Content Editor, then you have to increase CM role.

If you have very heavy visitors traffic, you have to increase CD roles.

You can combine two roles but over the time period when user grow or more traffic, you may need separate it out.

Understand business requirement
  •  Define success
  • What problems are we trying to solve
  • How is sitecore being used to solve them?
  • Who are internal users - Marketing, sales, accounting, Management (etc.) 
              ·         How is Sitecore being used by each department? 
              ·         How often is reporting data required?

Understand The environment
  •  Questions to size your cloud environment
  • What SItecore version and modules are you running/considering?
  • Are you utilizing a CDN?
  • Are you utilizing a search service like solar or Lucene
  • What is your tolerance for downtime? (HA - High Availability / DR)
  • Number of contacts in your xDB?
  • Request per second?
  • Average page view per session?
  • Session duration in seconds?
  • Session end overhead?
  • Estimated session size?

Session and collection DB are heart of Sitecore experience.

Use MongoDB for Session State instead of SQL server because of its ability to handle large amount of users and data.

Session can be of two type - Shared or private. If you have multiple CD then go for Shared Session state.

Always keep auto scale server configuration, in case if you need more server resources you can upgrade them anytime.

You can setup your CD/CM environment with single CD server, Single Load-Balanced CD server, Two Load-Balanced CD server.

You should choose cloud environment for deploying your Sitecore solutions. 

Why Cloud
  • Simplified installation & configuration
  • No specialist knowledge needed
  • Global distributed data centers
  • Automatic backup
  • No need to manage scalability
  • Security - spread across multiple locations

 Please leave your comments or share these tips if it’s useful for you.