Monday, 13 February 2017

My schedule Ignite 2017



I'm attending Microsoft ignite Australia. After looking into topics and speakers I felt like a kid that goes to candy shop and not know what to choose. After attending few conferences, I learnt it's a good idea to print out or screen capture(greener option) your schedule just in case if you cannot connect to internet or the conference website goes down!

This is my initial schedule.


Day 1
Opening KeynoteScott Guthrie11:00 AMArena 2Tue 14 Feb
Kick-off: Cloud, Architecture & Infrastructure [KICK111a]David Burela, Reid Purvis, Kurt Heiz1:00 PMArena 2Tue 14 Feb
Kick-off: .NET Development [KICK111b2]Andrew Coates Jordan Knight1:45 PMArena 1ATue 14 Feb
Introduction to ASP.NET Core [NET312] Jordan Knight2:30 PMCentral ATue 14 Feb
Blockchain 101 & Azure Blockchain as a Service [CLD213] David Burela Chris Zhong4:15 PMArena 1BTue 14 Feb
Welcome Reception & Expo Open5:30 PMTue 14 Feb
Day 2
Diversity & Inclusion BreakfastMichelle Sandford Aaron Whittaker David Masters Kenny Johar Singh Vivienne Conway7:00 AMHack Theatre, The ExpoWed 15 Feb
Deep Dive into Azure Cognitive Services [DA321]Rolf Tesmer Kristina Rumpff8:15 AMRoom 9Wed 15 Feb
Azure Portal – Building Large Scale Single Page Applications [ARC122]Jakub Jedryszek9:45 AMRoom 7Wed 15 Feb
Hacking, Citizen Science and Maker IoT [MYMAZ1]11:10 AMMicrosoft ShowcaseWed 15 Feb
CQRS Secrets: How to Support Scalability and Performance [ARC323]Richard Banks11:30 AMCentral BWed 15 Feb
5 Ninja-Tricks to Making Workplaces Suck Less [HCK122]Kylie Hunt1:00 PMHack Theatre, The ExpoWed 15 Feb
Humanising Innovation [HCK123]Rita Arrigo1:25 PMHack Theatre, The ExpoWed 15 Feb
Blockchain Development on Azure Blockchain as a Service [CLD424]David Burela1:45 PMCentral BWed 15 Feb
Take Control of the Data of You [HCK124]Nigel Parker3:10 PMHack Theatre, The ExpoWed 15 Feb
What Dotnet PCL Profile is .NET Standard? [NET325b]Lewis Benge3:30 PMRoom 5Wed 15 Feb
Microservices, Docker, .NET, Windows, Linux, Azure. Oh, My! [ARC326]Richard Banks5:00 PMArena 1AWed 15 Feb
Conversation As a Platform Part 2 [NET327a]Dr. Neil Roodyn6:30 PMCentral BWed 15 Feb
Day 3
Angular 2 Testing: Techniques and Practices [OPEN331]Adam Stephensen Duncan Hunter8:15 AMArena 1AThu 16 Feb
Elastic ♥ Microsoft [OPEN332b]Russ Cam9:45 AMRoom 9Thu 16 Feb
"Explain Yourself!" - Explaining What We Do, While Trying to Keep Everyone Happy [HCK131]Jess Dodson11:10 AMHack Theatre, The ExpoThu 16 Feb
How to build high performing API's [CLD233]Nathan Fernandez11:30 AMRoom 8Thu 16 Feb
Using Azure Machine Learning to Predict House PricesRolf Tesmer12:45 PMMicrosoft ShowcaseThu 16 Feb
The Force Awakens: Mastering Your Inner Developer [HCK133]Lars Klint1:15 PMHack Theatre, The ExpoThu 16 Feb
Rackspace Tales from the Trenches - Deploying Complex and Large Scale Azure Environments [CLD334a]Aaron Saikovski1:45 PMCentral BThu 16 Feb
Creating Secure websites using Azure App ServiceAndrew Cobb3:00 PMMicrosoft ShowcaseThu 16 Feb
From Spaghetti to Microservices Architecture [ARH435]Stefano Tempesta3:30 PMArena 1BThu 16 Feb
Prevent unwanted and embarrassing leakage with Azure Information Protection [CLD336b]Andrew McMurray Richard Diver5:00 PMArena 1BThu 16 Feb
Microsoft Ignite Spark After Dark6:15 PMThu 16 Feb
Day 4
Azure API Management Dive Deep [ARC441]Jorge Arteiro8:30 AMRoom 5Fri 17 Feb
How to Level Up on Life by Thinking Outside the (X)Box [HCK141]Michelle Sandford9:50 AMHack Theatre, The ExpoFri 17 Feb
The Technical Debt Prevention Clinic [NET342]Richard Banks10:15 AMRoom 5Fri 17 Feb
Azure + Docker: Easy Open Source Shipping [OPEN443]Peter Gatt Chris Fowles11:45 AMRoom 7Fri 17 Feb
3 Steps to Innovate and #HackTheStatusQuo [HCK142]Dux Raymond Sy1:10 PMHack Theatre, The ExpoFri 17 Feb
Remote Access with AAD App ProxyAndrew Cobb1:40 PMMicrosoft ShowcaseFri 17 Feb
Closing KeynoteDona Sarkar

View it on google docs
https://docs.google.com/spreadsheets/d/1qy0pW8JSuHUFWVOgo1IO0Bv65VJCC1pbPz-EArIRrRA/edit?usp=sharing

Thursday, 9 February 2017

Honoured to be Sitecore MVP 2017

I am very honoured to be recognized as Sitecore MVP 2017. I started learning and working with Sitecore in 2013. Kelly Brennan and Annelie Karlsson showed me the Sitecore dashboard for the first time. I learned Sitecore from David (Danny) Newman by attending Sitecore training course and working with Joe Stevens our tech lead at Pantha corp on Sydney airport project.
During my career, I worked with so many great developers including Sudeep ShakyaSteve AdamsJoel ReadeZhen Yuan and learned a lot from each of them. I cannot hide how I appreciate Martina Helene Welander’s youtube videos and John West and other Sitecore gurus blog posts.
I tried my best to share the issues I faced and how I solved them during my learning journey in my blog posts. It was the least thing I could do to pay back to Sitecore community.
Also, I like to thank my new role models Michael Reynolds and Richard Hauer organizers of Sydney Sitecore meet ups for encouraging me to get out of my comfort zone and presenting at Sitecore meet up and be more active in Sitecore community.
Finally, I like to thank all of sitecore MVPS who nominated me and Sitecore judges who chose me from the list of nominees.
It looks like an Oscar award winning speech! It’s a big achievement for me and it wasn’t possible without Sitecore community help.
Thank you

Wednesday, 8 February 2017

Could not load file or assembly 'System.Web.Mvc'

If you inherit old sitecore site version 6.5 or version 7.1 you are more likely to get a error that iis is complaining about finding System.Web.Mvc assembly.

<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35" />

You can download MVC 4 dlls from following link and install it on your local machine https://www.microsoft.com/en-us/download/confirmation.aspx?id=30683 

 I recommend to add required dlls later to solution and then set your dll to copy local.

Sunday, 5 February 2017

My experience with a 24 hour sitecore hackathon 2016

https://cdn-images-1.medium.com/max/800/0*8BccXKKNkSwhqcxC.png


Last year, Sudeep and I attended a 24 hour sitecore hackathon. We teamed up and called our team red Staffy.  I have a fur baby and his name is Cookie, that's why I came up with this name. By the time we teamed up, Sudeep hasn't had his Oscar. Otherwise, our team name would be different. Sudeep is detail oriented and has a competitive personality. Which every team needs to have someone like him. We both attend hackathons for fun and learning experience. Although, we don't hide that we enjoy winning and getting recognized but that's not our main motivation.

On the hackathon day, We notified about the competition categories. We all knew it will be about habitat but no one knew what we have to implement and what would be theme of  competition.

There were three category that we could pick up from

1- Building new Feature module for habitat
2- Creating an integration to a 3rd party system in the Habitat.
3- Building new UI site for habitat

you can read more details here.



Our challenges:

1- find an idea for the module which we can finish it in short amount of time and show case our knowledge
2- find a way to share our code privately, since each of attending remotely from home  
3- find a way to communicate and share files and ask questions
4- find a way to screen cast our end result and submit it

Our solutions:

1- Time boxed our ideation and discussed pros and cons of each idea and picked one idea that we both felt comfortable with and focused on it .
2- We created a private repository on bitbucket . You can create private repo on bitbucket use it up to 5 users for free free. We split tasks and try to mange to work on separate tasks to avoid merge conflicts 
3- we used slack for communication and file sharing
4- Believed it or not we waste some time to find a free screen casting app than we can use and upload our demo on youtube. finally we found https://screencast-o-matic.com/

We decided to go with the first option and build Events Feature. This feature allows content editors to create events in sitecore backend. Content editors can add calendar module on any page to display events in calendar or add link to the list of events page. Each event has it’s own detail page. On event detail page web site visitors can see venue of the event on Google Maps and they would be able to add the event into their calendar (icalendar, google calendar, outlook. outlook online, yahoo calendar). All of renderings are responsive. This feature also helps web site marketers and events organizers to see popular events and analyse interest on each event based on number of people add the event in their calendar.

If you are interested you can see our source here
https://github.com/Azadehkhojandi/Habitat

Also you can watch our demo on youtube
https://www.youtube.com/watch?v=abs7W2kKTHs&feature=youtu.be&hd=1
https://youtu.be/j0Fi62Zw_xQ


Winning teams:

Both Sudeep and I tried our best and hoped for good outcome. We both were thrilled when we heard community judges liked our solution and idea. You can read more about winning teams here.

If you haven't signed your team up for sitecore hackathon 2017 yet. There is still time and you can register your team here.  Unfortunately,Sudeep is on holiday and he couldn't attend the hackathon. Luckily, Zhen and Budi were interested and now we have full team. Looking forward to compete against your team in two weeks.

Sydney Sitecore meetup

Sometimes life shows you a path to follow that you never think of before. The story starts when I was looking for my new Sitecore adventure. Some how Seek website has lost all of my filtering and I accidentally applied for the role that it wasn't in my search criteria.  I wrote done the name and suburb of the company and I decided if they liked my CV and called me I just tell them the truth and apologize for the inconvenience.
I was at noodle market with my husband Harry when my phone ranged and someone over the phone wanted to interview me and chat about my experience. The market was too loud and it made it impossible for me to have a phone conversation. I apologized and explained the situation and asked if we can continue our chat next day. Next day, I had phone call and very interesting phone interview was going on. I really liked the type of questions and liked the attitude of the interviewer.  the conversation continues and I realized Sitecore junkie is interviewing me! I double check the name of company and you guessed it right. It was the company I applied accidentally!
@Mike_i_reynolds has mentioned he recently moved to Sydney. Mike said he is thinking to start sitecore meetups here and he needs some sponsors for the meet up. If you work on sitecore projects you know how important it is to continuously learn and hear others experience. Also, every one knows the benefits of meetups.  I go religiously to girls geek meet up and women who code and learnt a lot and found very great friends there.

I couldn't be any happier about the meet up idea and I said to Mike, I'll check with my ex-boss Eric at lendlease and see if they like to sponsor the meetup. Lendlease kindly accepted and hosted the meet up in their new building at barangaroo.

@mike_i_reynolds and @RichardHauer and Eric presented in the first meetup. Everyone liked the talks.

I was looking  forward to attend Thomas talk for the next meet up in Jan. I heard from Rich and Mike that unfortunately, he cannot make it and they are looking for someone to present.

I don't have much public speaking experience but what I really wanted was to see this meetup is continuing. After chatting with Zhen, we decided to do a dual presentation. It helped us to prepare better in short notice. Also, It's great to know you have someone else on stage beside you that knows your lines and if somehow you passed out, she can carry on and deliver presentation.

Our presentation was about, our recent project for Sydney Olympic Park. We used Web forms for marketers(WFFM) and Email experience manager (EXM) to automate all of their news letter subscription process. We wanted to share our knowledge and share how we extended WFFM and EXM to fulfill all of the requirements.

We split the presentation in two sections. First, introduction about theses two Sitecore modules to bring the developers who might have not used these two modules on board and  understand the concepts. Second, showing code and how we extended them.

you can see our presentation slides here
https://docs.google.com/presentation/d/1NFhT4Ou6x5yQwfH_A4be56O_hkGYLVIlCyvU4O-V6uM




Our fears were
1- forgetting the lines
2- not being able to deliver what we intended to
3- not being clear and no one understand our accents

luckily none of above happened and we could present without any issues. All of Sitecore attendees were friendly and the feed backs we got were positive. Mike and Rich were very encouraging and tried their best to share their expedience before our presentation to calm our nerves down.


The second Sydney Sitecore meetup ticked another box. All, the three presenters were females developers.





 from right to left: Kelly, Azadeh, Zhen


I encourage all of the sitecore developers in Sydney participate and attend in sitecore meetup. Also, We all like to hear about your experiences and learn from you.
It's free event and you can register here to learn more https://www.meetup.com/Sydney-Sitecore-User-Group/

Friday, 13 January 2017

Sitecore publishing ERROR: "Could not allocate space for object 'dbo.EventQueue' in database 'Your Database' because the 'PRIMARY' filegroup is full"

I needed to restore production db backups for sitecore 7.1  and I got the following error

Job started: Publish to 'web'|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --->
System.Exception: Could not allocate space for object 'dbo.EventQueue'.'IX_Stamp' in database 'x_Web' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup. ---> System.Data.DataException: Error executing SQL command: INSERT INTO [EventQueue](
                    [Id], [EventType], [InstanceType], [InstanceData], [InstanceName], [RaiseLocally], [RaiseGlobally], [UserName]
                  )
                  VALUES(
                    @id, @eventType, @instanceType, @instanceData, @instanceName, @raiseLocally, @raiseGlobally, @userName
                  ) ---> System.Data.SqlClient.SqlException: Could not allocate space for object 'dbo.EventQueue'.'IX_Stamp' in database 'x_Web' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Sitecore.Data.DataProviders.Sql.DataProviderCommand.ExecuteNonQuery()
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at Sitecore.Data.DataProviders.Sql.DataProviderCommand.ExecuteNonQuery()
   at Sitecore.Data.DataProviders.Sql.SqlDataApi.<>c__DisplayClass15.<Execute>b__14()
   at Sitecore.Data.DataProviders.NullRetryer.Execute[T](Func`1 action, Action recover)
   at Sitecore.Eventing.EventQueue.QueueEvent[TEvent](TEvent event, Boolean addToGlobalQueue, Boolean addToLocalQueue)
   at Sitecore.Data.Eventing.DatabaseRemoteEvents.<SubscribeLocalEvents>b__8(Object sender, ExecutedEventArgs`1 args)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Sitecore.Data.Engines.EngineCommand`2.Execute()
   at Sitecore.Data.Engines.DataEngine.SaveItem(Item item)
   at Sitecore.Data.Managers.ItemProvider.SaveItem(Item item)
   at Sitecore.Data.Items.ItemEditing.AcceptChanges(Boolean updateStatistics, Boolean silent)
   at Sitecore.Data.Items.EditContext.Dispose()
   at Sitecore.Publishing.PublishHelper.CopyToTarget(Item sourceVersion)
   at Sitecore.Publishing.PublishHelper.PublishVersionToTarget(Item sourceVersion, Item targetItem, Boolean targetCreated)
   at Sitecore.Publishing.PublishHelper.PublishVersion(Item sourceVersion)
   at Sitecore.Publishing.Pipelines.PublishItem.PerformAction.Process(PublishItemContext context)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Publishing.Pipelines.PublishItem.PublishItemPipeline.Run(PublishItemContext context)
   at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable`1 entries, PublishContext context)
   at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable`1 entries, PublishContext context)
   at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable`1 entries, PublishContext context)
   at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable`1 entries, PublishContext context)
   at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable`1 entries, PublishContext context)
   at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable`1 entries, PublishContext context)
   at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.Process(PublishContext context)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Publishing.Pipelines.Publish.PublishPipeline.Run(PublishContext context)
   at Sitecore.Publishing.Publisher.Publish()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Sitecore.Reflection.MethodInstance.Invoke()
   at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Jobs.Job.ThreadEntry(Object state)


Steps I followed:

1- Making sure you have enough disk space on a drive that your db files are stored
2- Making sure Autogrowth is set
https://support.managed.com/kb/a132/error-could-not-allocate-space-object-x-database-your-database-because-primary-filegroup-is-full.aspx
3- Truncate your EventQueue table by running the following t-sql script on core and web databases
truncate table {yourdbname}.[dbo].[EventQueue]


unfortunately, if none of above worked. Delete your web db and restore it from sitecore vanilla version and publish your master. That's what I ended up doing it :(

If you know a better solution please leave it in comments.

Sunday, 4 December 2016

Retirement of MD5 hash algorithm


Recently, one of my clients got a letter from Bendigo bank mentioning that bank would no longer support MD5 and we need to change from MD5 to SHA-256


Changing MD5 to SHA-256 is not difficult the only tricky part is how to use secure secret key to generate hash.

To generate secure hash we need to Hex Decode the Secure Secret and use it in HMACSHA256 hasher. Hex decoding is independent of the character encoding.

This the proven way that bank needs it.


Tuesday, 29 November 2016

System.Web.WebPages.BuildManagerWrapper.IsNonUpdateablePrecompiledApp Method not found

If you get the following issue

Server Error in '/' Application.

Method not found: 'Boolean System.Web.WebPages.BuildManagerWrapper.IsNonUpdateablePrecompiledApp(System.Web.Hosting.VirtualPathProvider, Microsoft.Internal.Web.Utils.IVirtualPathUtility)'.

Description: An unhandled exception occurred.

Exception Details: System.MissingMethodException: Method not found: 'Boolean System.Web.WebPages.BuildManagerWrapper.IsNonUpdateablePrecompiledApp(System.Web.Hosting.VirtualPathProvider, Microsoft.Internal.Web.Utils.IVirtualPathUtility)'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[MissingMethodException: Method not found: 'Boolean System.Web.WebPages.BuildManagerWrapper.IsNonUpdateablePrecompiledApp(System.Web.Hosting.VirtualPathProvider, Microsoft.Internal.Web.Utils.IVirtualPathUtility)'.]
   System.Web.Mvc.BuildManagerViewEngine.GetPrecompiledNonUpdateable() +0
   System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +141
   System.Web.Mvc.BuildManagerViewEngine.get_IsPrecompiledNonUpdateableSite() +136
   System.Web.Mvc.BuildManagerViewEngine.FileExists(ControllerContext controllerContext, String virtualPath) +43
   System.Web.WebPages.DefaultDisplayMode.GetDisplayInfo(HttpContextBase httpContext, String virtualPath, Func`2 virtualPathExists) +51
   System.Web.WebPages.DisplayModeProvider.GetDisplayInfoForVirtualPath(String virtualPath, HttpContextBase httpContext, Func`2 virtualPathExists, IDisplayMode currentDisplayMode, Boolean requireConsistentDisplayMode) +157
   System.Web.Mvc.VirtualPathProviderViewEngine.GetPathFromGeneralName(ControllerContext controllerContext, List`1 locations, String name, String controllerName, String areaName, String cacheKey, String[]& searchedLocations) +466
   System.Web.Mvc.VirtualPathProviderViewEngine.FindView(ControllerContext controllerContext, String viewName, String masterName, Boolean useCache) +203
   Castle.Proxies.Invocations.IViewEngine_FindView.InvokeMethodOnTarget() +274
   Castle.DynamicProxy.AbstractInvocation.Proceed() +111
   Glimpse.Core.Extensions.AlternateMethodContextExtensions.TryProceedWithTimer(IAlternateMethodContext context, TimerResult& timerResult) +64
   Glimpse.Core.Extensibility.AlternateMethod.NewImplementation(IAlternateMethodContext context) +32
   Castle.DynamicProxy.AbstractInvocation.Proceed() +448
   Castle.Proxies.IViewEngineProxy.FindView(ControllerContext controllerContext, String viewName, String masterName, Boolean useCache) +334
   System.Web.Mvc.<>c__DisplayClass6.<FindView>b__5(IViewEngine e) +45
   System.Web.Mvc.ViewEngineCollection.Find(Func`2 lookup, Boolean trackSearchedPaths) +114
   System.Web.Mvc.ViewEngineCollection.FindView(ControllerContext controllerContext, String viewName, String masterName) +242
   System.Web.Mvc.ViewResult.FindView(ControllerContext context) +118
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +143
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +90
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +710


There is a good chance that one of the following nuget packages  hasn't been updated properly.

  • Glass.Mapper.Sc.Core
  • Microsoft.AspNet.Mvc
  • Microsoft.AspNet.Razor
  • Microsoft.AspNet.WebPages

It happens when you have few projects in solution and you have forgotten to update all the projects to use same version.
the easiest way is to right click on solution and select "Manage NuGet packages for solution..." then look into consolidate tab.


resource:
http://stackoverflow.com/questions/25279024/upgrading-to-mvc-5-2-0-0-causes-exception-method-not-found-boolean-system-web

Thursday, 24 November 2016

seeing sitecore logs realtime, debugging tool

If you want to see sitecore logs in real time and you don't want to refresh and re-open the log to see new logs you can use free tool called mTAIL. mTAIL is a Windows Program that works like the Unix Command TAIL
you can download it from here
http://ophilipp.free.fr/op_tail.htm


Wednesday, 23 November 2016

It gets me every time

If you are trying to attach a db to your sql server and you are getting the following error, you need to run your management studio in administrator mode. Simply right click on Microsoft SQL Server Management Studio and select "Run as Administrator"

TITLE: Microsoft SQL Server Management Studio
------------------------------

Attach database failed for Server 'xxxxxx\sqlexpress'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=13.0.14500.10+((SSMS_Rel).160415-0249)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Unable to open the physical file "xxxxxxx\data\Sitecore.Exm.mdf". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=12.00.2269&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476


Monday, 21 November 2016

Sitecore file explorer

One of the greatest debugging tools called Sitecore file explorer has been removed from sitecore menu since version 7.5
Sitecore file explorer is accessible by browsing /sitecore/shell/default.aspx?xmlcontrol=FileExplorer





When you don't have RDP access to Sitecore servers or when you don't have access to CI/CD servers logs to see which version has been pushed to server.
You can easily browse sitecore files with file explore. The main scenario is when QA team assign a bug to you and you cannot replicate it on your local machine. It would be a good idea to download the rendering or dll and user reflector and compare it with your local code. If you know when was the last release you can check your commit history but I found comparing files on server easier to find the root cause of the potential issue.

Note:
you can update files or upload files with sitecore explorer but it's not good idea to do that because of following reasons.


  • It's against all of the best practices 
  • You might have different content delivery servers and content authoring server. Updating files on one server doesn't automatically updates other servers.
  • If you update any config file it resets sitecore app pool



resource:
http://www.newguid.net/sitecore/2015/sitecore-8-enable-developer-center-xpath-builder-file-explorer/

Thursday, 10 November 2016

How to troubleshoot Tracker.Current is not initialized error in sitecore

If you are getting the following error 

Tracker.Current is not initialized
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Tracker.Current is not initialized
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

[InvalidOperationException: Tracker.Current is not initialized]
   Sitecore.Analytics.Pipelines.StartAnalytics.StartTracking.Process(PipelineArgs args) +335
   (Object , Object[] ) +74
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, Boolean failIfNotExists) +39
   Sitecore.Analytics.Pipelines.StartAnalytics.StartAnalyticsPipeline.Run() +363
   Sitecore.Mvc.Analytics.Pipelines.MvcEvents.RequestBegin.StartTracking.Process(RequestBeginArgs args) +137
   (Object , Object[] ) +74
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +193
   Sitecore.Mvc.Routing.RouteHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +74
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +923
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157

There are few steps that you can follow to find the root cause of problem

0- Look into your sitecore logs

1- Look into Sitecore.Analytics.Model.config make sure all the custom interfaces you are defined are valid, configs might have been added on custom config file. It might be a good idea to look into /sitecore/admin/showconfig.aspx page and find all under model/elements/* and model/entities/facets/*

If you have element or facet pointing to invalid namespace you might get the above error.
You can comment out the custom ones and see if that fixes the issue. Then you can add elements and facets back one by one to find the culprit.

2-  make sure all the classes inherited from Sitecore.Analytics.Model.Framework.Facet are Serializable for more information have a read of this blog post https://mhwelander.net/2016/08/24/tracker-current-is-not-initialized/

3- Look settings of Sitecore.Analytics.Tracking.config and check how your shared state set it up.
make sure your connectionStringName is in your ConnectionStrings.config file and it's valid.

 <sharedSessionState defaultProvider="mssql">
        <providers>
          <clear/>
          <!-- To enable inProc, replace mssql provider with inProc
              <add name="InProc" type="System.Web.SessionState.InProcSessionStateStore" />
              SOPA CHANGES
          -->
          <add name="mssql"
               type="Sitecore.SessionProvider.Sql.SqlSessionStateProvider,Sitecore.SessionProvider.Sql"
               connectionStringName="sharedsession"
               pollingInterval="2"
               compression="true"
               sessionType="shared" />
        </providers>

        <manager type="Sitecore.Analytics.Tracking.SharedSessionState.SharedSessionStateManager, Sitecore.Analytics">
          <param desc="configuration" ref="tracking/sharedSessionState/config" />
        </manager>

        <config type="Sitecore.Analytics.Tracking.SharedSessionState.SharedSessionStateConfig, Sitecore.Analytics">
          <param desc="maxLockAge">5000</param>
          <!-- If an item in session state is already locked, this parameter is the time in milliseconds that the system is idle before making another attempt to apply a lock. -->
          <param desc="timeoutBetweenLockAttempts">10</param>
        </config>
      </sharedSessionState>


more read:
https://community.sitecore.net/technical_blogs/b/getting_to_know_sitecore/posts/introducing-contact-facets

Friday, 21 October 2016

Gulp webserver and live reload boilerplate


If you decided to have your site up and running without relying on iis.  Then I have a boiler plate for you.
Recently, I attended #SheHacks2016 hackathon. Every team member had different operating system. We narrowed done the tech stack that we were going to use. Also, we needed to find a neat way to host the web application. We used gulp-connect plugin to run a webserver. It worked absolutely well for us.


Why gulp?

Gulp helps to automate the repetitive tasks. It can be run on windows or mac operating systems. It also platform agnostic and has been integrated nicely into all major IDEs and can be used with PHP, .NET, Node.js, Java. Gulp is easy to learn and simple to use.

Here is the boiler plate that you can easily copy and pate and use it.


What you need to follow is


1- Download and install node.js 

2- Install gulp by running

npm install --global gulp-cli

2- Copy package.json and gulpfile.js from above gist and paste them into your root folder

3- Run npm install and node should install required packages.

npm install 

4- Run gulp , It should open a browser tab and load index.html

gulp 

5- If you start changing js or html files, gulp watch will reload the page automatically


references:

Thursday, 20 October 2016

How to have responsive hamburger menu and brand logo with boot strap v4 alpha

If you look into nav bar documentations of boot strap 4 you will notice the responsive  nav bar with hamburger menu like we used to have in boot strap 3 is missing.

The nav bars in version 4 are having different UX. In my opinion, there are so many sites based on boot strap 3 navbar and people get used to the way it is working. 
I personally would  prefer to stick with what people are used to than introducing new way of nav bar.


Here is the sample that you need to follow