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
Related
Whelp, I avoided it as long as possible, but the time has finally come to make some changes to some ancient VB6 code. I'm a recent college grad so I was hoping to stay away from this code that is almost as old as I am.
The DLL is compiled in a local installation of VB6 and deployed via Component Services. That component is then called by VBScript in a Classic ASP application running on a windows 2003 Server.
I've tried just about everything to debug this code using the VB6 debugger, but I can't get it to work. I've compiled the DLL to the same location that Component Services has it deployed to (a random folder on a non-system drive), and set binary compatibility to that same DLL. Each class file has instancing set to MultiUse and MTSTransactionMode set to '1 - NoTransactions.' The component works fine until I attach the debugger, then I get 'ActiveX component can't create object' when trying to instantiate the object. If I detach the debugger, it works again.
I noticed that in Component Services when I attach the debugger, the DLL location changes to C:\Program Files\Microsoft Visual Studio\VB98\VB6DEBUG.DLL, which I assume is just VB6 intercepting calls to the component. When I detach the debugger, it changes back. I should also note that the component is configured to use a specific user identity separate from my logged-in user account, however everyone has been granted access to the component via a user role. The component activation type is also 'Server Application,' however setting it to 'Library Activate' doesn't seem to make a difference.
I've also tried using the VC++6 IDE, and VS2010, but had no luck. I was able to debug the dllhost.exe in VS2010 and was able to hit some breakpoints, but the symbols weren't loaded properly. I tried compiling the DLL with debugging symbols and loading those to the VS2010 environment via the Debug settings menu, however that didn't resolve the issue.
I also didn't find the component services JIT Debugger to be very useful. I'd much prefer to just be able to debug in VB6.
What amazes me most is that this code is thousands of lines and has been maintained without the use of any debugger whatsoever. My young, spoiled self isn't ready to accept that this code can't be debugged.
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..
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!
I have C++ project that compiles as DLL Assembly in .NET 3.5 SP1
Project is used for Image rendering processing by using WPF (it loads 2 images from local folder, applies one image on another and saves the output file in the same folder).
I want to use that that project as a reference in ASP.NET project to the rendering on the website.
So I created simple Web Project in ASP.NET C# that uses C++ project as a Reference.
Everything works great in ASP.NET Web Development Server (built-in Web server in VS2008).
But once I publish this project to IIS on the same Machine or use IIS for debug instead of built-in Web server Image rendering it's not working anymore. I'm not getting any exceptions or error messages, it just output image is not processes as it supposed to be.
If anyone know what could cause that I would really appreciate your insight!
Do you have access to the Event Logs? You should check there for any errors. You should try to throw an exception from a C#-only code path and make sure that everything is OK and regular exceptions are being thrown. Is the C++ compiled to managed code, or is native code? You might find that ASP.NET does not have the appropriate code access security permissions and needs to be registered in the GAC of the server to accessed from C#.
You should also check whether the DLL is thread-safe. This has caused issues for other users in ASP.NET/IIS.
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.