Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.Net MVC with Javascript Viewengine for serverside rendering - BuildError on server

I'm using : https://github.com/Buildstarted/Javascript.ViewEngines as additional Viewengine.

This way i can server side render javascript, react, angular, ... ( it worked before)

For this i need to include a couple of dll in the root directory ( which is weird, but always done it like this)

The files are:

  • ClearScriptV8-32.dll
  • ClearScriptV8-64.dll

  • v8-ia32.dll

  • v8-x64.dll

When running it locally ( on 2 dev computers). Everything runs OK. The problem starts when i publish to either Azure or a "Web Deploy" on my own server.

My own publish gives me this:

Could not load file or assembly 'ClearScriptV8-32' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Azure also: Could not load file or assembly 'ClearScriptV8-64' or one of its dependencies. An attempt was made to load a program with an incorrect format.

like image 210
NicoJuicy Avatar asked Nov 08 '22 19:11

NicoJuicy


1 Answers

Sounds like you need to enable 32-bit applications since that's the type of library it's not able to load.

https://blogs.msdn.microsoft.com/avkashchauhan/2011/07/14/windows-azure-web-role-how-to-enable-32bit-application-mode-in-iis-application-pool-using-startup-task/

From that link, create a startup file that looks like:

%windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.enable32BitAppOnWin64:true

Then update your Window Azure Service Definition file to include start up task

<Startup>
 <Task commandLine="Startup.cmd" executionContext="Elevated" taskType="simple">
 </Task>
 </Startup>

Make sure that the Startup.cmd file is part of your Web Role application and set its property “Copy Local to True”

like image 134
xaxxon Avatar answered Nov 14 '22 22:11

xaxxon