0

I have created a class library project to send an email using Azure.Identity, Microsoft.Graph. after that, I complied into DLL when I tried to create Assembly in SQL Server it threw error

Assembly 'MSGraphMail' references assembly 'system.runtime.compilerservices.unsafe, version=4.0.4.1,

  1. how to find the perfect version of my dll refers i.e version=4.0.4.1
  2. how to package all the dlls which is reference in my class library project i.e exactly what they want
CREATE ASSEMBLY PhoenixMail FROM 'C:\MSGraphMail.DLL' WITH PERMISSION_SET = UNSAFE 
 Assembly 'MSGraphMail' references assembly 'system.runtime.compilerservices.unsafe, version=4.0.4.1, 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: version, culture or public key mismatch). Please load the referenced assembly into the current database and retry your request. Assembly 'System.Text.Json' references assembly 'system.runtime.compilerservices.unsafe, version=4.0.4.1, 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 the referring assembly came from. Still, that operation has failed (reason: version, culture or public key mismatch). Please load the referenced assembly into the current database and retry your request. 

I also complied system.runtime.compilerservices.unsafe but still it throws same error

Thank you

3
  • 2
    Is there some reason you want to make mail delivery part of the SQL Server's process space? Why aren't you using an external service, container or application to dequeue messages from outside SQL Server? Commented May 28, 2024 at 7:07
  • we followed the same CLR for the last 10 years it refers to multiple projects so I can not change those projects if I fix them here then only those project will work Commented May 31, 2024 at 4:41
  • if you have any ideas about using Microsoft Graph Mail auth in SQL server please let me know it will be very helpful. Commented May 31, 2024 at 4:43

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.