Problem in registering external dll using Create Assembly

Hi,

I have created CLR Trigger project using SQL Server Project. In that project i want to add external dll which is located in disk. For that first i have placed the external dll in one folder. Than i have placed all the supporting dlls for the external dll in that folder. Then using Create Assembly i tried to register it(i have give PERMISSION_SET=UNSAFE). But it gives the following error. I have placed the system.web.dll also to the external dll folder. How to solve this problem.

Warning: The Microsoft .Net frameworks assembly 'system.web, version=1.0.5000.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.' you are registering is not fully tested in SQL Server hosted environment.

Msg 6586, Level 16, State 1, Line 1

Assembly 'System.Web' could not be installed because existing policy would keep it from being used.
Thanks,
Vinoth

[908 byte] By [Vinoth] at [2008-2-13]
# 1
This is most likely since you are trying to register a framework assemblies from 1.x version of the .NET Framework. You need to use 2.0 version of System.Web instead.

I would like to understand why you want to register and use 1.0 version of System.Web inside SQL Server 2005.

Thanks,
-Vineet.

VineetRao-Microsoft at 2007-9-9 > top of Msdn Tech,SQL Server,.NET Framework inside SQL Server...
# 2
Hi,

When i use v2.0.50125 framework i got the following error message.

Warning: The Microsoft .Net frameworks assembly 'system.web, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=x86.' you are registering is not fully tested in SQL Server hosted environment.

Warning: The Microsoft .Net frameworks assembly 'system.drawing, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment.

Warning: The Microsoft .Net frameworks assembly 'system.directoryservices, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment.

Warning: The Microsoft .Net frameworks assembly 'system.directoryservices.protocols, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment.

Warning: The Microsoft .Net frameworks assembly 'system.enterpriseservices, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=x86.' you are registering is not fully tested in SQL Server hosted environment.

Warning: The Microsoft .Net frameworks assembly 'system.runtime.remoting, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment.

Warning: The Microsoft .Net frameworks assembly 'system.runtime.serialization.formatters.soap, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment.

Warning: The Microsoft .Net frameworks assembly 'system.design, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment.

Warning: The Microsoft .Net frameworks assembly 'system.windows.forms, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment.

Warning: The Microsoft .Net frameworks assembly 'accessibility, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment.

Warning: The Microsoft .Net frameworks assembly 'system.drawing.design, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment.

Warning: The Microsoft .Net frameworks assembly 'system.web.regularexpressions, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment.

Warning: The Microsoft .Net frameworks assembly 'system.serviceprocess, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment.

Warning: The Microsoft .Net frameworks assembly 'system.configuration.install, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment.

Msg 10300, Level 16, State 1, Line 1

Assembly 'Microsoft.SharePoint' references assembly 'system.web, version=1.0.5000.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: version, culture or public key mismatch). Please load the referenced assembly into the curent database and retry your request.


Because my external dll is created in v1.1.4322 which also refers Microsoft.Sharepoint dll. So i think it asks for system.web.dll v1.1.4322. If i use use system.web.dll of V1.1.4322 i got the following error message.

Warning: The Microsoft .Net frameworks assembly 'system.web, version=1.0.5000.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.' you are registering is not fully tested in SQL Server hosted environment.

Msg 6586, Level 16, State 1, Line 1

Assembly 'System.Web' could not be installed because existing policy would keep it from being used.

please help me to solve this issue.

Thanks,
Vinoth

Vinoth at 2007-9-9 > top of Msdn Tech,SQL Server,.NET Framework inside SQL Server...
# 3

SQL Server 2005 hosts .NET Common Language Runtime 2.0 and does not support assemblies built using previous versions of the runtime.
Unfortunately this scenario would not work and you would require to recompine your external dll using .NET CLR 2.0 (VS 2005) and update the references to 2.0 version of Sharepoint.dll and Web.dll.

Thanks,
-Vineet.

VineetRao-Microsoft at 2007-9-9 > top of Msdn Tech,SQL Server,.NET Framework inside SQL Server...
# 4

I am having the same problem. I am using Visual Studio 2005 and all my DLLs are from .NET Framework 2.0.

How esle can I get around this problem?

Melt16 at 2007-9-9 > top of Msdn Tech,SQL Server,.NET Framework inside SQL Server...
# 5

I am also having the same problem. I have an external dll which I can't register in SQL Server because it has a reference to System.DirectoryServices. So when I create the assembly in SQL Server, I get...

Msg 10301, Level 16, State 1, Line 2

Assembly 'PermissionsCLR' references assembly 'system.directoryservices, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request.

So I tried the following command to register System.DirectoryServices in SQL Server...

CREATE ASSEMBLY SystemDirectoryServices FROM 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.DirectoryServices.dll'

But I get the following error...

Warning: The Microsoft .Net frameworks assembly 'system.directoryservices, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment.

Msg 6218, Level 16, State 2, Line 1

CREATE ASSEMBLY for assembly 'System.DirectoryServices' failed because assembly 'System.DirectoryServices' failed verification. Check if the referenced assemblies are up-to-date and trusted (for external_access or unsafe) to execute in the database. CLR Verifier error messages if any will follow this message

[ : System.DirectoryServices.DirectorySearcher::SetSearchPreferences][mdToken=0x60000f6][offset 0x0000050E][found address of value 'System.DirectoryServices.Interop.AdsSortKey'] Expected numeric type on the stack.

[ : System.DirectoryServices.SearchResultCollection::RetrieveDirectorySynchronizationCookie][mdToken=0x60001c4][offset 0x00000023][found address of value 'System.DirectoryServices.Interop.AdsSearchColumn'] Expected numeric type on the stack.

[ : System.DirectoryServices.SearchResultCollection::RetrieveVLVResponse][mdToken=0x60001c5][offset 0x00000023][found address of value 'System.DirectoryServices.Interop.AdsSearchColumn'] Expected numeric type on the stack.

[ : System.DirectoryServices.SearchResultCollection+ResultsEnumerator::GetCurrentResult][mdToken=0x60001d2][offset 0x00000033][found address of Native Int] Expected numeric type on the stack.

Any help is greatly appreciated. Is there something else I need to do to register System.DirectoryServices in SQL Server?

Baloodevil at 2007-9-9 > top of Msdn Tech,SQL Server,.NET Framework inside SQL Server...
# 6

I am also having the same problem. I have an external dll which I can't register in SQL Server because it has a reference to System.DirectoryServices. So when I create the assembly in SQL Server, I get...

Msg 10301, Level 16, State 1, Line 2

Assembly 'PermissionsCLR' references assembly 'system.directoryservices, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request.

Any help is greatly appreciated. Is there something else I need to do to register System.DirectoryServices in SQL Server?

Harinadh at 2007-9-9 > top of Msdn Tech,SQL Server,.NET Framework inside SQL Server...

SQL Server

Site Classified