My company has login integration with GroupWise, and Exchange 5.5/2000+. The Exchange 5.5/GroupWise logic is done using wldap32.dll (win32), and so the login code is in a managed c++ class. When the configuration tool (or the backend service) tries to load the dll built off this managed c++ project on my XP development box, it works fine. On QA/Customer Windows 2003 boxes, a FileLoadException is thrown.
First off, this used to work fine. Secondly, I've validated the same working code on my box fails on the qa box.
How can I track down the cause of this exception?
Have you changed your development environment recently? In particular have you installed a service pack or new release of Visual Studio?
It appears you are linking against a C++ runtime that is not available on the client's server. You can use the Windows Event Viewer to identify the DLL failing to load, or if this shows nothing, use depends.exe to see what runtime DLLs are dependencies for your managed code.
Microsoft has moved to using side-by-side installation to handle "DLL hell", basically this allows multiple versions of a DLL to be installed (side-by-side) concurrently on a Windows installations and have applications load the correct version of the DLL at run-time. Recent releases of Visual Studio make use of this technology so I suspect this is the cause of your 'sudden' incompatibility.
Not to answer my own question, but support just updated the bug with the text following this paragraph. I'm still interested in thoughts on tracking down situations like this.
Resolved by downloading and installing the Visual C++ 2008 Redistributable
Package for Windows on the IMS:
http://www.microsoft.com/downloads/details.aspx?FamilyID=a5c84275-3b97-4ab7-a40d-3802b2af5fc2&DisplayLang=en
Related
I need to communicate with a legacy software wrote in Visual Basic 6 to launch a report (with output in pdf format) from a .net application (using full framework 4.5).
I have to istantiate an ActiveX COM Dll that internally use COM Crystal Report 11 runtime objects.
My .net application (which project target x86 platform) instantiate COM Dll "MyInterop.dll" which contains the class "Ambient" that runs the job..
do something like this (simplified code):
Type type = Type.GetTypeFromProgID("MyInterop.Ambient", true);
printerObj = Activator.CreateInstance(type);
printerObj.init();
printerObj.print();
If I run the application on a desktop system (in my case on Windows 8.1) everything works well!
If I move application on a Windows Server 2012 R2 (but I tried with a Windows Server 2016 too) it crashes!
I can not get a detailed error, I get "vshost32.exe has stopped working".
It's not easy to debug but It seems to crash when, in the code contained in the COM dll, attempt to read the report query string:
query = CRAXDRT.Report.SQLQueryString
(aobut CRAXDRT, I found on Dll Com Project a reference to
"Program Files (x86)\Common Files\Business Objects\3.0\bin\craxdrt.dll#Crystal Reports ActiveX Designer Run Time Library 11.0")
I cannot understand why, on a windows server system, the attempt to read the query string causes the application crash..
I do not know where to search information..
any suggestion is very welcome
Thanks in advance
Finally I found the solution:
1) first I have to modify exe binary of my .net application with this command (from VS cmd prompt):
editbin.exe /NXCOMPAT:NO [my binary path]
2) add the exe to the DEP exceptions (on Advanced System settings-> Performance option-> Data Execution Prevention)
Then it works!
I have a .NET application that regularly works on all the machines with .NET installed.
When I try to launch it on a PC with no .NET framework installed this happens:
it opens, i can change tab (my app has 4 tabs), it reads the computer IP without any problem, but then crashes somewhere when it receives a message from another terminal (i have a terminal that communicates with the PC via ETH-TCP/IP).
The message I get is just:
DESCRIPTION: stopped working.
The big deal is that I cannot debug it because if I install the .NET framework it magically works like a charm.
Obviously I'm asking this because we prefer not to install .NET on all the machines in the office (they run different Windows versions and plenty of them don't have the .NET installed).
My question can be similar to this one, but in my case the .exe starts (as I explained above).. the crash comes when I start the communication between the PC and the terminal.
Anybody has a hint for my problem? Thank you
EDIT : thank you for the answers, in the end I decided to do Remote Debugging by running the app on a virtual machine with no .NET at all. Now, when it crashes, I can catch the bad instructions inside VS2010 installed on the host machine.
Btw, the problem was on a .dll that couldn't be loaded
You must have the .NET Framework installed on a machine in order to run a .NET application. The .NET Framework is both a runtime and the SDK, not just an SDK. All versions beyond Windows XP come with some version of the .NET Framework installed.
If you are saying that installing Visual Studio corrects the issue (which is what the question you linked to describes), that is a different problem altogether. Unfortunately, your question doesn't provide enough information to troubleshoot it. You can check the Event Viewer on the machine experiencing the issue, then look for two errors next to each other in the Application event log. One of these errors will contain exception detail, which will aid us (or you) in tracking down the problem.
Here is a link to a sample application which reproduces the error:
http://sdrv.ms/17j2Ale
I have three projects. One is a .NET 2.0 Windows Forms application (.NET App), one is a VB6 Standard EXE application (VB App), and the other is a VB6 ActiveX DLL (VB DLL). The .NET App references the VB DLL which is already registered. This VB DLL essentially launches Crystal Reports. The VB App launches the .NET App via the Shell() command. Here's what happens:
If I run the .NET App directly, I can open a Crystal Reports document with no problem. However, when the VB App launches the .NET App via the Shell() command, when the .NET App attempts to open the Crystal Reports document, I get an Out of Memory error.
Now here's the kicker - this worked on Windows XP, but when we attempt to launch it in Windows 7 64-bit, we run into this issue. I'm sure there's got to be a simple solution out there for it. Any takers?
You can jump to Update 5 where I narrowed down the problem.
Update: I also tried creating a second .NET 2.0 Windows Forms application (.NET Launcher), and launched the .NET App from it via:
Process.Start(#"C:\Path\OtherApp.exe");
and when I tried open the Crystal Reports document in the .NET App it still gave me the same Out of Memory error.
Update 2: removed due to update 4
Update 3: So today I discovered that the reason the .NET App was able to open the report when it was launched directly was because I was launching it within Visual Studio. When I tried the executable outside Visual Studio, the error returns. I noticed that Visual Studio, as of 2005, began using a vshost.exe to launch windows applications to speed up debugging startup: http://blogs.msdn.com/b/dtemp/archive/2004/08/17/215764.aspx
When I disabled the vshost feature, the out of memory error returned. So I suppose the question is, what is this vshost process doing that allows it to work on windows 7?
Update 4: I was able to compile the VB6 DLL with debug information and load the source and debug information into Visual Studio and step through it when the .NET app executes the VB6 code. The Out of Memory exception comes from this line:
Dim myForm As frmTheForm
Set myForm = New frmTheForm 'OOM Error right here
So inside the vshost.exe this form is able to initialize but not without it.
Update 5: I have narrowed down the problem to the Crystal Reports ActiveX Viewer. I started a new VB ActiveX DLL project from scratch and started with only a form. This worked every which way. Then I added the Crystal ActiveX Report Viewer Library 11.5 - and the error returned! It is definitely the Report Viewer. I'm told that this problem may be able to be fixed by a simple registry adjustment.
Update 6: I used Procmon.exe from Sysinternals and generated a logfile that can be found here:
http://sdrv.ms/194aO7A
I've got such problems when I use 32Bit C/C++-Dll's with .NET code running on 64Bit Windows.
If your .NET project has "any platform" as target then the runtime compiles the code to 64Bit on a 64Bit Windows, on a 32Bit Windows I think you'll have no problems.
You have to set your target platform to "x86", you wrote you did this. Please verify that all your .NET projects in your .NET solution are set to x86 as target.
The Crystal Reports *.dll should be a 32Bit COM *.dll, and the VB6 *.dll too.
I found a workaround solution to the out-of-memory error; however, it is not an allowable solution. Apparently, this issue is resolved in future versions of the crviewer.dll but Mister Uher makes it very clear in his response to my question here: http://scn.sap.com/thread/3405856 that we are not allowed to use the versions after 11.5 due to licensing restrictions. It would seem this is a common question he receives. Unfortunately, we are forced to accept the response that we are to upgrade our applications to .NET. If anyone else is feeling adventurous enough to attempt to troubleshoot the out-of-memory exception, I would am happy to leave my sample project above available to anyone who wishes to venture it. Best of luck to anyone else feeling my pain of CR 11.5 interop support.
Not sure if this information will help, but I have faced similar problems in the past with crystal and a Web Forms applications. I resolved it by ensuring that the application pool has the 'Enable 32 bit applications' option checked? You can find it under the advanced settings -> General....
I have added the Acrobat com object in my application and use it successfully while debugging under visual studio.net 2010 framework 3.5, but whenever I deployed my application in IIS 7 and tried to browse the application, I got the error unable to load Interop.Acrobat
please help
Regards
Ahsan
One potential reason is x86/x64 mismatch - VS test host is 32 bit only, but IIS defaults to x64 on x64 OS.
Note: you are likely to run into troubles by using client application from server side code. There could be better options if you actually state what you want to achieve instead of what you want trying to do.
When you deploy the application, you will need to copy the automatically created Interop dll that was created in your bin directory.
I developed a winform application using C# in visual studio 2008. Now i want to run the exe on another PC which doesn't have .net framework or Visual Studio. I am sending the application using Zip via email. The second PC downloads that application and extracts into a normal folder and then it executes the exe file.
But i am getting the exception that .net frame work v 2.0 must be installed.
Can you please tell me how to run that exe without .net frame work installed?
(Amended for #Merhdad's sanity :-))
The short answer: You can. You shouldn't.
The long answer: You could technically create your own unmanaged bootstrapper that goes and download the .NET client profile redist and silently installs it using the MSI APIs, and then loads the CLR and hosts it in the process in order to execute the managed code, after which it silently uninstalls the .NET Framework from the machine.
The Disclaimer: I know few people that could pull that off. They would be the first to tell you not to do it.
The alternative hack answer: You can also use one of the tools #Mehrdad mentioned. i can't comment whether they work or not. However, you should be aware that this leaves your app linked to a specific snapshot of the .Net framework code, and for every security update you need to take, yuo have to relink and release an update of your application as well.
The alternative open source answer: You could ensure your WinForms app builds and runs on Mono, and deploy Mono side-by-side with the app. I've heard it supports that scenario.
The alternative IT answer: You could create a VM appliance with stripped down Window image that has .Net and your app only, and ship it as a single executable.
The right answer: Create an installer for your app that installs the .NET Framework for your customers.
Yes! You can do this with a variety of programs, and Spoon seems to be among the most up-to-date ones.
(Of course, this doesn't mean that you should, just that you can.)
This cannot be done. You must have the .NET Framework in order to run the application.
I solved the problem.I added a package in visual studio.I added Setup and deployment as a new project to my solution.later i added exe to that package.so if client machine runs the setup it'l create exe and can run the application successfully.
yeah,you can do that by converting your whole application to an installer.just check it out, it will helps u a lot
http://www.youtube.com/watch?v=PCnfGUT-K-4