2009-07-23 86 views
1

我有一个使用库的ASP.net WebService,它对某些第三方.dll具有依赖性。尝试使用库时COMException

如果我添加到我的web服务到库的引用,我得到一个收到COMException,我不能加载网站。我认为这可能与使用aspnet用户凭据有关,所以我试图在machine.config中模拟和使用processModel,但似乎没有任何工作。

的.DLL文件是有,所以我甚至不使用它们的服务器上的图书馆只是其他部分硬件通信,有没有什么办法可以解决这个问题?

我在Windows XP专业版SP3运行与Visual 2008 SP1和.NET 3.5。

我想修复它的唯一办法,是将库分成基于硬件和非硬件。

干杯,Sarkie

The specified procedure could not be found. (Exception from HRESULT: 0x8007007F) 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Runtime.InteropServices.COMException: The specified procedure could not be found. (Exception from HRESULT: 0x8007007F) 

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 


[COMException (0x8007007f): The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)] 

[FileLoadException: A procedure imported by 'OBIDISC4NETnative, Version=0.0.0.0, Culture=neutral, PublicKeyToken=900ed37a7058e4f2' could not be loaded.] 
    System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0 
    System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43 
    System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127 
    System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142 
    System.Reflection.Assembly.Load(String assemblyString) +28 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46 

[ConfigurationErrorsException: A procedure imported by 'OBIDISC4NETnative, Version=0.0.0.0, Culture=neutral, PublicKeyToken=900ed37a7058e4f2' could not be loaded.] 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613 
    System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203 
    System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105 
    System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178 
    System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) +163 
    System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) +53 
    System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors) +175 
    System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +83 
    System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +261 
    System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101 
    System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +83 
    System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath) +10 
    System.Web.UI.WebServiceParser.GetCompiledType(String inputFile, HttpContext context) +43 
    System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +180 
    System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +102 
    System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +193 
    System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 




-------------------------------------------------------------------------------- 
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082 
+0

您是否有用于OBIDISC4NETnative.dll的DllImport? – 2009-07-23 08:21:12

+0

我只是参考它。 我已经反映了这两个.dlls,他们有一些DLLImports。 – Sarkie 2009-07-23 09:04:50

回答

1

感谢金Gräsman设置我在正确的轨道上。

究其原因,程序缺失,是因为asp.net加载从%WINDIR%\ SYSTEM32不是当前目录中的.dll。

寻找在那里,都是一些很旧版本的.dll(不知道谁/他们是如何到达那里)的。删除这些显示一个FileIOException,所以用最新的.dll替换这些似乎已经修复它。