Asp。Net MVC和Javascript视图引擎,用于服务器端渲染-构建镜像

时间:2021-10-02 08:22:26

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

我正在使用:https://github.com/buildstarted/javascript.viewengine作为附加的Viewengine。

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

通过这种方式,我可以在服务器端渲染javascript、react、棱角分明、……(工作)

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

为此,我需要在根目录中包含几个dll(这很奇怪,但总是这样做)

The files are:

的文件是:

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

    clearscriptv8 - 64. - dll

  • v8-ia32.dll

    v8-ia32.dll

  • v8-x64.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.

在本地运行时(在两台开发计算机上)。一切都好。当我在自己的服务器上发布到Azure或“Web部署”时,问题就出现了。

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.

不能加载文件或程序集的ClearScriptV8-32或它的一个依赖项。尝试加载一个格式不正确的程序。

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.

Azure也:无法加载文件或程序集“ClearScriptV8-64”或它的一个依赖项。尝试加载一个格式不正确的程序。

1 个解决方案

#1


1  

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

听起来你需要启用32位应用程序,因为这是它无法加载的类型。

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/

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

然后更新您的窗口Azure服务定义文件,包括启动任务。

<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”

确保创业。cmd文件是您的Web角色应用程序的一部分,并将其属性设置为“本地复制为True”

#1


1  

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

听起来你需要启用32位应用程序,因为这是它无法加载的类型。

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/

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

然后更新您的窗口Azure服务定义文件,包括启动任务。

<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”

确保创业。cmd文件是您的Web角色应用程序的一部分,并将其属性设置为“本地复制为True”