I can not create some assemblies at the same time

Zing Cui 0 Reputation points

I tried to create some assemblies with system dlls, such as: System.Threading.dll, System.Runtime.dll, System.Runtime.extension.dll.

When I try to create assemblies in one script, the first assembly will be created successfully, but then the sqlserver service will stop, and rest of the script will be stoped by the crashed service.

But when I create assembly one by one with restart the sql server service, the service will not stop.

Actually, I can create these assemblies directly with script 3 weeks ago, and this issue happened suddenly in my machine. I tried reinstall the sqlserver, restart the machine, all are not working.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,264 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 105.9K Reputation points MVP

    After modifying your script, I was able to load the assemblies:

    declare @SystemThreading nvarchar(150)
    declare @netFrameworkPath nvarchar(150)
    select @netFrameworkPath = (select LTRIM(RTRIM([value])) from sys.dm_clr_properties where name = 'directory')
    set @SystemThreading = substring(@netFrameworkPath, 1, len(@netFrameworkPath) - 1) + 'System.Threading.dll'
    Create Assembly "System.Threading" from @SystemThreading

    However, I note that I got this message:

    Warning: The Microsoft .NET Framework assembly 'system.threading, version=, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.

    As for why if fails in your case, this could be the reason:

    Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64) Sep 24 2019 13:48:23 Copyright (C) 2019 Microsoft Corporation Standard Edition (64-bit) on Windows 10 Pro 10.0 <X64> (Build 22621: ) (Hypervisor)

    You are running the release version of SQL 2019, and many bug fixes have been released. I strongly recommend that you download the most recent Cumulative Update for SQL 2019.

  2. Erland Sommarskog 105.9K Reputation points MVP

    As they say "It works on my machine".

    Server crashes can usually be construed as bugs, so you could consider opening a support case. However, those warnings could be problematic. CSS may advice you against using these assemblies altogether.