DAAB and SQL2005?

Topics: Data Access Application Block
Dec 30, 2008 at 8:44 AM
I am trying to use EntLib (DAAB) in order to create a CLR stored procedure on SQL Server 2005.
I am using the following unsigned libraries (\EntLib3Src\App Blocks\...)
- Microsoft.Practices.EnterPriseLibrary.Common
- Microsoft.Practices.EnterPriseLibrary.Data
- Microsoft.Practices.EnterPriseLibrary.ObjectBuilder

I configured a default database connection ("context connection=true") in the DAAB part of the Enterprise Library Configuration.

When I try to use the library

CREATE ASSEMBLY <AssemblyName> from '<Path to Assembly>' WITH PERMISSION_SET = SAFE

I am getting the following error:

Msg 10301, Level 16, State 1, Line 4
Assembly '<AssemblyName>' references assembly 'system.management, 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.

I tried to include the System.Management library as well but that led to a chain of "unsolved" references.

What is the problem?
Dec 30, 2008 at 8:57 AM
I'm not sure if this is an EntLib error/issue.  If you try to add the System.Management assembly, were any of the unsolved references point to an EntLib assembly?

Sarah Urmeneta

Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com

Dec 30, 2008 at 9:04 AM

Sarah,

I actually was trying to add this refernce without actually copying it but that did not change anything.
So I physically added the System.Management.dll (which is a bit confusing for me as it is a .NET library already present on the server)

What happened then:

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

Msg 10301, Level 16, State 1, Line 1

Assembly 'labHW04' references assembly 'system.configuration.install, 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.

Dec 30, 2008 at 9:10 AM
Just found this thread, see if this helps.
http://www.mydatabasesupport.com/forums/ms-sqlserver/218629-create-assembly-issue.html


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com


Dec 30, 2008 at 9:57 AM
Sarah,

thanks for that - 
changing the dbowner didn't work but I see from this thread that this is more an issue of the CLR integration in SQL Server rather than a EntLib issue.