Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

Commented Unassigned: Administrator rights [33]

0
0
When attempting to run in low rights mode I found that the service was unable to access (or possibly create) a folder in the %appdata%/local/microsoft/clearscript/(x64|x86)/(.net version). It seems to create a file called AssemblyTable.bin in that folder. Is it necessary? Is there any way to avoid this and not require administrative access?

For specifics I'm running this on a server using the AppPoolIdentity. I set the apppool to run under administrator for the first time and then back to apppoolidentity and it works fine.

I'm not sure what the issue issue just yet but wondering if this is a known issue or not. Couldn't find anything in the issues here on codeplex.
Comments: Greetings! ClearScript has the ability to load assemblies and expose all their public types to a script engine in one step. It allows the host to specify system assemblies by their short names - "mscorlib", "System.Core", etc. - but full names are usually required to actually load them. In order to map short assembly names to full names, ClearScript enumerates the assemblies in the .NET framework directory and builds a table. This can take some time - usually a second or two - so ClearScript saves the table on disk for reuse. This feature predates ClearScript's use in server environments, and we can certainly see how low-rights mode could block its ability to save the assembly table. However, the code is designed to withstand that. Did this issue cause your service to stop functioning? In any case, you can easily avoid this by specifying preloaded assemblies instead of assembly names. That is, instead of this: ``` C# engine.AddHostObject("lib", new HostTypeCollection("mscorlib")); ``` You could do something like this: ``` C# var assembly = typeof(int).Assembly; engine.AddHostObject("lib", new HostTypeCollection(assembly)); ``` Please let us know if this works for you. Cheers!

Viewing all articles
Browse latest Browse all 2297