Running a 32-bit window service which loads a 32-bit dll as a 64-bit service

╄→гoц情女王★ 提交于 2019-12-12 02:08:45

问题


Here's the situation -

A window service which I am coding uses Linq2Excel, which insist the invoking application to be complied against x86.

However, the window service is to be installed on a 64-bit Windows server.

Using corflags, I am able to get the 32-bit window service to install. However, it'll refuse to load Linq2Excel. Here's the exception in all its glory:

Exception occurs: Could not load file or assembly 'LinqToExcel, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. 
An attempt was made to load a program with an incorrect format.

What is the solution to get this service working? (Changing the server to 32-bit is not going to happen, using Linq2Excel is a must)


回答1:


If everything is 32 bit it should work fine on 64dit machine, but 32bit app could not load 64bit dll, you can make out of process call using WCF or whatever



来源:https://stackoverflow.com/questions/6493948/running-a-32-bit-window-service-which-loads-a-32-bit-dll-as-a-64-bit-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!