SheNotHe,
I feel this point, which has been alluded to in previous responses, is critically important, and I haven't seen it summarized in a way that I'm sure makes the point crystal clear:
1. There are various reasons your wife may have been unhappy in your marriage. If we were able to objectively analyze all of the factors that contributed to her unhappiness, and with perfect accuracy determine how much 'fault' for each of those factors belonged to her, and to you, and to external forces, we don't have any idea what results we would get. Maybe she's responsible for 25%, you're responsible for 50%, and her AP is responsible for 25%. Maybe she's responsible for 20%, you're responsible for 20%, and coworkers/friends are responsible for 60%. Maybe you're responsible for 90% and she's responsible for 10%. We just don't know. The important thing to realize is that yes, you're most likely responsible for at least some of the reason she's unhappy with the marriage-- and it's also quite likely that she's responsible for some of that unhappiness itself.
2. Then there is how she chose to respond to being unhappy in the marriage. She had a lot of choices. She could have relentlessly tried to get you to work on things. She could have divorced you. She could have given you an ultimatum to improve things by a certain date or else she would divorce you. She could have self-medicated to numb herself to the unhappiness using drugs or alcohol. She could have dedicated herself to finding new sources of happiness and meaning in her life, and then re-evaluated how unhappy she was after that. She could have had a purely emotional affair, or a purely sexual affair, or a regular affair. The point is, given that she was unhappy with the marriage, she chose, unilaterally, what to do about that unhappiness, and having an affair was by no means the only option she had available. Many, many people who are unhappy in marriages choose different options, rather than having affairs. Unlike when we examined the fact that she was unhappy in the marriage, her reaction to being unhappy is 100% her responsibility. Zero of the responsibility for her decision lies on you, or her parents, or her friends, or society. She had a lot of options, and this is the one she chose, and she chose it without consulting with you or informing you.
The reason I single out this concept as being so crucial is because you've said you're going to give marriage counseling/therapy a try, and unfortunately there are a lot of bad marriage counselors in the world. I don't mean 'bad' in the sense that I happen to disagree with them; I mean objectively bad, in that their success rate with obtaining good outcomes (whether that be a truly healthy, sustainable reconciliation or a reasonably amicable divorce) is low, and they don't follow any of the accepted models taught in graduate school. Many of these counselors will not distinguish between what led to the state of the marriage-- for which you need to be willing to shoulder some of the blame, conceivably in some cases even most of the blame-- and the fact that your wife had an affair, for which you should not tolerate being assigned any portion of the blame for even a single second. This is vitally important. It gives you the best chance of succeeding, because it allows your wife to talk about how she wants you to behave differently, or why she's upset with something about you, and for you to acknowledge those points and constructively talk about what changes need to be made, within the proper context of making her happier within the marriage. At the same time, it allows you to express your heartbreak, your insecurity, your sense of betrayal, your difficulty regaining trust, etc., without being asked to share any portion of the blame, while she needs to acknowledge that all of that damage is 100% on her shoulders, and that therefore she needs to be the one putting in a ton of work to hep repair things, she needs to be willing to patiently accept the many episodes of insecurity or pain that will come out of nowhere over the next few years, etc.
When you don't clearly distinguish between the cause of unhappiness and the reaction to that unhappiness, therapy becomes a true mess, people's defenses kick in and they deflect or defend by bringing up events or patterns that are not relevant to what's currently being discussed (e.g. bringing up something you did that caused her to be unhappy, when the topic at the time is you finding it difficult to regain trust as the result of all the lying she did to cover up her affair). More insidiously, unless she's forced to acknowledge that she's 100% responsible for having the affair, she's given an out to take less responsibility for repairing the damage of the affair.
Finally, I'm going to offer an opinion. I want you to understand that I'm not an expert, I have no qualifications in this field; I've participated in a couple of infidelity communities since 2015, but that hardly makes me an authority. In any event, my opinion is that you are a candidate for reconciliation. I know a number of respected members of this community will either entirely or mostly disagree with me, but I believe that I've seen a trend over the last five years or so of marriages that have lasted a long time, where one of the spouses winds up in contact with a past crush or partner due to social media, and winds up having an affair; yet, with the right work, and avoiding rug-sweeping, the length of the marriage and the roots that have been put down are strong enough, and give enough reasons to rebuild trust (which is usually the hardest part), that the marriage winds up surviving. I don't know what percentage of the time that is, but I do feel there's something about the unique combination of a long-duration relationship, and getting together with the affair partner due to the utter ease of finding one another and communicating secretly over the internet (which lowers the bar for how much effort the cheater needs to put in to deceive their spouse), that makes the chances of recovery higher than we normally think they are when we find out that someone had a six month affair. I am NOT urging you to reconcile; I'm just giving you an opinion that I think it wouldn't be stupid or naive of you to try, as long as she's doing the right things and you're making progress, if that's what you decide to do.
Good luck!