Создаю в MSSQL хранимую процедуру используя сборку CLR (C#)
Всем привет.
Создал dll на C#. Сделал сборку в MSSQL из своей dll и dll, которые необходимы проекту.
CREATE ASSEMBLY [WindowsBase] FROM 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\WPF\WindowsBase.dll' WITH PERMISSION_SET = UNSAFE;
CREATE ASSEMBLY [System.Drawing] FROM 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll' WITH PERMISSION_SET = UNSAFE;
CREATE ASSEMBLY [Accessibility] FROM 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll' WITH PERMISSION_SET = UNSAFE;
CREATE ASSEMBLY [System.Xaml] FROM 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll' WITH PERMISSION_SET = UNSAFE;
CREATE ASSEMBLY [DocumentFormat.OpenXml] FROM 'c:\TEMP\tst2\DocumentFormat.OpenXml.dll' WITH PERMISSION_SET = UNSAFE;
--моя dll
CREATE ASSEMBLY [DemoAssembly] FROM 'c:\TEMP\tst2\test1.dll' WITH PERMISSION_SET = UNSAFE;
Создал хранимую процедуру
create procedure dbo.sp_DemoAssembly
(
@file nvarchar(200)
)
as external name Simple.Demo.GetExcel
go
запускаю процедуру
exec dbo.sp_DemoAssembly @file='c:\\TEMP\\Simple\\Simple\\test.xlsx'
В итоге: на моем домашнем компьютере все срабатывает, как надо
а на рабочем тестовом серваке такая ошибка:
Msg 6522, Level 16, State 1, Procedure sp_DemoAssembly, Line 0 [Batch Start Line 26] A .NET Framework error occurred during execution of user-defined routine or aggregate "sp_DemoAssembly": System.IO.FileNotFoundException: Could not load file or assembly 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. System.IO.FileNotFoundException: at Demo.GetExcel(String file) .
В чем может быть проблема?