scriptcs-contrib / edge-scs

scriptcs for edge!
Apache License 2.0
12 stars 2 forks source link

Autofac.Configuration.dll is 'blocked' #2

Open chris-ray opened 10 years ago

chris-ray commented 10 years ago

Since there is no npm module, I just dropped the built code straight into node_modules. Running a simple example doesn't work right away, it spits out this nasty message:

System.TypeInitializationException: The type initializer for 'EdgeCompiler' threw an exception. ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
   at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
   at System.Reflection.Assembly.LoadFile(String path)
   at EdgeCompiler..cctor()
   --- End of inner exception stack trace ---
   at EdgeCompiler..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at ClrFunc.Initialize(Handle<v8::Value>* , Arguments* args)

Which basically says that one or more of the assemblies being loaded is "blocked" and needs to be unblocked. I found that the "Autofac.Configuration.dll" seemed to be the only blocked assembly. Unblocked it and everything started to work.