Click here to Skip to main content
15,896,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ALTER DATABASE scribe_devtest SET TRUSTWORTHY on
GO

CREATE ASSEMBLY Messaging
AUTHORIZATION [mylogin]
FROM 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Messaging.dll'
WITH PERMISSION_SET = UNSAFE
GO


CREATE ASSEMBLY SqlMSMQ
AUTHORIZATION [mylogin]
FROM 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\SqlMSMQ.dll'
WITH PERMISSION_SET = UNSAFE
GO

CREATE PROCEDURE testdllproc
@queue nvarchar(200),
@msg nvarchar(MAX)
AS EXTERNAL NAME SqlMSMQ.[SqlMSMQ.SqlMSMQ].SendMessage
GO

Problem:
on
exec testdllproc '.\private$\test','<abcde>'

Error is:
An error occurred in the Microsoft .NET Framework while trying to load assembly id 65581. 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 'sqlmsmq, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0c63af21be52a322' or one of its dependencies. Assembly in host store has a different signature than assembly in GAC. (Exception from HRESULT: 0x80131050) See Microsoft Knowledge Base article 949080 for more information.
System.IO.FileLoadException:
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)


This seems to b a permission issue although mylogin is dbowner.
Also i have looged in to SQL with windows autentication. Is that an issue?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900