CLR procedure not working

  • Hi All

    I have one CLR procedure which create a .txt file on a location on DB server only. All of sudden the same procedure is not working. I am getting the following error:-

    n error occurred in the Microsoft .NET Framework while trying to load assembly id 65539.

    The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE.

    Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error:

    System.IO.FileLoadException: Could not load file or assembly

    'usp_Myfileclr, Version=1.0.3810.15929, Culture=neutral, PublicKeyToken=07e19f7da45b60ab'

    or one of its dependencies. An error relating to security occurred. (Exception from HRESULT: 0x8013150A)

    System.IO.FileLoadException: at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase,

    Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)

    at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)

    at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)

    at System.Reflection.Assembly.Load(String assemblyString) [10314] at Line 52 [50000] at Line

    Server is SQL 2008. The only change happened is we moved the server to a new location. Everything else is working fine. Other CLR's are working fine. I have checked entries to sys.Assemblies table also and data is there.

    best regards,

    🙂

  • So where does the .txt file get written to, does that spot (folder) still exist on the new server and, if it does, can the new server still see that spot?

    Next question... do you have the source code for the CLR so that you can check?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • There is location on the server where file is created using that clr procedure. I have source code but cant run the project as it's locked by some encrpted key which is missing.

  • The error message you have reported would indicate that along with "moving the server" the security policy has changed, or a dependency of the CLR procedure is missing. If it was a physical server move, it is more likely the former than the latter.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply