I created a visual web part inside my VS2012 solution. Every time I saved the ascx file I had to wait for a few seconds as my VS was 'Communicating with SharePoint'.
If you are the type of person who has an addiction of hitting 'Ctrl + S' after modifying a few lines of code then you will find this annoying.
Then I tried to switch my solution to 'Offline' to avoid this. I wrote my code and when I did a build it throws me this error.
After further investigation it seems that my ascx.g.cs file disappeared.
Now I know why it was 'Communicating with SharePoint' every time I saved the file. It's generating the g.cs file that has the InitializeControl function.
So to get it back working, I just switched to online mode, then re-saved my ascx file and voila! my g.cs shows up again.
Interested to see if other people have any ideas to make this faster process.