Příznaky
Při spouštění doplňku nebo balíček integrace, Microsoft Visual Studio 2013 může neočekávaně ukončit k neošetřené výjimce typu System.Reflection.TargetInvocationException.
V protokolu událostí aplikací se zobrazí chyby aplikace s podobným textem:
Chybující aplikace název: devenv.exe, verze: 12.0.21005.1 časové razítko: 0x524fcb34
Chybující název modulu: KERNELBASE.dll, verze: 6.1.7601.18229, časové razítko: 0x51fb10c6
Kód výjimky: 0xe0434352
Posun poruchy: 0x0000812f
Chybující id procesu: 0xe3c
Chybující aplikace počáteční čas: 0x01cf0b21c6346ea8
Cesta k chybující aplikaci: C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe
Chybující modul cesta: C:\Windows\system32\KERNELBASE.dll
Jako zdroj s podobným textem následuje událost s .NET Runtime:
Aplikace: devenv.exe
Framework verze: v4.0.30319
Popis: Proces byl ukončen z důvodu neošetřené výjimky.
Informace o výjimce: System.Reflection.TargetInvocationException
Zásobník:
v System.RuntimeMethodHandle.InvokeMethod (System.Object, System.Object [], System.Signature, Boolean)
v System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal (System.Object, System.Object [], System.Object[])
v System.Delegate.DynamicInvokeImpl(System.Object[])
v System.Windows.Threading.ExceptionWrapper.InternalRealCall (Int32 System.Delegate, System.Object)
na MS. Internal.Threading.ExceptionFilterHelper.TryCatchWhen (System.Object, System.Delegate, System.Object, Int32, System.Delegate.)
v System.Windows.Threading.DispatcherOperation.InvokeImpl()
v System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
v System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, logická hodnota)
na System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, logická hodnota)
na System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
v System.Windows.Threading.DispatcherOperation.Invoke()
v System.Windows.Threading.Dispatcher.ProcessQueue()
v System.Windows.Threading.Dispatcher.WndProcHook (IntPtr, Int32, IntPtr, IntPtr, Boolean typu ByRef)
na MS. Win32.HwndWrapper.WndProc (IntPtr, Int32, IntPtr, IntPtr, Boolean typu ByRef)
na MS. Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
v System.Windows.Threading.ExceptionWrapper.InternalRealCall (Int32 System.Delegate, System.Object)
na MS. Internal.Threading.ExceptionFilterHelper.TryCatchWhen (System.Object, System.Delegate, System.Object, Int32, System.Delegate.)
v System.Windows.Threading.Dispatcher.LegacyInvokeImpl (System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
na MS. Win32.HwndSubclass.SubclassWndProc (IntPtr, Int32, IntPtr, IntPtr)
Příčina
K tomuto problému dochází, protože kód změna v integrovaném vývojovém prostředí sady Visual Studio 2013 a má vliv na dokumenty, které nejsou názvy platné cesty jako analyzovaný třídou .NET System.IO.File. Visual Studio může vyvolat System.ArgumentException při otevření těchto dokumentů, která probublá až prostřednictvím rozhraní IDE, jako TargetInvocationException.
Řešení
Můžete zabránit nebo vyřešit problém tím, že zajistí, že váš dokument názvy jsou platné názvy souborů systému Win32.
Tento problém byl vyřešen v Visual Studio 2013 Update 2 a novějších verzích sady Visual Studio.
Další informace
Příklad zásobníku volání TargetInvocationException jsou uvedeny níže. To je ze souboru s výpisem stavu paměti procesu zachycené na neošetřené výjimky a zobrazí v ladicím programu WindDdbg pomocí rozšíření prodejní objednávky zobrazit zásobníky volání spravované výjimce:
Typ CLR výjimka: System.Reflection.TargetInvocationException
"Byla vyvolána výjimka podle cíle vyvolání."
Chyba: Nelze najít soubor symbolů. Chcete-li exportovat symboly pro C:\Windows\system32\KERNELBASE.dll - převezme
eax=0027eb88 ebx=00000005 ecx=00000005 edx=00000000 esi=0027ec48 edi=00000001
EIP = 7528812f esp = 0027eb88 ebp = 0027ebd8 iopl = 0 nv up ei pl nz ac pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00200216
KERNELBASE!RaiseException+0x54:
7528812f c9 volno
0:000 >! loadby clr prodejní objednávky
0:000> !sos.PrintException
Objekt výjimky: 136eb7f8
Typ výjimky: System.Reflection.TargetInvocationException
Zpráva: Došlo k výjimce podle cíle vyvolání.
U třídy InnerException: System.ArgumentException, použití! PrintException 136e9f10 Chcete-li zobrazit více.
StackTrace (Generovat):
Funkce SP IP
00000000 00000001 mscorlib_ni! System.RuntimeMethodHandle.InvokeMethod (System.Object, System.Object [], System.Signature, Boolean) + 0x2
0033BEC8 60D99BC1 mscorlib_ni! System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal (System.Object, System.Object [], System.Object[])+0xc1
0033BEEC 60D904B6 mscorlib_ni!System.Delegate.DynamicInvokeImpl(System.Object[])+0x76
0033BF00 6079C5BD WindowsBase_ni!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)+0xad
0033BF20 6079C49A WindowsBase_ni!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)+0x3a
0033BF64 6079EE4C WindowsBase_ni!System.Windows.Threading.DispatcherOperation.InvokeImpl()+0xac
0033BF9C 6079ED88 WindowsBase_ni!System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)+0x38
0033BFA4 60E14157 mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)+0xa7
0033C010 60E14096 mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)+0x16
0033C024 60E14051 mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)+0x41
0033C03C 6079EC9B WindowsBase_ni!System.Windows.Threading.DispatcherOperation.Invoke()+0x5b
0033C074 6079B21B WindowsBase_ni!System.Windows.Threading.Dispatcher.ProcessQueue()+0x16b
0033C0B8 6079B3DA WindowsBase_ni! System.Windows.Threading.Dispatcher.WndProcHook (IntPtr, Int32, IntPtr, IntPtr, Boolean typu ByRef) + 0x5a
WindowsBase_ni 104 6079C75B C 0033! MS. Win32.HwndWrapper.WndProc (IntPtr, Int32, IntPtr, IntPtr, Boolean typu ByRef) + 0x9b
0033C140 6079C6AB WindowsBase_ni!MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)+0x6b
0033C150 6079C562 WindowsBase_ni!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)+0x52
0033C170 6079C49A WindowsBase_ni!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)+0x3a
0033C1B4 6079AABE WindowsBase_ni!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)+0x10e
WindowsBase_ni 208 6079BFF1 C 0033! MS. Win32.HwndSubclass.SubclassWndProc (IntPtr, Int32, IntPtr, IntPtr) + 0xf1
00000000 00000001 System_Windows_Forms_ni! System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop (IntPtr, Int32, Int32) + 0x2
0033C4D8 5C35DFC7 System_Windows_Forms_ni!System.Windows.Forms.ComponentManagerProxy.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop (IntPtr, Int32, Int32) + 0x27
0033C4F0 5BBBF8D1 System_Windows_Forms_ni!System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)+0x155
0033C540 5BBBF742 System_Windows_Forms_ni!System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)+0x4a
0033C56C 5BB67004 System_Windows_Forms_ni!System.Windows.Forms.Application.DoEvents()+0x18
0033C574 0682B972 MyAddin!Initialize()+0x6fa
StackTraceString: < žádné >
HResult: 80131604
InnerException ukazuje počáteční výjimku throw:
0:000> !PrintException 136e9f10
Objekt výjimky: 136e9f10
Typ výjimky: System.ArgumentException
Zpráva: Neplatné znaky v cestě.
U třídy InnerException: < žádné >
StackTrace (Generovat):
Funkce SP IP
0033BA18 617FFD07 mscorlib_ni!System.IO.Path.CheckInvalidPathChars(System.String, Boolean)+0xa68db7
0033BA28 60E05936 mscorlib_ni!System.IO.Path.GetExtension(System.String)+0x16
0033BA40 6D60F8E7 Microsoft_VisualStudio_Shell_UI_Internal_ni!Microsoft.VisualStudio.Services.VsImageService.GetIconForFileEx(System.String, Microsoft.VisualStudio.Shell.Interop.__VSUIDATAFORMAT, Microsoft.VisualStudio.Shell.Interop.__VSIconSource ByRef)+0x3f
0033BA64 6D60F88C Microsoft_VisualStudio_Shell_UI_Internal_ni!Microsoft.VisualStudio.Services.VsImageService.GetIconForFileEx(System.String, Microsoft.VisualStudio.Shell.Interop.__VSUIDATAFORMAT, UInt32 ByRef)+0x14
0033BA74 16D5ABD8 Microsoft_VisualStudio_Platform_WindowManagement_ni!Microsoft.VisualStudio.Platform.WindowManagement.UtilityMethods.GetDocumentTabImage(System.String, Microsoft.VisualStudio.Shell.Interop.__TABIMAGEFLAGS ByRef)+0x38
0033BA90 6DE8F8F6 Microsoft_VisualStudio_Platform_WindowManagement_ni!Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.UpdateDocumentIcon()+0x131e2a
StackTraceString: < žádné >
HResult: 80070057
Jeden známých příčin této chyby je mít vložené uvozovky v názvu dokumentu. Příklad jazyka C# kódu, který ukazuje vnitřní výjimka je následující:
static void Main(string[] args) { string path = null; path = @"A09F9925-32BC-47E1-9DC0-1F71C64E9A6E@SAMPLE.""ADEFUSR0"""; string extension = System.IO.Path.GetExtension(path); }
Tento kód vyvolá volání GetExtension System.ArgumentException.