By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,122 Members | 2,084 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,122 IT Pros & Developers. It's quick & easy.

Application quits unexpectedly

P: n/a
HELP - My application exists.... all on its own... at the end of a function
call!!!

The code snipit below runs... the finally block runs. But when it reaches
End Sub, it exists! - And the proceedure that calls this one, has code left
to run, but it never gets to a breakpoint on the next line.
Any ideas what to look for? Is it because i am calling an external assembly?

The calling code is run on a seperate thread, that is marked as background,
but that shouldnt make a difference should it?

Private Sub CreateOutput(ByVal Packet As Packet, ByVal ChannelInstance As
ChannelInstance, Optional ByVal PacketField As PacketField = Nothing)
Dim asmOutputChannel As System.Reflection.Assembly
Dim typOutputChannel As Type
Dim objOutputChannel As iOutputChannel

Try
asmOutputChannel =
System.Reflection.Assembly.LoadFrom(CType(ChannelI nstance.ChannelTemplate,
ChannelTemplate).FileName)

typOutputChannel =
asmOutputChannel.GetType(CType(ChannelInstance.Cha nnelTemplate,
ChannelTemplate).ProgID, True, True)

objOutputChannel = Activator.CreateInstance(typOutputChannel)

objOutputChannel.SendOutput(Packet, ChannelInstance)
Catch ex As DataAccessLayer.RecordAlreadyChanged
'Pass this error up the stack, without a parent exception
Throw ex
Catch ex As Exception
Throw New AllocationsEngineException("Unable to create output", ex)
Finally
asmOutputChannel = Nothing
typOutputChannel = Nothing
objOutputChannel = Nothing
End Try
End Sub
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
try adding a handler to Applicatoin.ThreadException and see if its being
thrown there.

-CJ'
"Andrew Teece" <an**********@enate.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
HELP - My application exists.... all on its own... at the end of a function call!!!

The code snipit below runs... the finally block runs. But when it reaches
End Sub, it exists! - And the proceedure that calls this one, has code left to run, but it never gets to a breakpoint on the next line.
Any ideas what to look for? Is it because i am calling an external assembly?
The calling code is run on a seperate thread, that is marked as background, but that shouldnt make a difference should it?

Private Sub CreateOutput(ByVal Packet As Packet, ByVal ChannelInstance As
ChannelInstance, Optional ByVal PacketField As PacketField = Nothing)
Dim asmOutputChannel As System.Reflection.Assembly
Dim typOutputChannel As Type
Dim objOutputChannel As iOutputChannel

Try
asmOutputChannel =
System.Reflection.Assembly.LoadFrom(CType(ChannelI nstance.ChannelTemplate,
ChannelTemplate).FileName)

typOutputChannel =
asmOutputChannel.GetType(CType(ChannelInstance.Cha nnelTemplate,
ChannelTemplate).ProgID, True, True)

objOutputChannel = Activator.CreateInstance(typOutputChannel)

objOutputChannel.SendOutput(Packet, ChannelInstance)
Catch ex As DataAccessLayer.RecordAlreadyChanged
'Pass this error up the stack, without a parent exception
Throw ex
Catch ex As Exception
Throw New AllocationsEngineException("Unable to create output", ex) Finally
asmOutputChannel = Nothing
typOutputChannel = Nothing
objOutputChannel = Nothing
End Try
End Sub

Nov 20 '05 #2

P: n/a
I already have an event handler here... nothing is thrown.

Thanks for the idea though

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:eW**************@tk2msftngp13.phx.gbl...
try adding a handler to Applicatoin.ThreadException and see if its being
thrown there.

-CJ'
"Andrew Teece" <an**********@enate.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
HELP - My application exists.... all on its own... at the end of a

function
call!!!

The code snipit below runs... the finally block runs. But when it reaches End Sub, it exists! - And the proceedure that calls this one, has code

left
to run, but it never gets to a breakpoint on the next line.
Any ideas what to look for? Is it because i am calling an external

assembly?

The calling code is run on a seperate thread, that is marked as

background,
but that shouldnt make a difference should it?

Private Sub CreateOutput(ByVal Packet As Packet, ByVal ChannelInstance As ChannelInstance, Optional ByVal PacketField As PacketField = Nothing)
Dim asmOutputChannel As System.Reflection.Assembly
Dim typOutputChannel As Type
Dim objOutputChannel As iOutputChannel

Try
asmOutputChannel =
System.Reflection.Assembly.LoadFrom(CType(ChannelI nstance.ChannelTemplate, ChannelTemplate).FileName)

typOutputChannel =
asmOutputChannel.GetType(CType(ChannelInstance.Cha nnelTemplate,
ChannelTemplate).ProgID, True, True)

objOutputChannel = Activator.CreateInstance(typOutputChannel)

objOutputChannel.SendOutput(Packet, ChannelInstance)
Catch ex As DataAccessLayer.RecordAlreadyChanged
'Pass this error up the stack, without a parent exception
Throw ex
Catch ex As Exception
Throw New AllocationsEngineException("Unable to create output",

ex)
Finally
asmOutputChannel = Nothing
typOutputChannel = Nothing
objOutputChannel = Nothing
End Try
End Sub


Nov 20 '05 #3

P: n/a
It is a call to a .Net assembly i have written in VB.Net, so fully managed
(it only calls system.web.mail).

However, the calling code is run within a COM+ transaction. The assembly i
dynamically load does not referance EnterpriseServices in any way, and i
have since noticed that COM+ throws a 4822 error..

A condition has occurred that indicates this COM+ application is in an
unstable state or is not functioning correctly. Assertion Failure: !m_punk

Server Application ID: {31DC9D6D-C0E1-4386-BF94-7E1A6964CE2B}

Server Application Instance ID:

{997DF313-3BFB-4031-AFB9-2A3B76660DD5}

Server Application Name: eNate BPOBridge

The serious nature of this error has caused the process to terminate.

COM+ Services Internals Information:

File: d:\nt_qxp\com\com1x\src\comsvcs\jit\jit.cpp, Line: 858

Comsvcs.dll file version: ENU 2001.12.4414.53 shp

For more information, see Help and Support Center at

"Doug" <an*******@discussions.microsoft.com> wrote in message
news:11**********************************@microsof t.com...
It could be your call is not thread safe. Is this a call to unmanaged

code?
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.