运行Web服务时无法加载文件 [英] Can't load file when running web services

查看:72
本文介绍了运行Web服务时无法加载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家,


现在,我想在VS2010环境中配置Web服务以支持X64平台。所以,我改变了一些解决方案的配置。


有一个项目引用了注册的COM,我做的是:


1。调用regsvr32命令注册x64 COM;


2。在项目中引用已注册的COM


在这些更改之后,可以成功编译x64构建模式。但是当我运行服务时,我总是得到服务器错误。


无法加载文件或程序集"Interop.ALogWrapperLib"或其中一个依赖项。尝试加载格式不正确的程序。


我检查了"C:\ Windows \ Microsoft \\ .NET \ Framework64"中的interop dll \v4.0.30319 \Temporary ASP.NET Files",但我在这里找不到它。我想知道为什么dll没有复制到临时文件夹。我对X86模式进行了类似的测试,我可以在"C:\ Windows \ Mesrosoft.NET \ Framework \v4.0.30319 \Temporary
ASP.NET Files"中获得它。


谢谢,


Gavin


Roc Over Sky

解决方案

 

Hi Gavin,


 


根据您的描述,我认为您需要检查程序集"Interop.ALogWrapperLib"及其依赖项是否支持X64平台。


 


如果某些将在运行时加载的程序集仅支持x86平台,则会抛出此异常。 / p>

 


此致,


Hi experts,

Now, I want to config web services to support X64 platform in VS2010 environment. So, I changed some configuration for solution.

There is one project references the registered COM, what I did are:

1. call regsvr32 command to register x64 COM;

2. refernce the registered COM in the project

After these changes, x64 build mode can be compiled successfully. But when I run the services, I always get the server Error.

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

I checked the the interop dll in "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files", but I can't find it here. I want to know why the dll isn't copied to temporary folder. I did the similar test for X86 mode, I can get it in "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files".

Thanks,

Gavin


Roc Over Sky

解决方案

 

Hi Gavin,

 

According to your description, I think you need to check whether assembly 'Interop.ALogWrapperLib' and its dependencies support X64 platform.

 

If some assemblies which will be loaded at runtime are only support x86 platform, this exception will be threw.

 

Sincerely,


这篇关于运行Web服务时无法加载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆