I have a Windows Application that worked once before on .NET 2.0, and I just wanted to bring it forward to .NET Framework 4. I've done this hundreds of times before without issue.
Long Story Short: After upgrading, I can run the Windows Application (Written in C#) from both Debug and Release Modes. All of My Assemblies are set to build targeting (x86) to make sure that any 32-bit dependencies will run on Windows 7 x64. The strange thing is that when I run the executable from the bin\x86\Debug or Release directories, nothing happens. Literally nothing. The application starts then immediately stops, and there are no error messages, no crashes, no items written to the event log. It just starts and then stops.
The crazy part is if I switch the project output type to "Console Application", then it works to run it from an exe file! (Just have an annoying and ugly console window in the back of the application while it's running).
Has anyone ever heard anything like this before?
Here are the things that I've tried and more information:
- Looked for any mention of errors in the event log
- Tried running as Administrator
- I'm already the computer administrator with Full Access to All directories
- Tried putting MessageBox.Show statements in Main() function
- Tried putting Console.WriteLine statements in Main() function
- Tried making Main functions public.
- Tried starting the application exe by double clicking it and also running it from the command line (console output didn't appear in that case).
- Tried executables compiled for Debug AND Release
- Tried removing the call to start the MainForm.cs, where just the MessageBox code remains.
- Other Windows Forms applications that are pure .NET 4.0 run fine from their executable.
- The .NET Framework 4.0 doesn't appear to be corrupted, however, I haven't tried reinstalling it in its entirety.
- Tried adding a try / catch in the main function to catch and report any errors.
- Windows 7, 64-bit
- Visual Studio 2010
- Windows Updates performed regularly
- C# for all code
Has anyone seen anything like this? I've been working with C# for over 14 years and haven't seen this behavior before.
Aucun commentaire:
Enregistrer un commentaire