473,386 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
0 1449

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nadav | last post by:
Hi, Introduction *************** I have a system build of a collection of 'Native COM objects' and '.NET COM interop' objects, all of the COM objects are managed through a 'Native COM' layer,...
1
by: Jim | last post by:
Hello, I am writing an application that relies heavily on interop between managed c++ and native c++. The main project is managed c++, but most of the classes themselves are written in native...
4
by: Robert Ginsburg | last post by:
I have an ATL DLL that hosts a COM object. Without managed extensions the object compiles and works fine. Now with some assistance from Will DePalo (on a different thread in this group) I figured...
9
by: Lloyd Dupont | last post by:
If I write a pure C# application, only using the standart publi API, no interop, the same binary should work well on32 bit, 64 bits and perhaps on the compact framework as well if I link against...
2
by: Richard Collette | last post by:
Hi, I have a service, that runs perfectly when executed outside of the web service environment. When called as a web service I get the exception listed below sporadically. A call to the web...
12
by: Lloyd Dupont | last post by:
I have an application which use has a DLL with 100+ (auto-generated) Managed C++ wrapper around some native API. Compare to a purely version my application has some performance issue and I just...
2
by: Haroon_Saeed | last post by:
Hey, I wrote a managed c++ class library in viusal studio 2005. This managed c++ dll calls native C++ methods of an SDK. When I referenced this managed c++ library in a console applciation...
3
by: ajtaylor | last post by:
Hello, I wonder if anyone can help lift the cloud of confusion hanging over me at the moment ;-) I have a load of unmanaged code in a project that I am compiling NOT USING /CLR I have some...
4
by: =?Utf-8?B?SGVyYg==?= | last post by:
Can someone point me in the direction of documentation for Office Interop? Specifically, Microsoft.Office.Interop.MSProject. Mainly what I need is a command set, programming documentation. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.