Tuesday, 1 August 2017

How to kill a process running on particular port in windows?

If you use restify in node js you might have encountered the following error.

in the VS Code terminal, if you run the node command and then close the terminal and try to run the app in another terminal you definitely will get an error saying the port is still open like following.
in my case, I'm using bot framework and I'm using the default port which is 3978. Yours can be a different port



Error: listen EADDRINUSE :::3978
    at Object.exports._errnoException (util.js:1018:11)
    at exports._exceptionWithHostPort (util.js:1041:20)
    at Server._listen2 (net.js:1258:14)
    at listen (net.js:1294:10)
    at Server.listen (net.js:1390:5)
    at Server.listen
    at App.run
    at Object.<anonymous>
    at Module._compile
    at Object.Module._extensions..js

The easiest way is to find the process id of the app, which is using the port by running following command line

netstat -ano |find /i "3978"

you will get something similar to following

 TCP    0.0.0.0:3978           0.0.0.0:0              LISTENING       2208
 TCP    [::]:3978                 [::]:0                    LISTENING       2208

after finding the process Id which in my case is 2208, you can run the following command

Taskkill /PID 2208 /F

If things go successfully you will get the following message
SUCCESS: The process with PID 2208 has been terminated.





Wednesday, 22 February 2017

New to sitecore? how to learn sitecore?



I have been asked few times, how to learn Sitecore and what are good references?

Theses are the approaches I recommend:

1- If you are absolutely new to Sitecore, ask your colleagues to show you Sitecore dashboard and Sitecore in general. Try to understand it from content editors perspective. You need to fully understand how your end users will use Sitecore to be able to design and implement new features for Sitecore.

2- Install Sitecore Habitat on your local computer as your reference and read through the Helix documentations

3- Register for Sitecore training course on http://www.sitecore.net/en/services-and-support/training/classroom-training.

4- Sitecore has e-learning site which has free course for developers. You definitely can benefit from it.

5- You can read through Sitecore documentations based on the subject or module that you are interested to know more about it.

6- Sitecore Stack Exchange is the place you can ask your question and seek for help

7- There is Slack channel to meet other Sitecore devs and exchange knowledge

8- There is a facebook user group page  which you can see latest blog posts related to Sitecore

9- Don't forget to attend Sitecore user group meetups in your Area, I'm helping with Sydney Sitecore meetup and will be absolutely happy to see you there. I have a blog post which I explained in details the benefits of attending the meetup.

10- Follow and read Sitecore experts blog posts. The blog post might not be related to you now but sooner or later you will encounter the same issue ;)!

11- Reverse engineering is another fun way to learn which I highly recommend it. Install ReSharper dotPeek or any other decompiler tool that you are comfortable with. Start looking into the Sitecore code and try to get inspired.

12- There are few Sitecore books that you can buy and read them.

13- Sitecore youtube video channel another way of learning sitecore.


 

Monday, 20 February 2017

Ignite 2017 take-outs



As you all saw my schedule for this year in my previous post. It was a full-on schedule and I only could manage to attend around 70% of the sessions. I’m very happy with all the sessions I could attend and also it was great that I found a chance to catch up with other attendees.

In the nutshell, this is my take-outs from Microsoft Ignite 2017

  • Operating system agnostics
    I remember working on the projects that we had to manually integrate front-end codes written by our team on their mac OS into our MVC solution written in the Visual studio on windows.
    Microsoft has provided tools like VsCode (https://code.visualstudio.com/) also make it possible to install Visual studio on Mac. It increases productivity in the team.
    Also, Microsoft is on its path to enable all the developers to work on their desired Operating system write code which runs on any Operating system.
  • Open source and Microsoft
    Microsoft has the biggest contribution to open source projects on GitHub (http://www.businessinsider.com.au/microsoft-github-open-source-2016-9?r=US&IR=T).
  • Machine learning, Artificial intelligence (AI), Bots, Cognitive services
    These are the areas Microsoft focuses on it. By the power of cloud computing, we can solve the new type of problems that we weren't able to solve them before.   Now, you can easily analyse the text and get the main keywords or understand the emotion of the person who wrote it. Imagine you can analyse all of your tweets written to your company and find the services everyone are happy about it or not so impressed with it in the matter of few minutes.
  •  Azure Stack, cloud ready
    Microsoft tries to provide an infrastructure you can install on your local servers (on premises). It provides all the services that Azure portal provides. The benefits of using azure stack are when you get to the point that you could move your servers to the cloud you can have a smooth transition.
  • Microservices, Docker & windows
    Although Docker on Linux is more mature but Docker on windows is rapidly improving.
  • Blockchain and Ethereum
    New reliable digital currency and a new way of management of it are under way. Some early adopter like webjet has started working with Microsoft.


Watch the sessions now:

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/