Article ID: 2709082 - View products that this article applies to.
After moving the System Center 2012 Configuration Manager SQL Site Database to another drive, creating a new Software Update group, Software Update package, or creating a new application fails and errors similar to the following are logged in the SMSProv.log file:
An error occurred in the Microsoft .NET Framework while trying to load assembly id 65539. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error:
System.IO.FileLoadException: Could not load file or assembly 'cryptoutility, Version=126.96.36.199, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. An error relating to security occurred. (Exception from HRESULT: 0x8013150A)
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
This can occur if the SQL Site Database MDF and LDF files are moved to a different drive. For example, if originally the Configuration Manager Site Database was created on C:\Program files\MSSQL server\data but then later the MDF and LDF files were moved to different drive to save space (e.g. D:\CM2012DB), you may see the issue above.
Note that this is a supported SQL operation. For more information see the following:
How to move SQL Server databases to a new location by using Detach and Attach functions in SQL Server - http://support.microsoft.com/kb/224071
This occurs with System Center 2012 Configuration Manager because by default, the SQL Site Database has the SQL TRUSTWORTHY property set to ON, however when you detach and reattach the database it gets set to OFF. When the database is not configured with this setting ON, <ConfigMgr_Install>\bin\x64\CryptoUtility.dll fails to load into SQL and you get an 'invalid cursor state' message.
To resolve this issue complete the following steps:
1. Manually set the property back to ON by running the following command against your CM database:
ALTER DATABASE <ConfigMgr DB> SET TRUSTWORTHY ON
2. Ensure that the database that was moved is owned by SA.
3. Ensure that Isolation Level is set to 'READ_COMMITTED_SNAPSHOT'
- To check the Isolation Level run 'DBCC USEROPTIONS'
- If it is set to anything else then 'READ COMMITTED SNAPSHOT', please run following commands:
ALTER DATABASE <ConfigMgr DB>
ALTER DATABASE <ConfigMgr DB>
Note: You might have to switch the SQL DB to Single User mode before running the two commands in previous step. Once done, please change it back to Multi User mode.
Also make sure that all properties are set correctly under Database Properties - Options