If a man feels a slight, remote attraction to members of the same sex, but in practice successfully controls himself, does he need to tell someone he is dating about his inclination? If he is certain that he desires and wishes to marry a woman, that he will be able to be happy with his wife, that he will be able to give her the pleasure that she deserves, and that he will be able to remain faithful, then he is not obligated to tell her.
However, if his homosexual inclination is strong enough that he is uncertain that he will be able to give his wife pleasure, and even more so if he is uncertain that he will be able to stay faithful, he must disclose this to the woman he is dating. Then she can decide whether or not she trusts him to be able to lovingly and happily build a faithful home with her.
In every case of uncertainty, a rabbi or a God-fearing specialist should be consulted. All of the above applies equally to a woman who experiences same-sex attraction.
If a man who is a practicing homosexual marries without telling his wife about it, and when she finds out, she immediately wants to end the marriage, then in certain cases, if it is difficult to extract a get from the husband, a rabbinical court can annul the marriage without a get. This is because the marriage was entered into under false pretenses (mekaḥ ta’ut), and thus was never valid (Igrot Moshe, EH 4:113).