By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,811 Members | 785 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,811 IT Pros & Developers. It's quick & easy.

How to make seamless interop between Managed C++ & native C++ in web service?

P: n/a
I have one webservice written in MC++, which uses another native DLL
deployed in %webservice_install_dir%\bin folder. The API invocation
between MC++ and native C++ looks seamless. The compilation is fine.
However, after deployment, each request fails with "The specified
module cound not found" exception.

It turns out to be the Managed assembly is copied to someplace at
runtime. In my machine, it is "C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\Temporary ASP.NET Files\root\5c0b5088\d4448a2e\assembly
\dl3\74696405\8e22ec8e_55cfc701". And the native DLL is still in
"%webservice_install_dir%\bin". I tried copying the native DLL to the
"C:\Windows\...." foldeer, and then the service works fine.

This is annoying. Is there any way to make the Managed assembly find
the native DLL, even after it is copied to another place?

Thanks.

#######################

[FileNotFoundException]: The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, Assembly loca
ionHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound,
Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyNa me
assemblyRef, Evidence assemblySecurity, StackCrawlMark& stac
Mark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMa
k, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at
System.Web.Configuration.CompilationSection.LoadAs semblyHelper(String
assemblyName, Boolean starDirective)
[ConfigurationErrorsException]: The specified module could not be
found. (Exception from HRESULT: 0x8007007E)
at
System.Web.Configuration.CompilationSection.LoadAs semblyHelper(String
assemblyName, Boolean starDirective)
at
System.Web.Configuration.CompilationSection.LoadAl lAssembliesFromAppDomainBinDirectory()
at
System.Web.Configuration.CompilationSection.LoadAs sembly(AssemblyInfo
ai)
at
System.Web.Compilation.BuildManager.GetReferencedA ssemblies(CompilationSection
compConfig)
at
System.Web.Compilation.WebDirectoryBatchCompiler.. ctor(VirtualDirectory
vdir)
at
System.Web.Compilation.BuildManager.BatchCompileWe bDirectoryInternal(VirtualDirectory
vdir, Boolean ignoreErrors)
at
System.Web.Compilation.BuildManager.BatchCompileWe bDirectory(VirtualDirectory
vdir, VirtualPath virtualDir, Boole
n ignoreErrors)
at System.Web.Compilation.BuildManager.CompileWebFile (VirtualPath
virtualPath)
at
System.Web.Compilation.BuildManager.GetVPathBuildR esultInternal(VirtualPath
virtualPath, Boolean noBuild, Boolean
allowCrossApp, Boolean allowBuildInPrecompile)
at
System.Web.Compilation.BuildManager.GetVPathBuildR esultWithNoAssert(HttpContext
context, VirtualPath virtualPath,
Boolean noBuild, Boolean allowCrossApp, Boolean
allowBuildInPrecompile)
at
System.Web.Compilation.BuildManager.GetVPathBuildR esult(HttpContext
context, VirtualPath virtualPath)
at System.Web.UI.WebServiceParser.GetCompiledType(Str ing inputFile,
HttpContext context)
at
System.Web.Services.Protocols.WebServiceHandlerFac tory.GetHandler(HttpContext
context, String verb, String url, S
ring filePath)
at System.Web.HttpApplication.MapHttpHandler(HttpCont ext context,
String requestType, VirtualPath path, String pathT
anslated, Boolean useAppConfig)
at
System.Web.HttpApplication.MapHandlerExecutionStep .System.Web.HttpApplication.IExecutionStep.Execute ()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)
-->
--.
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage
message, WebResponse response
Stream responseStream, Boolean asyncCall)
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
at DynamicRatingService.EvaluateUri(String lookupUri, Int32 flags,
Int32& status)
at msncf.DYRTest.DYRTest.getPageRating(DynamicRatingS ervice dyn,
Int32 inFlags, String url, Int32& outFlags, ArrayLi
t& cats)
at msncf.DYRTest.DYRTest.processURLS()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Jul 26 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.