clojure-clr
clojure-clr copied to clipboard
TypeInitializationException on startup
I've run Clojure for CLR successfully before on a different machine. Just downloaded this distribution - https://github.com/downloads/richhickey/clojure-clr/clojure-clr-1.3.0-alpha1-debug-4.0.zip
Running Clojure.Main.exe I get this:
Unhandled Exception: System.TypeInitializationException: The type initializer for 'Clojure.CljMain' threw an exception. ---> System.TypeInitializationException: The type initializer for 'clojure.lang.RT' 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 clojure.lang.Compiler.LoadAssembly(FileInfo assyInfo) in C:\work\clojure-c lr\Clojure\Clojure\CljCompiler\Compiler.cs:line 1261 at clojure.lang.RT.load(String relativePath, Boolean failIfNotFound) in C:\wo rk\clojure-clr\Clojure\Clojure\Lib\RT.cs:line 1980 at clojure.lang.RT.load(String relativePath) in C:\work\clojure-clr\Clojure\C lojure\Lib\RT.cs:line 1960 at clojure.lang.RT.DoInit() in C:\work\clojure-clr\Clojure\Clojure\Lib\RT.cs: line 543 at clojure.lang.RT..cctor() in C:\work\clojure-clr\Clojure\Clojure\Lib\RT.cs: line 538 --- End of inner exception stack trace --- at clojure.lang.RT.var(String ns, String name) at Clojure.CljMain..cctor() in C:\work\clojure-clr\Clojure\Clojure.Main\Main. cs:line 26 --- End of inner exception stack trace --- at Clojure.CljMain.Main(String[] args)
Following directions on the Microsoft page, I added a Clojure.Main.exe.config file with the following, which makes it run OK:
Ran into this as well. In total, Clojure.main.exe.config looks like this:
<configuration>
<runtime>
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>