I recently installed a .NET security update on one of our database servers. Now, when I try to query this database, I get the following error:
System.IO.FileLoadException: Could not load file or assembly 'System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Assembly in host store has a different signature than assembly in GAC
Per various Google results, Stack Overflow responses, and Microsoft's documentation , we tried running the following command:
ALTER ASSEMBLY [System.IO.FileLoadException] FROM 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.IO.Compression.dll'
But receive the following error:
Cannot alter the assembly 'System.IO.FileLoadException', because it does not exist or you do not have permission.
The file in question does exist, and I am logged in as a domain admin and am using the DB's 'sa' credentials which should have full privileges, so also not sure how it could be a permission issue.
(Also tried just restarting the server, which didn't fix anything.)
2条答案
按热度按时间pbgvytdp1#
You need to load the new version of any .NET Framework assemblies you have loaded into the database after the update.
Note this is why loading extra .NET Framework assemblies for use in SQLCLR is a bad idea.
sr4lhrrt2#
FileLoadException
is the error. The actual assembly that errored isSystem.DirectoryServices
, this is probably because it is a dependency of something else, and the strong name (public key token) has changed.And you need
CREATE
notALTER
. You may need to drop the existing one first.