Ich erstelle eine WPF-Anwendung, die derzeit nur über UI-Elemente verfügt. Ich versuche einige Klassen zu verwenden, die ich in einem anderen Projekt erstellt habe, indem ich eine DLL importiere. Wenn ich die WPF-Anwendung ausführen, Visual Studio öffnet diesen Dialog im Team Explorer auf:Interner Fehler beim Ausführen des Visual Studio-Projekts
Die Anwendung läuft immer noch, aber ich weiß nicht, die Ursache für diesen Fehler und was ihre Auswirkungen sind. Ist noch jemand auf diesen Fehler gestoßen und hat einen Einblick?
Nicht sicher, ob es relevant ist, aber das Projekt, das ich importiere, verwendet NHibernate und Log4Net. Ich verwende auch Visual Studio 2013 Express, wenn das etwas damit zu tun hat.
UPDATE:
Hier ist der Stack-Trace:
at DatabaseUI.DatabaseViewModel..ctor() in c:\Users\andrew\Documents\Visual Studio 2013\Projects\DatabaseUI\DatabaseUI\ViewModels\DatabaseViewModel.cs:line 36
at DatabaseUI.MainWindow..ctor() in c:\Users\andrew\Documents\Visual Studio 2013\Projects\DatabaseUI\DatabaseUI\MainWindow.xaml.cs:line 30
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at System.Xaml.Schema.SafeReflectionInvoker.CreateInstanceCritical(Type type, Object[] arguments)
at System.Xaml.Schema.SafeReflectionInvoker.CreateInstance(Type type, Object[] arguments)
at System.Xaml.Schema.XamlTypeInvoker.CreateInstance(Object[] arguments)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstanceWithCtor(XamlType xamlType, Object[] args)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstance(XamlType xamlType, Object[] args)
at System.Xaml.XamlObjectWriter.Logic_CreateAndAssignToParentStart(ObjectWriterContext ctx)
at System.Xaml.XamlObjectWriter.WriteStartMember(XamlMember property)
at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
at System.Windows.Application.DoStartup()
at System.Windows.Application.<.ctor>b__1(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at DatabaseUI.App.Main() in c:\Users\andrew\Documents\Visual Studio 2013\Projects\DatabaseUI\DatabaseUI\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
UPDATE 2: Ich entfernte das Ansichtsmodell Code, weil dieses Problem existierte, bevor ich es erstellt. Ich habe diesen Fehler erhalten, als ich zum ersten Mal eine WPF-Anwendung ohne Inhalt erstellt habe. Ich suche nach Antworten, die beschreiben, was dieser Fehler bedeutet oder eine ähnliche Situation, in der jemand das Problem lösen konnte.
UPDATE 3: Ich startete ein neues Konsolenanwendungsprojekt und ich bekomme den gleichen Fehler. Dieses Projekt verwendet keine Ressourcen aus dem zuvor beschriebenen Projekt, aber beide Projekte verwenden log4net und nhibernate. Ich denke, das ist ein Nhibernate-Problem.
UPDATE 4: Ich startete eine neue Konsole-Anwendung mit absolut nichts, und ich bekomme immer noch diesen Fehler. Ich habe alle Referenzen und die gesamte AssemblyInfo.cs gelöscht, und immer noch keinen Fortschritt.
UPDATE 5: Ich erstelle eine neue C++ - Konsole-Anwendung und ich bekomme den gleichen Fehler. Kein Nhibernate oder irgendetwas, von dem ich dachte, dass es es vermasselt hat. Es ist definitiv etwas falsch mit Visual Studio ...
HandyPete, In der DLL-Lösung könnten Sie dort ein Testprojekt erstellen und einige der Klassen in diesem Projekt instanziieren. Es ist interessant zu sehen, ob der Fehler beim Ausführen auftritt. Dies könnte zu einer gewissen Isolationsstufe führen, wo der Fehler auftreten könnte. – Jim
Jemand benutzt Reflexion und macht wilde/falsche Würfe. Sie (wir alle) benötigen die vollständige Stapelverfolgung. Es ist fast unmöglich zu helfen, ohne es zu tun. –
@Jim Ich begann dieses Projekt durch Erstellen einer Konsolenanwendung, die diese Klassen implementiert, dann nahm diese Klassen und machte die DLL. Sie haben keine Fehler in der Konsolenanwendung verursacht, aber das war eine gute Idee zu versuchen. – Batman