Frage

My app runs fine on my machine (of course/famous last words). However, when deploying it to another machine on the network, it won't even start up. I ran my EventLog utility on that machine and it told me this:

Type:Error
Source: .NET Runtime
Time Generated: 06/12/2012 15:35:12
Message: Application: duckbilledPlatypus.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeInitialization
Exception
Stack:
   at duckbilledPlatypus.PlatypusMainForm..ctor()
at duckbilledPlatypus.Program.Main()

So it's something in my main form's constructor that's the problem, apparently...which, I admit, is a little "busy":

InitializeComponent();

foreach (string arg in Environment.GetCommandLineArgs())
{
    if (arg == "-DEBUG")
    {
        InDebugMode = true;
        break;
    }
}

SuspendLayout();
tsch = new ToolStripControlHost(dateTimePickerScheduleDate);
toolStripPlatypusMain.Items.Add(tsch);

CreateTableLayoutPanelAndChildren();

LimitPlatypusIDTextBoxesToOneChar();
ShareEventsAmongDynamicTextBoxes();

SetAllPlatypusDataControlsReadOnly();
ResumeLayout();

Does any of this look problematic? (it's all pretty standard stuff, except for the ToolStripControlHost).

Now as to the framework version: does the Event Log report the framework version used to create my app, or the framework version installed on the machine trying to run the app? If the former, and the latter does not have that framework installed, that's a problem, right?

So if that's potentially the problem, how do I determine which version of the .NET runtime is installed on that machine?

UPDATE

I don't know why this is, but I was able to see an err msg after running the app on the remote/deployment only when I right-click and select Run As (and ran as myself, as I don't have any "more special" privileges on that machine). When I did so, I got "Unable to find a version of the runtime to run this application."

If I simply 2-click the app, it dies without a whimper (no err msg).

War es hilfreich?

Lösung

View the

view the %WINDIR%\Microsoft.NET\Framework directory

to determine which versions of .NET are installed.

http://msdn.microsoft.com/en-us/library/y549e41e.aspx

Try running the Fusion Log Viewer on the problematic machine. It will provide details about binding failures.

http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.100).aspx

Make sure you run it as administrator. It silently fails if you do not.

UPDATE

Based on your error "Unable to find a version of the runtime to run this application.", I would suggest you don't have the same version of .NET installed on the box that your application targets. Did you verify the installed versions using the steps above?

Also see

.Net framework - "unable to find a version of the runtime to run this application"

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top