Has anyone been able to use the .NET provider model with a winforms app?
-
06-09-2019 - |
Question
I've seen oodles of examples for ASP.NET, but none for winforms. In other words, using the app.config instead of web.config. It would be a shame if it did not work.
Solution
It works exactly the same. The base provider model is part of System.Configuration, which abstracts (provider!) whether the application is configured via app.config or web.config.
OTHER TIPS
Read about Client Application Services if you want to use ASP.NET providers in your Windows apps.
If you wish to use the Provider Pattern in a Windows app, this can also be done. I once did this to allow configuration between a real scanner and a fake one (yes I know I could of used an IOC container).
CodeProject probably has several provider tutorials- here is one: link text