I am using win xp pro sp2, .net framework 2.0.50727 and visual basic 2005 8.0.50727.42 (RTM.50727-4200)
i have some errors when creating a single instance application.
i have created a singleinstance app by checking the SingleInstance property and i catch the events on my app events designer:
Partial Friend Class MyApplication
Private Sub MyApplication_StartupNextInstance(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationService
Dim args As String = ""
Dim arg As String
For Each arg In e.CommandLine
args &= " " & arg
Next
Form1.Text = args
End Sub
End Class
on exactly this line: For Each arg In e.CommandLine
i get this debugging exception:
System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Source="System"
StackTrace:
at System.Net.UnsafeNclNativeMethods.OSSOCK
at System.Net.Sockets.BaseOverlappedAsyncRe
at System.Threading._IOCompletionCallback.P
Checking the Event Viewer Console, the error is the following for this issue (bear with me my winxp is in Spanish but the numbers are there)
Tipo de suceso: Error
Origen del suceso: .NET Runtime 2.0 Error Reporting
Categoria del suceso: Ninguno
Id. suceso: 1000
Fecha: 5/29/2006
Hora: 2:25:35 PM
Usuario: No disponible
Equipo: USUARIO
Descripcion:
No se encuentra la descripcion del Id. de suceso ( 1000 ) en el origen ( .NET Runtime 2.0 Error Reporting ). Es posible que el equipo local no tenga la informacion de Registro o archivos DLL de mensajes necesarios para mostrar mensajes desde un equipo remoto. Es posible que pueda usar el indicador /AUXSOURCE= para recuperar esta descripcion; consulte Ayuda y soporte tecnico para obtener mas detalles. La siguiente informacion es parte del suceso: singleinstance05.exe, 1.0.0.0, 445e7b6f, imon.dll, 2.50.25.0, 42ae8989, 0, 0000cd29.
Datos:
0000: 41 00 70 00 70 00 6c 00 A.p.p.l.
0008: 69 00 63 00 61 00 74 00 i.c.a.t.
0010: 69 00 6f 00 6e 00 20 00 i.o.n. .
0018: 46 00 61 00 69 00 6c 00 F.a.i.l.
0020: 75 00 72 00 65 00 20 00 u.r.e. .
0028: 20 00 73 00 69 00 6e 00 .s.i.n.
0030: 67 00 6c 00 65 00 69 00 g.l.e.i.
0038: 6e 00 73 00 74 00 61 00 n.s.t.a.
0040: 6e 00 63 00 65 00 30 00 n.c.e.0.
0048: 35 00 2e 00 65 00 78 00 5...e.x.
0050: 65 00 20 00 31 00 2e 00 e. .1...
0058: 30 00 2e 00 30 00 2e 00 0...0...
0060: 30 00 20 00 34 00 34 00 0. .4.4.
0068: 35 00 65 00 37 00 62 00 5.e.7.b.
0070: 36 00 66 00 20 00 69 00 6.f. .i.
0078: 6e 00 20 00 69 00 6d 00 n. .i.m.
0080: 6f 00 6e 00 2e 00 64 00 o.n...d.
0088: 6c 00 6c 00 20 00 32 00 l.l. .2.
0090: 2e 00 35 00 30 00 2e 00 ..5.0...
0098: 32 00 35 00 2e 00 30 00 2.5...0.
00a0: 20 00 34 00 32 00 61 00 .4.2.a.
00a8: 65 00 38 00 39 00 38 00 e.8.9.8.
00b0: 39 00 20 00 66 00 44 00 9. .f.D.
00b8: 65 00 62 00 75 00 67 00 e.b.u.g.
00c0: 20 00 30 00 20 00 61 00 .0. .a.
00c8: 74 00 20 00 6f 00 66 00 t. .o.f.
00d0: 66 00 73 00 65 00 74 00 f.s.e.t.
00d8: 20 00 30 00 30 00 30 00 .0.0.0.
00e0: 30 00 63 00 64 00 32 00 0.c.d.2.
00e8: 39 00 0d 00 0a 00 9.....
now, all i could understand from this error and recognize, was "imon.dll" on the last bit of error information. this file is related to NOD32 antivirus software. Needless to say, i have had some issues with NOD32 in the past, i had a memory protected error in the past when using WebClient and NOD was active.
So to check this, i disabled IMON which is the NOD internet monitor (imon.dll), but had the same error when running my app. I also, exited NOD32 completely, and had the same error. funny thing is that i installed my app on another computer and it did work fine, but the ironic part is that the other computer also has NOD32 installed and running.
Please i would appreciate any help since i reinstalled VB2005 three times already but i keep getting this error.
thanks
Pablo Ambram

error using vb2005 SingleInstance
Vignesh_dev
Ryan24
Hi folks, we've worked through the issue and now have a patch available. Here's what I just posted to another thread:
TomGK2006
Aaron Robertson-Hodder
C#2.0
Hi Pablo, a few folks have run into issues like this, typically from errors in their 3rd-party antivirus, firewall, or other driver software (there's a thread a few pages over from some people who get this from their laptop sound driver). Your best bet is to try uninstalling NOD32 entirely (make sure the DLLs are no longer on your machine after a reboot), and see if the problem goes away. If that doesn't solve it for you, there are a few steps you can take to find the misbehaving driver, but this is a good first start. Give this a try and let me know if it fixes your issue.
Cheers,
JJustice [MSFT]
rax
i have uninstalled NOD32 entirely and now my application has no problems using Single Instance framework.
the only drawback is that i no longer have my antivirus software installed. there must be some other way to compatibilize my visual studio 2005 with my antivirus software, maybe you can help me out on that
thanks,
Pablo
Bob_Dineen
yupypt
Pablo, we've been digging into this issue a bit more, and it looks like there's an incompatability between the .NET 2.0 networking stack and some anti-virus programs. We think we can address this with a patch to .NET 2.0, so we're working on that as I type. For the time being, I'd install an alternative anti-virus program. When the patch comes out, you can switch back to NOD32.
I'll post a sticky thread to the forum about this as soon as we have a patch available.
Cheers,
JJustice [MSFT]
Amit Gautam
I too have encountered strange intermittent ReadPacket errors on client machines installed with NOD32 when our .NET 2.0 apps run on them - and taking the advice of this forum, I did have the client completely uninstall NOD32 on that machine - and all worked great again
John - is there an open Issue Number we can use to track this and watch for in a hotfix or patch
Many thanks for following up on the original thread on this subject - it was the only reference I could find on the internet with this same issue
Thanks again
BradO