Asked by:
Could not load file or assembly interop.searchapi.

Question
-
Hi, since a few days, I have the following error when I try to access the home server web site :
"Could not load file or assembly 'Interop.SearchAPI' or one of its dependencies. An attempt was made to load a program with an incorrect format."
I enabled fusion log and the search path is the following :
=== Pre-bind state information ===
LOG: User = NT AUTHORITY\NETWORK SERVICE
LOG: DisplayName = Interop.SearchAPI
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Interop.SearchAPI | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Program Files/Windows Server/Bin/WebApps/RemoteAccess/
LOG: Initial PrivatePath = C:\Program Files\Windows Server\Bin\WebApps\RemoteAccess\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files\Windows Server\Bin\WebApps\RemoteAccess\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/remote/b30c9c29/40b6d979/Interop.SearchAPI.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/remote/b30c9c29/40b6d979/Interop.SearchAPI/Interop.SearchAPI.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Windows Server/Bin/WebApps/RemoteAccess/bin/Interop.SearchAPI.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
The stack dump is :
[BadImageFormatException: Could not load file or assembly 'Interop.SearchAPI' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +144
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[ConfigurationErrorsException: Could not load file or assembly 'Interop.SearchAPI' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +618
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +209
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +94
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +332
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +591
[HttpException (0x80004005): Could not load file or assembly 'Interop.SearchAPI' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8946484
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256
The file is present at C:\Program Files\Windows Server\Bin\WebApps\RemoteAccess\Bin and I am able to open it with reflector. So, it is neither missing nor corrupted, so I suspect it is missing a dependency.
I supposed I possibly removed windows search, thinking it is not needed, but I can't find it anywhere in the feature list, so, I supposed this is not it.
I tried to reboot the machine and I still have the problem.
Can someone tell me what can possibly be missing? I configured it to take a backup of itself twice a day, so, I can restore a file if needed.
Monday, March 21, 2011 10:53 PM
All replies
-
Got it. I am sure it is not the main reason of the failure, but it make it work. I switched the application pool to "not 32bit". In other words, I accessed the advanced properties of the "remote app pool" application pool and configured "Enable 32-bit applications" to false.
I suppose it only switched to framework 4 64bit and this version is not missing the file it was looking for. I suppose I would resolve the previous issue by reinstalling framework 4, but I will leave it as it is for now.
Hope this help someone.
Monday, March 21, 2011 11:08 PM