questo codice c# usa una libreria scritta in j# e dovrebbe generare un file pdf dandogli in pasto un file "xsl-fo"

ottengo questo errore alla riga
//setup output
OutputStream outfile = new FileOutputStream(pdf);

codice:
Richiesta di autorizzazione di tipo 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' non soddisfatta.
ho controllato la cartella dove è il file ".fo" ("c:\trasformazioni\test.fo"), ho everyone(fullcontroll),
ho aggiunto anche il mio utente e system per scrupolo ed ho assegnato anche ad essi il controllo completo della cartella
ma l'errore persiste. da cosa puo dipendere l'errore?



ecco il codice:
codice:
using System;
using System.IO;
using java.io;
using org.xml.sax;
using org.apache.avalon.framework;
using org.apache.avalon.framework.logger;
using org.apache.fop.apps;
using org.apache.fop.messaging;
using System.Collections.Generic;
using System.Text;

namespace NFOPTest
{
    
    class ExampleFO2PDF
    {

        public static void convertFO2PDF(string fo, string pdf) {
           
            //costruct driver
            Driver driver = new Driver();

            //setup logger
            Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_INFO);
            driver.setLogger(logger);
            MessageHandler.setScreenLogger(logger);
        
            //setup render(output format)
            driver.setRenderer(Driver.RENDER_PDF);
        
            //setup output
            OutputStream outfile = new FileOutputStream(pdf);
            try {
                driver.setOutputStream(outfile);
            
                //setup input
                InputStream infile = new FileInputStream(fo);
                
                try {
                    driver.setInputSource(new InputSource(infile));
                    //process FO
                    driver.run();
                }
                finally {
                    infile.close();
                }
            }
            finally {
                outfile.close();
            }
        
        }

        
        [STAThread]
        static void Main(string[] args)
        {
          

                Console.WriteLine("FOP ExampleFO2PDF\n");
                Console.WriteLine("Preparing...");
            
                                
                //setup input and output files
                string fofile = @"c:\trasformazioni\test.fo"; 
                string pdffile = @"c:\trasformazioni\result.pdf";

                Console.WriteLine("input: XSL-FO (" + fofile  + ")");
                Console.WriteLine("output: PDF (" + pdffile + ")");
                Console.WriteLine();
                Console.WriteLine("Trasforming...");

                ExampleFO2PDF.convertFO2PDF(fofile, pdffile);
                Console.WriteLine("Success!");
            
        
        }
    }
}



riporto anche lo stackTrace se puo servire a capire qualcosa
codice:
java.lang.SecurityException: Richiesta di autorizzazione di tipo 'System.Securit
y.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, Publ
icKeyToken=b77a5c561934e089' non soddisfatta.
   in System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMa
rk& stackMark, Boolean isPermSet)
   in System.Security.CodeAccessPermission.Demand()
   in System.IO.FileInfo.<init>(String fileName)
   in java.io.File.__initObject(Boolean isConstructing)
   in java.io.File.<init>(String dirPath, String name)
   in java.io.FileOutputStream.<init>(String path)
   in NFOPTest.ExampleFO2PDF.convertFO2PDF(String fo, String pdf)
   in NFOPTest.ExampleFO2PDF.Main(String[] args)
   in System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
   in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySec
urity, String[] args)
   in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   in System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   in System.Threading.ExecutionContext.runTryCode(Object userData)
   in System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCl
eanup(TryCode code, CleanupCode backoutCode, Object userData)
   in System.Threading.ExecutionContext.RunInternal(ExecutionContext executionCo
ntext, ContextCallback callback, Object state)
   in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, C
ontextCallback callback, Object state)
   in System.Threading.ThreadHelper.ThreadStart()
java.lang.SecurityException: Richiesta di autorizzazione di tipo 'System.Securit
y.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, Publ
icKeyToken=b77a5c561934e089' non soddisfatta.
   in System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMa
rk& stackMark, Boolean isPermSet)
   in System.Security.CodeAccessPermission.Demand()
   in System.IO.FileInfo.<init>(String fileName)
   in java.io.File.__initObject(Boolean isConstructing)
   in java.io.File.<init>(String dirPath, String name)
   in java.io.FileOutputStream.<init>(String path)
   in NFOPTest.ExampleFO2PDF.convertFO2PDF(String fo, String pdf)
   in NFOPTest.ExampleFO2PDF.Main(String[] args)
   in System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
   in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySec
urity, String[] args)
   in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   in System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   in System.Threading.ExecutionContext.runTryCode(Object userData)
   in System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCl
eanup(TryCode code, CleanupCode backoutCode, Object userData)
   in System.Threading.ExecutionContext.RunInternal(ExecutionContext executionCo
ntext, ContextCallback callback, Object state)
   in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, C
ontextCallback callback, Object state)
   in System.Threading.ThreadHelper.ThreadStart()