sdesalas / trifleJS

Headless automation for Internet Explorer
http://triflejs.org/
MIT License
826 stars 51 forks source link

Mixed mode assembly error in interactive mode #41

Open juliensobrier opened 9 years ago

juliensobrier commented 9 years ago

This error happens in interactive mode only, not when using he --render option:

TrifleJS.exe Unhandled Exception: System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. at TrifleJS.Program.Interactive() at TrifleJS.Program.Main(String[] args) in c:...\trifleJS\Program.cs:line 88

I'm using Visual Studio 2013, the project was converted automatically. The .Net target for the solution is 4. I couldn't figure out which assembly has been compiled for .Net 2.

juliensobrier commented 9 years ago

This was caused by Noesis.Javascript and Newtonsoft.Json

sdesalas commented 9 years ago

Hi @juliensobrier.

Thanks for the bug report and related info. I'm trying to remove dependency on local installation of VC++ 2008 runtime (see #25), so I bundled dependencies for Noesis.Javascript but in doing so might have ended up causing other issues too.

BTW this could also be related to the platform target. I'm always targetting .NET 3.5 and x86 to make sure that I can have one set of binaries and dependencies working in x64 and x86 with lowest .NET version dependency (.NET 3.5 is bundled in Win7). I had a similar error to yours when combining dependencies from x64 and x86 on the same project I think.

sdesalas commented 9 years ago

Also, you have a wider selection of downloads for Noesis.Javascript (.Net 3.5 and 4 vs x64 and x86) if you are building TrifleJS against a specific .NET version. You can download the DLLs in this link.

Be warned though, it can get quite confusing trying to sort out your binaries vs different platforms and versions of .NET. The current DLLs and TrilfeJS.csproj config in TrifleJS are the result of much confusion trying to have a single set of files build in both my home (XP x86 .NET 3.5), and work (Win7 x64 with .NET 4.5) computers.

sdesalas commented 9 years ago

I'll be adding some more info on this topic to the wiki. Its bound to come up again.

juliensobrier commented 9 years ago

I'm not very familiar with .Net, but is there a way to get npm to pull the dependencies automatically? This is how I got the right version for the 2 libraries.