trifleJS icon indicating copy to clipboard operation
trifleJS copied to clipboard

Unhandled Exception on start

Open FattusMannus opened this issue 10 years ago • 10 comments

Trying to run TrifleJs from command line give me:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembl y 'Noesis.Javascript, Version=0.0.0.0, Culture=neutral, PublicKeyToken=ae36d046c 7f89f85' or one of its dependencies. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event l og or use the command-line sxstrace.exe tool for more detail. (Exception from HR ESULT: 0x800736B1) File name: 'Noesis.Javascript, Version=0.0.0.0, Culture=neutral, PublicKeyToken= ae36d046c7f89f85' ---> System.Runtime.InteropServices.COMException (0x800736B1): The application has failed to start because its side-by-side configuration is i ncorrect. Please see the application event log or use the command-line sxstrace. exe tool for more detail. (Exception from HRESULT: 0x800736B1) at TrifleJS.Program.Interactive() at TrifleJS.Program.Main(String[] args)

Event viewer gives me:

Activation context generation failed for "C:\TrifleJS\Noesis.Javascript.dll". Dependent Assembly Microsoft.VC90.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.30729.6161" could not be found. Please use sxstrace.exe for detailed diagnosis.

Is this because I am running on 64 bit? I should have all runtimes etc installed.

FattusMannus avatar May 30 '14 09:05 FattusMannus

I am having the same issue, does anyone have a solution to this. I have tried building the binary with Noesis.Javascript 64 bit version, to no avail. Please let me know the solution to this.

satyasumans avatar Jul 08 '14 11:07 satyasumans

I'm having the exact same problem and error message. I'm on a 32-bit Windows Vista VM from modern.ie.

fabiosantoscode avatar Jul 15 '14 11:07 fabiosantoscode

Getting same issue. Was looking at options for running headless IE tests, and TifleJS came up. But if we can't even launch the exe, this idea is kind of dead in the water.

holtalanm avatar Oct 29 '14 16:10 holtalanm

I ran into this issue. For me, it was caused by TrifleJS explicitly requiring a very specific update of .NET - and not the latest one. If I can find the link again I will edit this comment later, but you may be able to find it by searching for version 9.0.30729.6161 as indicated in the error message.

DylanDonkersgoed avatar Nov 05 '14 23:11 DylanDonkersgoed

It's really a bug for solution instead of code, what the Lib includes cannot work under 3.5. I googled and gained the right way. Download v8 library from http://javascriptdotnet.codeplex.com/releases/view/88504 and copy the 4.0 files(100* instead of 90*) to Lib and set the vs solution to .NET Framework 4.0, then it works on x64 for me.

So, I suggest just provide the links let user to choose what version/framework/platform, the v8 dll should be used, like maven in Java.

feuyeux avatar Nov 24 '14 07:11 feuyeux

Confirmed bug: Thanks for the heads up. Will keep an eye on this one.

Its platform specific and related to the VC++ runtime so harder for me to test.

These are the platforms that I am using at the moment for testing/development:

  • Windows XP Mode (x86) - .NET 3.5
  • Windows 7 (x86) - .NET 4.5
  • Windows 7 (x64) - .NET 4.5

If you are experiencing this PLEASE PROVIDE FOLLOWING INFO:

  • Windows Version (ie Windows 7)
  • Platform (x86/x64) (ie x64)
  • .NET Version installed (ie 3.5)
  • Version of TrifleJS (ie 0.5.0 ..)
  • Exact VC++ Runtime installed (ie VC++ 2008 Redistributable x86 9.0.3729.4974)

For the last item, look in Control Panel > Programs.

If you are using Visual Studio:

  • Version of VS (ie VS2012)
  • Commit No (ie 2171b6a)

This will help me greatly with my testing.

Thanks! Steven

PS Hi @feuyeux thanks for the suggestion. I'd like to explore all other options before creating multiple platform binaries, keep several of them updated adds to much work and confusion.

PPS Javascript.NET seems to be asking for VC9.0 Runtime (C++ Redistributable 2008 x86), I might consider checking VC runtime on start

  • @see using http://stackoverflow.com/questions/566259/how-can-i-programmatically-determine-if-the-visual-c-runtime-8-0-is-installed
  • @see http://blogs.msdn.com/b/astebner/archive/2009/01/29/9384143.aspx

sdesalas avatar Nov 30 '14 08:11 sdesalas

Temporary fix for this issue (132b45a) -> Checks the VC2008 redistributable installed.

Not ideal as it may ask for latest VC2008 redistributable in machines where it would have run without a problem. Still, better than nothing I suppose, I am open to other suggestions/approaches, particularly any ideas on how I can bundle up the correct VC DLL dependencies so the user does not need to install them.

I think VS2010 has better handling of C++ dependencies. Perhaps I can investigate that.

@see http://stackoverflow.com/questions/19920254/fix-side-by-side-configuration-error-in-mfc-application-w-o-installing-vs-redist @see http://www.codeproject.com/Articles/19155/Create-projects-easily-with-private-MFC-ATL-and-CR

sdesalas avatar Jan 08 '15 02:01 sdesalas

I added a new version of TrifleJS.Latest.zip with bundled dependencies in cf629aa. Turns out I only had to add the manifest that came with Noesis.Javascript.dll.. I dont have an old XP machine handy for testing but this might have made the issue go away.

sdesalas avatar Jan 25 '15 14:01 sdesalas

TL;DR Reading up in this issue I downloaded Noesis.Javascript v0.7 - Binaries.zip (http://javascriptdotnet.codeplex.com/releases/view/88504) and referenced the v4.0 binaries in the project and rebuild, and that worked in debug mode. I'm guessing a beta for .NET Framework 4+ would be of good use, I'm guessing most people use it.

Issue with TrifleJS dists: I cannot get the executable going. It doesn't matter wheter i run TrifleJs.exe from stable v4.0 or latest beta v0.5. This is the stack trace I get (I hope you can decipher it, even though it's in Swedish):

C:\temp\trifle\TrifleJS.Latest
λ TrifleJS.exe examples\phantomwebintro.js

Ohanterat undantag: System.IO.FileLoadException: Det går inte att läsa in filen eller sammansättningen Noesis.Javascript, Version=0.0.0.0, Culture=neutral, PublicKeyToken=ae36d046c7f89f85 eller ett av dess beroenden. Det går inte att starta programmet eftersom dess sida vid sida-konfiguration är felaktig. Kontrollera händelseloggen eller använd kommandoradsverktyget sxstrace.exe för mer information. (Undantag från HRESULT: 0x800736B1)
Filnamn: Noesis.Javascript, Version=0.0.0.0, Culture=neutral, PublicKeyToken=ae36d046c7f89f85 ---> System.Runtime.InteropServices.COMException (0x800736B1): Det går inte att starta programmet eftersom dess sida vid sida-konfiguration är felaktig. Kontrollera händelseloggen eller använd kommandoradsverktyget sxstrace.exe för mer information. (Undantag från HRESULT: 0x800736B1)
   vid TrifleJS.Program.Open(String filename)
   vid TrifleJS.Program.Main(String[] args)

A quick translation would be FileLoadException when loading Noesis.Javascript or one of it's dependencies.

So if I instead compile the source with VS2013 targeted to .NET framework 4.5, I get this:

C:\temp\trifle\src\trifleJS\bin\Debug (master)
λ TrifleJS.exe examples\phantomwebintro.js
TrifleJS.exe examples\phantomwebintro.js
Setting Version to IE9

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Noesis.Javascript.dll' or one of its dependencies. Det går inte att starta programmet eftersom dess sida vid sida-konfiguration är felaktig. Kontrollera händelseloggen eller använd kommandoradsverktyget sxstrace.exe för mer information. (Exception from HRESULT: 0x800736B1)
   at TrifleJS.Program.Open(String filename)
   at TrifleJS.Program.Main(String[] args) in c:\temp\trifle\src\trifleJS\Program.cs:line 201

So I downloaded the Noesis.Javascript DLL's from Codeplex (http://javascriptdotnet.codeplex.com/releases/view/88504) as @feuyeux suggested. I referenced the dependiences, rebuild, and everything seems to be working fine after that in debug mode.

C:\temp\trifle\src\trifleJS\bin\Debug (master)
λ TrifleJS.exe examples\phantomwebintro.js
TrifleJS.exe examples\phantomwebintro.js
Setting Version to IE9
new FileSystem()
new System()
new ChildProcess()
WebPage.fireEvent('navigationrequested', uuid, args)
WebPage.fireEvent('loadstarted', uuid, args)
...

If I build in release mode, I get nothing, not even the "Setting Version to IE9" log line. However, creating screenshots does work:

C:\temp\trifle\src\trifleJS\bin\Release (master)
λ TrifleJS.exe --render=http://whatbrowser.org
Rendering http://whatbrowser.org...
Screenshot rendered to file: whatbrowser.org.png

jouni-kantola avatar Apr 16 '15 10:04 jouni-kantola

I was trying to get it to run in Windows Server 2012 R2 and got this error while using TrifleJS.Latest.zip, by adding the Noesis.Javascript.dll from the Stable release to the directory the error I get is

phantom.fireEvent() (1,0): ReferenceError: phantom is not defined

elvarb avatar Aug 13 '15 15:08 elvarb