Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`System.Net.Mail.SmtpClient' is obsolete #254

Closed
mans0954 opened this issue Apr 22, 2017 · 2 comments
Closed

`System.Net.Mail.SmtpClient' is obsolete #254

mans0954 opened this issue Apr 22, 2017 · 2 comments
Milestone

Comments

@mans0954
Copy link

Hello,

I'm trying to build with mono 4.6.2 on Debian, by running the command:

xbuild /p:Configuration=NET45-Release /t:RunAllTests buildscripts/Build.proj

This fails with

Build FAILED.
Errors:

/home/mans0954/2017/Core-4.0.0/buildscripts/Build.proj (RunAllTests) ->
(BuildProject target) ->
/home/mans0954/2017/Core-4.0.0/Castle.Core.sln (Build) ->
(Build target) ->
/home/mans0954/2017/Core-4.0.0/src/Castle.Core/Castle.Core.csproj (default targets) ->
/usr/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile target) ->

	Core/Smtp/DefaultSmtpSender.cs(233,47): error CS0618: Warning as Error: `System.Net.Mail.SmtpClient' is obsolete: `SmtpClient and its network of types are poorly designed, we strongly recommend you use https://github.com/jstedfast/MailKit and https://github.com/jstedfast/MimeKit instead'
	Core/Smtp/DefaultSmtpSender.cs(267,11): error CS0618: Warning as Error: `System.Net.Mail.SmtpClient' is obsolete: `SmtpClient and its network of types are poorly designed, we strongly recommend you use https://github.com/jstedfast/MailKit and https://github.com/jstedfast/MimeKit instead'
	Core/Smtp/DefaultSmtpSender.cs(159,5): error CS0618: Warning as Error: `System.Net.Mail.SmtpClient' is obsolete: `SmtpClient and its network of types are poorly designed, we strongly recommend you use https://github.com/jstedfast/MailKit and https://github.com/jstedfast/MimeKit instead'
	Core/Smtp/DefaultSmtpSender.cs(176,6): error CS0618: Warning as Error: `System.Net.Mail.SmtpClient' is obsolete: `SmtpClient and its network of types are poorly designed, we strongly recommend you use https://github.com/jstedfast/MailKit and https://github.com/jstedfast/MimeKit instead'
	Core/Smtp/DefaultSmtpSender.cs(272,16): error CS0618: Warning as Error: `System.Net.Mail.SmtpClient' is obsolete: `SmtpClient and its network of types are poorly designed, we strongly recommend you use https://github.com/jstedfast/MailKit and https://github.com/jstedfast/MimeKit instead'
	Core/Smtp/DefaultSmtpSender.cs(276,25): error CS0618: Warning as Error: `System.Net.Mail.SmtpClient' is obsolete: `SmtpClient and its network of types are poorly designed, we strongly recommend you use https://github.com/jstedfast/MailKit and https://github.com/jstedfast/MimeKit instead'

	 0 Warning(s)
	 6 Error(s)
@jonorossi
Copy link
Member

Our build server has Mono 4.6.1 so I'm not sure why that warning isn't being emitted there. It looks like the Mono team added the ObsoleteAttribute to SmtpClient in Mono 4.3.2: mono/mono@fa081c5.

Happy to take a pull request to wrap DefaultSmtpSender with #pragma warning disable/restore 618, just add a comment before the disable stating that it is for Mono.

Would be great to know why our build server isn't failing at the moment though as it is running the exact same xbuild command.

@jonorossi
Copy link
Member

@mans0954 strangely I couldn't reproduce this on Mono 4.6.1 but I've added (#271) the pragmas because I suspect we'll get these soon enough when we upgrade.

@jonorossi jonorossi added this to the v4.1 milestone Jun 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants