BUG: New Interop DLL Is Not Put in the Correct Location for the Project When a COM Component Is Added (820126)
The information in this article applies to:
- Microsoft Visual C++ .NET (2003)
SYMPTOMSYou can create a .NET Web service by using Visual C++ .NET. The Web
service uses the COM component to perform any complex logic. However, when you
try to access the Web service method that uses the Component Object Model (COM) component, you
may receive the following error message exception in the browser: System.IO.FileNotFoundException: File or assembly name
<Interop Assembly name>, or one of its dependencies, was not found.
CAUSEWhen you add a reference to a COM component in a project,
Visual C++ .NET 2003 creates an Interop assembly with the file name Interop.COM component filename.dll. When you build your Web service application, the build sequence
creates a virtual directory that is named Project
name in http://localhost. Then, the build sequence copies your Web service DLL to the newly created virtual
directory. Ideally, the build sequence would copy all dependencies to the virtual
directory. However, the build sequence does not do this. When the Web service calls the COM method, the Web service method
does not locate the Interop assembly, and an exception is thrown.RESOLUTIONTo resolve this problem, you can manually copy the Interop DLL to the
virtual directory that is associated with the project. Interop DLLs exist in the same
directory where your Web service DLL exists. STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 5/22/2003 |
---|
Keywords: | kbWebServices kbIJW kbCOMInterop kbbug KB820126 kbAudDeveloper |
---|
|