0

A constraint for my c# project is to send emails by using the obsolete System.Web.Mail. A tooltip in VS warns me that I should use System.Net.Mail, but I cannot. I expect that, in the (near?) future, System.Web.Mail will be deprecated.

My question is: is there a way to keep using it, even when deprecated? Isolating System.Web.dll, adding a reference to it and deploying the project with that file (as I do nowadays) will also work after deprecation?

I think that it will NOT work after deprecation, but I am not sure, because I have not found any documentation about this scenario...

dymanoid
  • 14,771
  • 4
  • 36
  • 64
AdrianS
  • 63
  • 5
  • I guess deprecated stuff are removed as part of a framework patch/update. So your Production code may stop working when the Server Admin decides to install some patch some fine day and that happens to be the one containing the change. – Prateek Shrivastava Oct 15 '18 at 09:29
  • 3
    You take each item that is currently acting as a block to moving to using `System.Net.Mail` instead and find the political/people/technical means to overcome it. – Damien_The_Unbeliever Oct 15 '18 at 09:31
  • Please note that a deprecated assembly could also have references to other (possibly deprecated) assemblies or to specific versions or use deprecated APIs. Just deploying a deprecated assembly doesn't guarantee that it will work. – dymanoid Oct 15 '18 at 09:33

1 Answers1

0

Deprecated (or Obsolete, which is the same in .NET) simply means that it is no longer developed or supported - not that it stopped working. You can still use deprecated libraries. As long as you stay on the same Framework version, it'll still be there. That can't be guaranteed for future versions of the framework, but it might still be there; check before you upgrade. Even then, test first: it might be that System.Web.Mail depends on something that did get removed, and stops working for that reason.

However, it's strongly suggested that you find a way to move to System.Net.Mail after all, although this may be more of a political than technical problem.

Bas
  • 1,946
  • 21
  • 38
  • Thank you all for your time! Now my view is clearer: I will test my project on the latest versions of the framework and, when it stops working for some reasons, I will evaluate if I should stay on the last working framework or find an alternative. You are right, at the moment the problem is only political and it can't be overcome by supplying technical alternatives. As you know, political problems are longer to solve than technical ones... – AdrianS Oct 15 '18 at 12:38