SQL Server 2016 - Database Mail doesn't work without .NET 3.5 - by Tomasz Libera

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


15
0
Sign in
to vote
ID 2900323 Comments
Status Closed Workarounds
Type Bug Repros 5
Opened 7/6/2016 9:17:46 AM
Access Restriction Public

Description

SQL Server 2016 - Database Mail doesn't work without .NET 3.5

In installed SQL Server Standard on Windows Server 2012 R2 (VM Ware 5.5 virtual machine). 
Installed features:
- DB engine
- SQL Server Replication. 

After creating all my jobs and alerts I realized that Database Mail (properly configured) doesn't work. I checked everything... a lot of times...
Messages still remained in "unsent" status.
Database Mail Log empty.

EXEC msdb.dbo.sysmail_help_queue_sp @queue_type = 'mail';
queue_type	length	state
mail	295	RECEIVES_OCCURRING

Finally I decided to install SQL Server 2014, during setup it asked me to install .NET Framework 3.5. After I added required roles in Server Manage (before installing  SQL Server 2014), I checked Database Mail - it works..ów)
Sign in to post a comment.
Posted by Microsoft on 6/19/2017 at 12:37 PM
@rseiler: let me clarify a bit:
"SQL2016 SP1 + CU2" really means "Install SQL2016 SP1 Slipstream, then apply CU2"
Your scenario ("2016->SP1->CU2") is different, as it install SP1 on top of SQL2016 RTM, and as such it exposes the isssue (which needs to be worked around).

Please, let me know if that was not the case.

Thanks,
-Matteo
Posted by rseiler on 5/22/2017 at 4:00 PM
There's a helpful KB about this for anyone needing it:
https://support.microsoft.com/en-us/help/3186435/fix-sql-server-2016-database-mail-does-not-work-on-a-computer-that-does-not-have-the-.net-framework-3.5-installed

I think one aspect of it is wrong though: "If you install SQL Server 2016 SP1 + CU2, the Database Mail will not be impacted by the setup." That can't be true, since we took the 2016->SP1->CU2 path (given that this is a new install), and we still had the issue. There was never a CU1 involved.

Creating the DatabaseMail.exe.config mentioned though resolved it--WITHOUT doing a repair or installing .Net 3.5 (I don't know why those last two steps would be necessary for anyone on CU2).
Posted by MS BI Guy on 4/3/2017 at 2:50 PM
Sorry please excuse me! I found an error in my databasemail.exe.config file. My apologies.
Posted by MS BI Guy on 4/3/2017 at 2:43 PM
Hi guys I am on CU2 - Microsoft SQL Server 2016 (SP1-CU2) (KB4013106) - 13.0.4422.0 (X64) and I can confirm this is STILL an issue. I get the following error in the event logs.

1) Exception Information
===================
Exception Type: System.TypeInitializationException
TypeName: System.Data.SqlClient.SqlConnection
Message: The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception.
Data: System.Collections.ListDictionaryInternal
TargetSite: Void .ctor()
HelpLink: NULL
Source: System.Data
HResult: -2146233036

StackTrace Information
===================
at System.Data.SqlClient.SqlConnection..ctor()
at System.Data.SqlClient.SqlConnection..ctor(String connectionString, SqlCredential credential)
at Microsoft.SqlServer.Management.Common.SqlConnectionInfo.CreateConnectionObject()
at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.ConnectionManager.OpenConnection(SqlConnectionInfo connectionInfo)
at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.QueueItemProcesser.ProcessQueueItems(String dbName, String dbServerName, Int32 lifetimeMinimumSec, LogLevel loggingLevel, Byte[] encryptionKey, Int32 connectionTimeout)

Posted by Newfangled Old-fashioned Stuff on 3/24/2017 at 10:47 PM
This is STILL NOT FIXED in SQL 2016 SP1 CU2 (Build 4422), at least when upgrading from Build 4411, including a reboot after.

There were quite a few GUI popups about "unable to install .NET 3.5", as normally an "alternate source path" has to be supplied - mount the ISO and then point it at CDROM:\Sources\sxs, for instance.

Installed .NET 3.5 with an alternate source path that went to the right Windows Server ISO and suddenly the existing SQL 2016 SP1 CU2 Build 4422 started sending new emails.

Microsoft, automatically triggering an installation of .NET 3.5 is NOT an answer, even if it worked, which in most cases it DOES NOT. The only correct answer is to require the SAME version of .NET that the rest of SQL Server requires.
Posted by Piquet de Noo on 2/27/2017 at 5:41 PM
As per Newfangled comment I can confirm this issue is still present for "Microsoft SQL Server 2016 (SP1-CU1) (KB3208177) - 13.0.4411.0 (X64) Jan 6 2017 14:24:37" on Windows Server 2016.
Installing .Net Framework 3.5 resolved the issue (i.e. DatabaseMail now works), but .Net Framework 3.5 is not in the pre-requisite checks during installation or DBMail configuration.
Posted by Newfangled Old-fashioned Stuff on 1/27/2017 at 11:30 PM
Either this is NOT fixed on SQL 2016 SP1 CU 1 (Build 4411), OR it was fixed by the huge error message that shows up when you try to run DatabaseMail.exe from the command line and it says
The following feature couldn't be installed:
.NET Framework 3.5 (includes .NET 2.0 and 3.0)
Posted by Microsoft on 9/28/2016 at 8:56 AM
Hi Tomasz,
Yes, we are aware of this issue in SQL 2016 - it has been reported a few times already.

The fix for this issue is included in SQL2016 CU2 (and later) and will be rolled into a future SP, as usual.

Here's the link to the CU2 KB: https://support.microsoft.com/en-us/kb/3182270

Note: I need to talk to the documentation folks and find out why this fix is not listed on that page. I'll try to have that updated to avoid confusion.

Thanks,
-Matteo
Posted by Lin Leng on 7/19/2016 at 8:25 PM
similar thread here:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/10d759dc-9e68-4083-b23c-a29766444766/2016-database-mail-stuck-in-inactive?forum=sqlsetupandupgrade

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/feef4d67-afa1-468a-9ba7-ea3477edaf8e/db-mail-not-working-sql-2016?forum=sqlservicebroker