No interface found but works fine everywhere else? - asp.net

I have an ASP.NET website I migrated/converted from classic asp to v4.0
There is a 3rd party DLL which is used and I need to register it using regsvr32.
Now all of this works just fine on my local dev environment but also on a test webserver. My environment runs WS2008R2 Enterprise + all updates and iIS 7.5
The test environment using WS2008R2 Std + all updates and IIS 7.5
I have created several virtual machines with a plain environment to test deployment and that works fine.
The live one however causes a problem. That is running WS2008 Std + updates and IIS 7.0.
When getting to the page in question, I get a runtime error and NO idea where to go about this:
Unable to cast COM object of type 'TAMOnlineUtils.clsMainClass' to interface type 'TAMOnlineUtils._clsMain'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{B0B5FC90-90A9-4DD9-A4C6-D779C905B322}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, Boolean& pfNeedsRelease)
at TAMOnlineUtils.clsMainClass.GetCertFileList(Object& sPath)
at TAMOnlineWebsite.Report.CalDisplay.DoDisplayCertAndData()
Any ideas anyone? Completely stumped.

Problem fixed.
There seemed to have been a culprit of the same DLL (perhaps different version) but located in C:\Windows\System32
Not sure why or how that was done but after unregistering that DLL and then deleting the DLL, everything seemed to have worked just fine.
Regression testing is being done on other possible apps affected by the removal of that DLL but it appears its all working fine.
So yes, a conflict there!

Related

How to Debug Com dll (accessed through Interop) in IIS 7.0( Windows Server 2008 R2) invoked from ASPX Page using VB 6.0

Can anybody tell how to debug the Com Dll in IIS 7.0 using VB 6.0 in Windows Server 2008 R2.
I am able to hit break point in VB 6.0 accessed from Console Application using interop dlll.Through ASPX pages in IIS 7.0 I am getting the following Exception
Unable to cast COM object of type 'XCreateUser.XAcctUserProfileClass'
to interface type 'XCreateUser._XAcctUserProfile'. This operation
failed because the QueryInterface call on the COM component for the
interface with IID '{7A48FABA-CCC8-4FA6-94E8-803F6CF121F2}' failed due
to the following error: Error loading type library/DLL. (Exception
from HRESULT: 0x80029C4A
Already DLL built and registered and com interop dll generated.
Please somebody show some light on this
Already DLL built and registered
"Registered" is the problem here, it wasn't correctly registered. This is an exception message that's generated by the CLR when it tries to locate the proxy for a .NET component that is [ComVisible]. A proxy is required to make a call to a COM component from a worker thread that doesn't do anything to help make the call thread-safe. A thread that's in the MTA, usually a thread-pool thread.
A .NET component is registered with Regasm.exe. You forgot to use the /tlb argument.
Should be simple to fix. If you still have trouble then SysInternals' Process Monitor is the weapon of choice.
I generally debug these things as you say through a console or windows forms application. You can always add logging to your web app to see what parameters are being passed to it.
Generally errors like the above are setup issues when running on a 64 bit platform and when utilizing 32 bit dlls. One thing to make sure of is that your application pool allows 32 bit applications. In IIS Manager right click on the application pool your website is running under and go to Advanced Settings->Enable 32 bit Applications. Set that to True.
You'll also need to make sure that your 32 bit dll is registered in the 32 bit registry hive. C:\Windows\syswow64\regsvr32 is the version you'll need to use to register this dll.

ASP.NET - Couldn't publish my web site in windows server 2008 r2

First of all I publish my website in windows 7 and everything goes alright.
But when I'm trying to publish the same website in windows server 2008 r2 I got this error:
Server Error in '/MyWebsite' Application. Could not load file or
assembly 'System.Net.Http' or one of its dependencies. Strong name
signature could not be verified. The assembly may have been tampered
with, or it was delay signed but not fully signed with the correct
private key. (Exception from HRESULT: 0x80131045)
Can any body help me, please!! I looked for this error for days now and I got nothing to do.
Thanks in advance!
It seems you not copied your dll to your another website in window server 2008 r2
if you already copied .dll to your 2008 iis then ..
First check
Both are system are running in same 64bit or 32bit ?
If not then
1.Open IIS Manager
2.Select Application Pools
3.then select the pool you are using
4.go to advanced settings (at right side)
Change the flag of Enable 32-bit application false to true.
Another solution
1- check if you are referencing an assembly which in turn referencing an old version of unity. for example let's say you have an assembly called ServiceLocator.dll which needs an old version of Unity assembly, now when you reference the ServiceLocator you should provide it with the old version of Unity, and that makes the problem.
2- may be the output folder where all projects build their assemblies, has an old version of unity.
you can use FuseLogVw application to find out who is loading the old assemblies, just define a path for the log, and run your solution, then check (in FuseLogvw) the first line where the Unity assembly is loaded, double click it and see the calling assembly, and here you go.
There are many other possibilities..

strange exception in ASP.NET web service when running on IIS

Got some strange problem.
I'm developing some complicated Web Services network that uses some VB6 .dll. In my previous post I got some problems with the dll but we've solved them.
So, the new problem is:
When I debug my service (those which uses VB6 dll) on development server from visual studio - everything works fine, the problem starts when I publish my service on IIS (I tried my local IIS). After that, when I call .dll method (as I understand I need to call it by reference - and that's what the compiler tells me) I got an exception:
"System.Runtime.InteropServices.COMException (0x800A000D): Type mismatch at ..."
Actually is happens here in the third line:
Object s = (Object)OrderId;
Object s1 = (Object)lines.Length;
proxy.OrderRead(ref s, ref s1);
OrderId and Legth are integers.
As I understant this is exception that comes from the .dll from vb6 :/
What the problem may be? Why it runs when debugging but fails on IIS?
When debugging in vb6,the IDE will register the dll for you. After publishing, have you may ahve to register your vb6 dll on the server. Open a command prompt and change to the location of the dll and run regsvr32 myvb6.dll.
Also, check these settings.
http://support.microsoft.com/kb/281630

ASMX web service crashes when using vb6 .dll

I got a new problem while using vb6 dll in my Web Services. When using dll, the object instance is created fine but when I start calling it's method from my service I got this exception:
Server was unable to process request. ---> Unable to cast COM object
of type 'WS_Resevat_DLL.WS_ResevatCLClass' to interface type
'WS_Resevat_DLL._WS_ResevatCL'. This operation failed because the
QueryInterface call on the COM component for the interface with IID
'{69F1DA59-56D1-47CE-94A4-D681ABECDF80}' failed due to the following
error: No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE)).
The whole system runs fine when I test it on my computer IIS (I have Windows 7 with IIS 7). The problem starts when I publish it on server (Windows Server 2003 with IIS 6). I'm using asp.net 3.5 web services with SOAP 1.1. The VB dll is from the third part and I sadly can't debug it (the only thing I checked with dll creator is that binary compatability is enabled, I don't know VB at all), but when it runs outside the service (on Win Server 2003) it works fine.
Some explanation bout the types (WS_ResevatCLClass and WS_ResevatCL). In origin the dll has only one type: WS_ResevatCl. But when I look at the dll in component explorer in Visual Studio I see strange things - there is a class called WS_ReservatCLClass and 4 different interfaces: _WS_ResevatCL, WS_ResevatCL, WS_ResevarCL_v0 and WS ResevatCL_v1. And the most strange thing is that I can create instance of one them (WS_ResevatCL) and it drives exactly like an instance of the class.
Are there any significant differences between Win7 and WinServer2003 that can cause the crash with such exception?

"The specified module can not be found" in asp.net application

I just tried to copy my entire web application to a new instance of Visual Studio 2008 on another (virtual) machine.
It builds just fine, but when I try to run the applicaton I just get the message "The specified module could not be found".
Does anyone have an idea how I can find out which module this message refers to? Because there are quite a lot, and as far as I can see they're all installed.
I would suggest you delete all the temporary ASP.Net files for your project and then do a rebuild. This will ensure all the new code is recompilled and no old references remain.
Sometime simply building the solution doesn't work and you need to rebuild instead to force it to either show you the real error or get the references correct.
If your project uses COM and an interop assembly, you'll be able to build (because the assembly is there), but raise a runtime exception if the COM server is not registered on the new machine.

Resources