First of all, this is something that shouldn’t really happen, in my case the VMs that we were developing on were very slow due to some hardware problems. However it’s possible when you have features that need to do a lot of work during activation for these features to exceed the 2 minutes activation limit.
One of my features created a list with about 200 items during activation of a feature. the activation of this feature exceeded 120 seconds (this is the default value of the timeout setting within Visual Studio).
Within the output window I got the following message:
Error occurred in deployment step ‘Activate Features’: A timeout has occurred while invoking commands in SharePoint host process.
I noticed that about 100 items were created in my list and when I checked again a while later all items were there, so things weren’t actually failing at all.
So how can you increase this timeout?
In the loccal registry within the following key:
there is a setting ( this doesn’t exist by default):
Add the above as a DWord and set it to something higher than 120. After chnaging the registry you will need to restart Visual Studio and things should deploy without any problem.