locked
Howto resolve SQL04116: A method with a matching signature was not found in the loaded assembly RRS feed

  • Question

  • Hi!

    I'm learning  VS2010 capabilities for SQLServer developing . Have created SQLServer 2008 Database project, imported objects from working sql database and found too many errors and warnings. One of them is SQL04116 and i don't understand how to resolve it. All object is correct, function correct, assembly correct, reference to assembly presented, db works correctly on the sql server. And one more terrible thing that i can't find this error description in whole Internet and even local help. Thanks for any help!

    Best regards, Konstantin


    Konstantin Knyazev

    Friday, April 27, 2012 11:16 AM

Answers

  • I have found the reason, there was incorrect attribute for function definition, function was marked as SqlProcedure.

    Sorry for disturbing.

    Thanks!


    Konstantin Knyazev

    Wednesday, May 16, 2012 1:20 PM

All replies

  • Hi Konstantin,

    I am sorry that I have never seen this error message before either. And please provide me more information, I would like to help you narrow down the root cause of it:

    1). If you just create a very simple database project and import one simple database to that database project, will you still get the same errors?
    2). Please double click the SQL04116 error message to navigate to the source code which cause this issue. And it is better if you can share me the SQL script for that database object.
    3). When do you get the error message? During you build or deploy the database project?

    Thanks.


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us

    Monday, April 30, 2012 8:17 AM
    Moderator
  • Hi Vicky! Thanks for your attention. Sorry for delay, i was on my vacation.

    3. i have this error message on saving project in Error List window

    1,2. For test purpose, i have created an empty project, have added assembly named SQLHTTP.dll, then have addedreference to it, next have added procedure from this assembly with code

    CREATE PROCEDURE [dbo].[ext_sp_HttpGet]
    	@url NVARCHAR (MAX), 
    	@encoding NVARCHAR (MAX), 
    	@data NVARCHAR (MAX) OUTPUT
    AS 
    	EXTERNAL NAME [SQLHTTP].[SqlHttp].[Get]
    
    

    saved project and there was no errors. After that i have added function from same assembly:

    CREATE FUNCTION dbo.ext_f_UrlDecode( @data nvarchar(MAX))
    	RETURNS nvarchar(MAX)
    AS
    	EXTERNAL NAME [SQLHTTP].[SqlHttp].[UrlDecode]

    And after saving gets error Error    1    SQL04116: A method with a matching signature was not found in the loaded assembly.    C:\Users\Zelius\Documents\Visual Studio 2010\Projects\VS_Test\VS_Test\Schema Objects\Schemas\dbo\Programmability\Stored Procedures\ext_f_UrlDecode.proc.sql    3    18    VS_Test

    Here is declaration of this function from Object Browser of assembly:

    public static string UrlDecode(string data)
        Member of SqlHttp
    
    Attributes:
    [Microsoft.SqlServer.Server.SqlProcedureAttribute]
    

    And after clicking on error ext_f_UrlDecode.proc.sql file opens and cursor sets before [SQLHTTP].[SqlHttp].[UrlDecode] text.

    PS sorry for my English :(


    Konstantin Knyazev

    Wednesday, May 16, 2012 10:13 AM
  • I have found the reason, there was incorrect attribute for function definition, function was marked as SqlProcedure.

    Sorry for disturbing.

    Thanks!


    Konstantin Knyazev

    Wednesday, May 16, 2012 1:20 PM