C# MVC project, adding a service reference E_INVALIDARG

Hello.

When trying to add a service reference I receive the following error:

"The configuration for the service reference could not be added due to the following issue: An error occurred creating the configuration section handler for system.serviceModel/bindings: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) (C:\....\web.config line 154)"

But, looking in web.config I am not seeing the problem.

Thanks. :)
LVL 1
Adam DIT Solutions DeveloperAsked:
Who is Participating?

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

x
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.

Miguel OzSoftware EngineerCommented:
Sometimes serviceModel section is in the way of your reference updating the web.config.  Please try:
1. Remove all  temporary framework files for your project and also your bin and obj folders
2. Backup your web.config to a save location.
3. Build project
4. At project  web.config: Remove system.serviceModel section and save the web.config without the service model section.
5. Add service reference.
6. From your backup pasted the service model section back to project web.config,. (if your service reference change it make sure you merge contents)
7. Build and run project.
0

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
Adam DIT Solutions DeveloperAuthor Commented:
Thanks for the help Miguel.  Deleting the entire servicemodel section allowed the new reference to be created and the error to be found.
0
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
.NET MVC

From novice to tech pro — start learning today.