On Sun, Mar 30, 2014 at 10:47:50PM -0700, Antti Karanta wrote:
>perjantai, 28. maaliskuuta 2014 12.17.24 UTC+2 Magnus Therning kirjoitti:
>>
>>
>> I think I also need to make some other configuration changes in order
>> for it to work:
>>
>> - with `(assembly-load-from "\\devo\\ClojureTest\\lib\\FTD2XX_NET.dll")` I
>> get
>>
>> "(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. [trace missing]"
>
> I have seen this on a fríend's box but it does not reproduce on mine
> so I have not figured it out. The only difference between our
> environments that I can think of is that he is using Windows 8 and I
> have Windows 7. Which one do you have?
I'm on Windows 7.
>> - with `(assembly-load-from "lib\\FTD2XX_NET.dll")` I get
>>
>> "(FileNotFoundException Could not load file or assembly
>> 'file:///C:\Users\magnust\AppData\Local\Temp\lib\FTD2XX_NET.dll'
>> or one of its dependencies. The system cannot find the file
>> specified. System.Reflection.RuntimeAssembly._nLoad (:0)"
>
> Please try (System.IO.File/Exists path) ;; with the same path. If
> that returns true but assembly-load-from fails then it's likely that
> one of the dependencies of that assembly can't be found. You can
> investigate them e.g. with ilspy (
http://ilspy.net/).
I think the issue here is with my expectations on VSClojure :( See
more below.
>> Both when trying to load the project into the REPL. In the first case
>> I did follow the link but after 10 minutes of reading and following
>> links I still don't know WHERE to change the runtime settings. In the
>> second case I was sort of hoping that the REPL would execute with a
>> CWD of the location of my project (or the solution), but that doesn't
>> seem to be the case.
>
> I guess that by project / solution you are referring to VSClojure
> Visual Studio project? I have no experience with that but with
> leiningen clr (
https://github.com/kumarshantanu/lein-clr) things
> work fairly smootly.
Yes, I'm using Visual Studio (2013) with the VSClojure addon. The
idea I had was to be able to use clojure-clr largely for the REPL to
play and experiment within a large-ish C# solution. Maybe even sneak
in some clojure under the radar at some point too.
What I did expect was that adding the reference in the
solution/project would have the effect that the REPL's context changed
and that loading assemblies would be a breeze after that. So far it
looks like my expectation was a little too high.
I have the impression that leiningen is designed to be used
stand-alone, i.e. not as a part of a Visual Studio solution. Is that
pretty much the case or do I have it completely wrong?
Any fool can write code that a computer can understand. Good programmers
write code that humans can understand.
-- Martin Fowler