Set assembly permissions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bassem
    Contributor
    • Dec 2008
    • 344

    Set assembly permissions

    Hi,

    I've create an assembly loaded it to SQL Server and run a sql command that uses it. Everything worked fine till I added this code to the assembly:
    Code:
    try 
                {
                    Process sapProcess = new Process();
                    sapProcess.StartInfo = new ProcessStartInfo(ConfigurationHelper.IncomingDirectory + "\\" + "SAP.exe");
                    sapProcess.StartInfo.Arguments = ConfigurationHelper.ProcessingDirectory + "\\" + xmlFileName;
                    sapProcess.Start();
                }
                catch (Exception callSAPException)
                {
                    error += callSAPException.Message;            
                }
    An error occurred in SQL Server:
    Code:
    A .NET Framework error occurred during execution of user-defined routine or aggregate "dcm_sp_generateresultxml": 
    System.Security.SecurityException: Request failed.
    System.Security.SecurityException: 
       at SQLCLRIO.Generate(String xmlFileName)
    I'm trying to set the permission to the assembly so SQL Server can use it and run an exe application, but I don't know how! I searched and some techniques comes up, unfortunately no one worked.

    Thanks in advanced!
Working...