Posted By: amit_trehan | Nov 2nd, 2007 @ 9:55 AM
page 1 of 1
Comments: 12 | Views: 22708
Hi, I have a .NET 2.0 win app (VB.NET), that is working perfectly fine on the machine where it is developed. But when deployed on any other machne crashes on startup without any eror massage. If checked in the application log the following is the erro

"EventType clr20r3, P1 dnvpilot.exe, P2 1.0.0.0, P3 472b251b, P4 dnvpilot, P5 1.0.0.0, P6 472b251b, P7 14, P8 e9, P9 system.invalidoperationexception, P10 NIL."

Please suggest , its very urgent.

Thanks

Is this a ClickOnce deployment?

Are you using threading?

More details..

hi Smiley

am Ahmed "not the first person who asked u and stopped responding Tongue Out "

 

i have the same problem ...

i have a windows application developed using C# vs 2005

we also used WCF technology!

and yes ... we are using threading , and ClickOnce deployment
but we changed the ClickOnce deployment to ordenary one!
and we still facing this problem :

Event type clr20r3,P1 civilRegistrationApplication.exe, P2 0.1.0.0, P3 475195ff, P4 system. Servicemodel, P5 3.0.0.0, P6 4545a17d, P7 ef, P8 0, P9 system.typeinitialization, P10 NIL

plz help!!

vbrunner__
vbrunner__
code monkey
my first suggestion is to make sure that .NET 2.0 is properly installed on the client machine.  many times stock XP machines are missing various dlls in the GAC if they have not touched the internet in a while.  Just run the setup.exe that is deployed with your ClickOnce deployment, then try it again.

if that doesn't work, try one of the two following things:
1. Create a Setup project that only installs all the detected dependencies of the project you are trying to deploy, but not the project output.  this will ensure that the GAC has all the neccessary assemblies for your application.
2. Manually check the dependencies in both the GAC and the locations your application is loading them from.

for all i know this could have nothing to do with missing assemblies, but that seems to be the  remedy when it happens to me.

my OS is Win 2003

am sure that both framework 2 and 3 are installed on the client machine!

 

and i did wt u told me and checked the dependancies but it still the same Sad

vbrunner__
vbrunner__
code monkey
in that case my only suggestion is wrapping everything in Main(string[] args) with a try and see if anything is caught.  but if you're seeing the error i think you are it's occurring before Main is even called, so i'm sorry but beyond that i don't know.  where's littleguru when you need him?
but is there anybody knows wt
  JDUBYA  ment when he asked if we used threading and click once deployment?? Sad
Good day.

I have experienced the same problem.

In my case, I have developed a VB.net 2005 application to execute macros and process reports. I used threading so that even if the application would encounter any problem while executing the macros, it would still process other report-related files.

The said application is being called by a windows service for execution. This is so because I was having problems when I developed its equivalent in windows service.

Later on, the application was deployed on a production server, and it worked well. But just yesterday, I was informed that there's a problem, they sent me the screenshot of the error from the event log viewer.

Please help me. Thanks a lot.


Smiley

Implement an UnhandledExceptionHandler and log the exception information to the Event Log so that you can get better information about what is causing your application to crash and in what context.

// C# 2.0
static void Main(string[] args)
{
  AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(
    delegate(object sender, UnhandledExceptionEventArgs e) {
      if (e.IsTerminating) {
        object o = e.ExceptionObject;
        Debug.WriteLine(o.ToString()); // use EventLog instead
      }
    }
  );

  // rest of your Main code
}
// C# 3.0
static void Main(string[] args)
{
  AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(
    (sender, e) => {
      if (e.IsTerminating) {
        object o = e.ExceptionObject;
        Debug.WriteLine(o.ToString()); // use EventLog instead
      }
    }
  );

  // rest of your Main code
}
' Visual Basic -- anonymous methods WRU?
Sub UnhandledExceptionEventRaised(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs)
  If e.IsTerminating Then
    Dim o As Object = e.ExceptionObject
    Debug.WriteLine(o.ToString) ' use EventLog instead
  End If
End Sub

Sub Main()
  AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf UnhandledExceptionEventRaised

  ' rest of your Main code
End Sub
Hi.

Please refer to this URL - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2713521&SiteID=1&mode=1 

I have encountered the same error, and I was able to solve it just about 30 minutes ago.

Thanks.

Cheers guys, fixed my occurance of this error :o)

Turns out on certain system setups, most of the time "winxp pro sp2 .NET framework 2.0" and  "win2003 .NET framework 2.0 (not sure which service pack if any)" that don't have Visual Studio 2005 or above installed) are missed certain dlls that create this error for a variety of different reasons.. I've seen forum posts saying it's due to unregistered dll's, certain form controls that have member variables that needed commenting out and also corrupted .NET framework installs.

For me it turns out to be a font that was missed out of my setup project, on the above winxp setup (actually running on a virtual machine), it threw an exception during the component initialisation which I identified with JChung2006's debug code posted above :o)

Happy hunting for anyone else trying to work this one out.
Thanks for that tip JChung2006 of using the unhandled exception handler!  It helped me find my true problem, which had absolutely nothing to do with threading, but rather that I was sending a string that was TOO LARGE to the event log!
page 1 of 1
Comments: 12 | Views: 22708
Microsoft Communities