Skip to end of metadata
Go to start of metadata

The following article is in the process of being transferred

After applying a Microsoft .NET security update, Synergetic Windows application reports "Error updating database" and/or "Photo may be corrupted" when attempting to import photos through System > Photo Maintenance.

Error Messages:

Any of the below error messages can relate to the .NET issue, you may also receive a different variation of the same error, but if it mentions corrupted photos or a .NET Framework error it is highly likely that it is the same issue. 


How To Resolve:

After the .NETupdate has been applied, the Synergetic CLR binaries need to be re-created. The attached script will resolve the issue, this can be run by Synergetic support or someone from the school's IT department.

USE SynergyOne
GO
DECLARE @ProductVersion INT = CONVERT (INT, LEFT(CONVERT (VARCHAR(10), SERVERPROPERTY('productversion')), 2))
DECLARE @LoadFrom NVARCHAR (200),
  @Is64Bit BIT = 0
  
IF CHARINDEX('64-bit', convert (varchar(50), SERVERPROPERTY('edition')),  0) > 0
  SET @Is64Bit = 1
IF (@Is64Bit = 0)
  RAISERROR('Server is not 64 bit, contact systems team or developers for assistance', 16, 1)
ELSE
BEGIN
--If SQL 2008 or SQL 2008 R2
	IF @ProductVersion >= 10 and @ProductVersion < 11
	BEGIN
	  SET @LoadFrom = N'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\System.Drawing.dll'
	END
	ELSE IF @ProductVersion >= 11
	BEGIN
	  SET @LoadFrom = 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Drawing.dll'
	END
	BEGIN TRY
	  ALTER ASSEMBLY [System.Drawing] FROM @LoadFrom
	  WITH PERMISSION_SET = UNSAFE
	END TRY
	BEGIN CATCH
		PRINT ERROR_MESSAGE()
	END CATCH
END
GO

Photo Maint .NET Fix.sql