views:

620

answers:

6

Has anyone seen this?

There is a few second delay, then one of those dialog boxes saying "Yada Yada has encountered a problem and needs to close. We are sorry for the inconvience." (This is weird because my program has an exceptional handling system that gives useful error messages if the exception is thrown within my code, but it is clearly not reaching that point: this dialog is the same sort of thing you see if you try to run a .NET program on a machine without .NET installed.) This same binary runs on other Windows systems.

I tried reinstalling .NET 2.0. I tried Removing it (won't allow me). I tried "Change"ing it (nothing apparently changes). I tried republishing my project (ClickOnce) and it still works on other machines but not on my development machine, except within Visual Studio. I tried Removing that installed ClickOnce project and reinstalling, but it still will not launch the program.

The closest thing I've found is this (read his Clarification) but none of those solutions worked.

I'm considering renaming the program and republishing and reinstalling to see if it has something to do with the mysterious GAC or the evil registry but.

A: 

have you tried the redistributable ( vcredist_x86.exe )?

ryansstack
Are you making a project with DLLs ? Do you have to register them?
ryansstack
Good point. My Prerequisites include that but each time I tried to install, it would hang so I would cancel and just click launch. UPDATE: I just let it run that install and it tries to launch the application but still has the same problem. (probably because when it finishes, my default browser is launched (Firefox) which can't handle the .application file type). Ugg. I hate this stuff. Tried letting IE be default browser and still needed to reinstall the VC Redist... it's not installing correctly otherwise it wouldn't ask for it each time I clicked the Install button or little launch link. :(
Jared Updike
The VC redistributable should not be needed for a pure .NET project.
0xA3
This is really weird since I have another .NET program with C++ Redist prereqs and it installs/updates just fine. It seems this one assembly is gummed up. I'll try renaming it and republishing to a new URL and see where that gets me.@ryannsstack: My project has dozens of DLLs. How do I register them short of just using the ClickOnce stuff? Other projects with a superset of the DLLs install/publish correctly. Somehow this one got gummed up. (I think I had an annoying earlier problem with access or cache jargon...)
Jared Updike
There is a mixed managed/unmanaged DLL in there.
Jared Updike
I think the problem is vcredist related or else that component would install correctly.
Jared Updike
regsvr32.exe <dllname.dll>regsvr32.exe <dllname2.dll>etc
ryansstack
in a command line prompt, that is.
ryansstack
+1  A: 

do you have anything that catches and reports unhandled exceptions in the application events section?

Maslow
My binary is not launching at all, otherwise it would hit my exception handler (I would hope), so I don't believe it's in my code... I mean, it's perfect (at launching) on other machines and from VS.
Jared Updike
still you may want to put something in that section just to see if it does catch anything.
Maslow
@Maslow: I did put something in there: I have a global exception handler that works great when the program actually runs. As I noted, it's not even running the .NET code at all or it would hit my exception handler and give me a .NET error instead of a Windows error.
Jared Updike
can you show us the code for your global exception handler and how/where it's being injected? Also check the windows event log on that machine, it might have some more detailed information there.
Maslow
+1  A: 

Check the Application Event Log using the Event Viewer. You probably won't get a lot of information, but sometimes it can point you in the right direction.

It does have an error every time I try to run it:Event Type: ErrorEvent Source: .NET Runtime 2.0 Error ReportingEvent Category: NoneEvent ID: 1000User: N/ADescription:Faulting application myapplication.exe, version 1.0.0.0, stamp 49fbbc29, faulting module kernel32.dll, version 5.1.2600.5781, stamp 49c4f482, debug? 0, fault address 0x00012afb.
Jared Updike
A: 

have you tried manually copying the exe and supporting files to the machine instead of using publish? Also not that you want to go through the hassle, but on our machine that occasionally has a problem like this we have a copy of Visual Studio installed, so it comes up with a debug or close prompt, we hit debug and copy down the source code file it asks for and we get to see more details.

Maslow
Yes, as I mentioned I can go into the Release directory and copy all of the DLLs and EXE to a new folder and double click the .exe and it crashes before running my code. The same folder of manually copied DLLs and EXE will run fine on other machines.
Jared Updike
A: 

It doesn't run when you double-click your compiler output directly? If so, What's usually solved this for me, is specifying Copy Local = True for all DLLs referenced in the project.

Dov
Can't figure out how to do this in VS 2005. Where do I click to find "Copy Local"? I found "Copy to Output Directory" and set it to "Copy if newer" but I don't see how this will help me since my Release folder has all the requisite DLLs and EXE, and this same folder manually copied to another machine allows the .exe to run without a hitch.
Jared Updike
If you have the Solution Explorer and Properties palettes visible (View->Solution Explorer and View->Properties Window, respectively), expand the References pseudo-folder of your project, which should expose your referenced assemblies. When you select one of the referenced assemblies, its properties display in the Properties window, one of which is "Copy Local", below "Aliases" and "(Name)" (some of the others, which are read-only, include "File Type", "Identity", "Path", "Resolved", "Runtime Version", "Strong Name", and "Version")
Dov
@Dov: No luck. The only DLLs with Copy Local = False were System.* and changing that to True indeed copied them to the output folder, but running the .exe from the Explorer (by double clicking) still does not launch my program.
Jared Updike
Have you tried running it on another computer?
Dov
@Dov: yes, and it runs fine if I copy the folder to another computer
Jared Updike
+1  A: 

I'd also suggest doing the manual copy of the EXE and Dll's to a directory, and getting yourself a copy of Reflector and open your main application exe with reflector, then walk through all the references. Maybe there is some dependency where it is expecting a different version or something in the Gac that is older and you thought you'd removed it.

Also find the entry point in your program and see what Reflector thinks it is doing.

Paul Farry
I think I'll try this.
Jared Updike
BTW is this Red Gate's Reflector you're talking about?
Jared Updike
yes Redgate's Lutz sold it to them
Paul Farry