I'm not quite sure where to go with this. The overall goal is to be able to accept a user script and execute it in a .NET environment. I have written most of the code and everything works, I am not trying to load my own assemblies. However, in order to safely provide users with access to the internal parts of the system, a proxy DLL has been created. That's where the problem seems to be.
This proxy DLL currently has one thing in it, an interface.
CompilerParameters options = new CompilerParameters(); options.GenerateExecutable = false; options.GenerateInMemory = true; options.ReferencedAssemblies.Add("System.dll"); options.ReferencedAssemblies.Add("ScriptProxy.dll"); Microsoft.CSharp.CSharpCodeProvider provider = new Microsoft.CSharp.CSharpCodeProvider(); CompilerResults result = provider.CompileAssemblyFromSource(options, script);
Running the above code causes the following error:
System.IO.FileNotFoundException: Could not load file or assembly 'file: /// C: \ Users ... \ AppData \ Local \ Temp \ scts5w5o.dll or one of its dependencies. The system cannot find the specified file.
Of course, my first thought is: "... and what is scts5w5o.dll?"
Is ScriptProxy.dll
loading ScriptProxy.dll
or is the Proxy.dll script trying to load dependencies located somewhere in a temporary file? Or is it completely different?
I should mention that I am executing this code from the NUnit test runner. I'm not sure if that matters.
source share