CLR Stored Procedure in SQL Server 2005

Posted on 2006-06-06
Last Modified: 2008-02-07
I am trying to create a stored proc from .net clr code and it is failing because one of the referenced dll files is not in an assembly (in sql server).  I attempt to create an assembly with this dll and I get the folowing error:

Failed to open malformed assembly 'MyLibrary' with HRESULT 0x8007000b.

This dll file seems to work fine elsewhere, does anyone know what is causing this?
Question by:dave4dl
    LVL 12

    Accepted Solution

    It could be this assembly was compiled over a different system with different dll links.
    If you can, try to recompile this "external dll" on the machine where the sqlServer is executing (and where it will be used).

    Hope this could help you.
    Bye, Giant.
    LVL 15

    Author Comment


    Thanks for the suggestion.  I actually already did this (i was trying to make sure that there wasnt a conflict between .NET frameworks) with no change in behavior.  Still not sure what is the root cause.

    LVL 15

    Author Comment

    I ended up not needing to bring the external dll file into an assembly.  I did have to make sure that the dll file referenced by the clr code in the assembly was in a directory listed in the environmental variable "PATH".  I think that probably the dll causing the "malformed assembly" error was not created with clr.

    Thanks for trying to help Giant2.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now