Sometimes your InfoPath form which was compiled successfully might give an error after publishing, about incorrectly specifying Description Attribute, so here is what to do…

ERROR:

Form template:
InfoPath cannot open the selected form because of an error in the form's code.
The class that contains event handlers for this form cannot be identified in the form's code. Confirm that the InfoPathStartupClass is specified correctly for the DescriptionAttribute attribute of the assembly.

Resolution:

Please check the namespace and class name you are using are right or not in line of FormCode.cs(When you are using c#/InfoPath) which says

[assembly:System.ComponentModel.DescriptionAttribute("InfoPathStartupClass, Version=1.0, Class=MyNamespace.HelloClass")]

and just change the name to correct one