SmtpClient and app.config system.net configuration

孤者浪人 提交于 2019-12-03 12:11:29
Davide Piras

Make sure you add your configuration block (as shown above) to the {appName}.exe.config or web.config - the configuration for the class library is taken from one of those files at runtime, not from the app.config of the class library.

mamoo

I've just realized I'm definitely doing it the wrong way (there's also a similar post from John about it and the solution is there...).

The mailsettings is available only at the application level, so the test project should know about your settings to take them into account.

Thanks to John and Davide for pointing me to the right direction!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!