Error when running console app

See image.   I get this error when running a console app, both in VS and from the command line.  Anyone ever see this?   Just a few days ago this was running OK.   I have since downloaded the 2010 Web Deployment tools and Azure publish tools, but decided not to use them and uninstalled from the system.  

I do not even get to the first line of code, Sub Main, using VB with breakpoint.

Any thoughts?

inner exception
Console App error
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lokesh B RDeveloperCommented:

Can you show the Error Line Code?
Bob LearnedCommented:
With TypeInitializationException, you need to see the inner exception.  There is a View Detail button on the exception window, that you can use to see the InnerException value.

Sounds like a bug was introduced...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HLRosenbergerAuthor Commented:
See image.  it does show the inner exception.

There is no line of code of my code, as far as I can tell.  If I put a break point right at Sub Main, it never gets there.
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Lokesh B RDeveloperCommented:

Try to build your console application and see where is the ERROR.
Looks like you are trying to typecast XmlComment to XmlElement.  That type cast is not valid.

Try casting it to XmlNode instead
Bob LearnedCommented:
Does this exception happen with just this one application, or all of them?
HLRosenbergerAuthor Commented:
I'm not casting anything.  In VS, I do not even it the first line of code, Sub Main.  

A build works fine; only get the error when running.

I believe something I downloaded and installed cause this, one of the deployment/Publish tools.
HLRosenbergerAuthor Commented:
This turns to be my own issue - sort of.   this console app also uses a DLL I had written.  

In the DLL code, I use XML objects to read in the "connectionString" section of a web.config file.  I had just commented out some no longer used connection strings.   Now, I would have never guessed that a comment would be returned to me, but that's exactly what is happening.   I'm looping through all the XMLElements in the "connectionString" section, and it's returning the comments to me.  And when it hits a comment, that's not an XMLElement, so it throws an exception (see second image), because I'm expecting an datatype of XMLElement.
HLRosenbergerAuthor Commented:
All your comments help me narrow this down.  thanks.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.