The two major candidates in Virginia’s 10th Congressional District faced each other for the first time Wednesday in a debate that served as Round 1 in a bitter contest to replace retiring Rep. Frank R. Wolf (R).

During a town-hall forum in Herndon, Republican Barbara J. Comstock and Democrat John W. Foust talked about traffic congestion in Northern Virginia, the federal deficit and whether more should be done to outsource government jobs as a way to bolster the regional economy.

The event, attended by about 175 people at the offices of Dominion Virginia Power, was geared toward business concerns in a district dominated by high-tech companies and federal contractors.

The candidates mostly stuck to their campaign scripts, questioning each other’s ability to serve in Congress and playing up their backgrounds. Comstock argued that her experience as a state delegate makes her a natural successor to Wolf, and Foust touted himself as an even-keeled Fairfax County supervisor who has long worked on problems important to Northern Virginia.

Libertarian Bill Redpath, Green Party candidate Dianne L. Blais and independent Brad A. Eickholt were not invited to the event, which was sponsored by the Northern Virginia Technology Council and the Fairfax County and Prince William County chambers of commerce.

Comstock and Foust continued the attacks they have waged through campaign ads and surrogates, accusing each other of extreme partisanship and of being on the wrong side of bellwether issues such as energy independence, climate change and abortion.

“We cannot afford to continue this war on a women’s right to make her own health-care decisions,” Foust, who represents the Dranesville District on the Fairfax County Board, said in a reference to Comstock’s support of a state bill that, before it was amended, would have required most women seeking an abortion to undergo a transvaginal ultrasound.

Comstock, whose delegate district encompasses a wealthy swath of McLean and Great Falls along the Potomac River as well as a piece of Loudoun County, countered with jabs at Foust over a remark he made last month about her not having “a real job.” Comstock also argued that she has a record of bipartisan legislation.

“I have worked on building these coalitions and, you see, my opponent wants to continue to divide and attack,” Comstock said, adding that her desire to see Roe v. Wade overturned would not come into play in Congress. “I’m not running for the Supreme Court — I’m running to be your congressman.”

The crowd of mostly business executives listened more attentively to answers the candidates gave on issues that would affect their bottom line, such as how to make Northern Virginia an even larger hub for data technology and where best to spend on local infrastructure.

Toune Greene, a director of finance at the ITT Technical Institute, said she liked Foust’s answers on education spending, even though her Chantilly-based company has in the past preferred Republican candidates.

“I agree with him that an increase in education spending will help the economy, especially in the technology field,” she said.

“He kept talking about coming back to a balanced budget,” Greene said. “I liked his realistic approach.”

Craig Parisot, a board member with the Volunteer Fairfax philanthropy group, said he was drawn to Comstock’s knowledge of various topics, including cybersecurity and energy independence.

“She just shows command of the issues,” he said. “But it’s tough for both of them to get up on stage, so I’ll give them both credit for doing that.”