相关文章推荐
腹黑的弓箭  ·  React报错之map() is not ...·  2 周前    · 
绅士的跑步机  ·  Timer.Interval 屬性 ...·  2 周前    · 
有胆有识的槟榔  ·  如何通过Go SDK ...·  6 天前    · 
阳刚的路灯  ·  String.raw() - ...·  4 天前    · 
慈祥的数据线  ·  python - '>=' not ...·  2 年前    · 

在Visual Studio中添加引用,添加后没有报错,但在调试时显示“系统找不到指定的文件”

下面是错误的详情:

System.Windows.Markup.XamlParseException

HResult=0x80131501

Message=“对类型“Simple_Minecraft_Launcher.MainWindow”的构造函数执行符合指定的绑定约束的调用时引发了异常。”,行号为“8”,行位置为“13”。

Source=PresentationFramework

StackTrace:

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_0(Object unused)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

at System.Windows.Threading.DispatcherOperation.InvokeImpl()

at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)

at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)

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 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext 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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, 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.Application.RunDispatcher(Object ignore)

at System.Windows.Application.RunInternal(Window window)

at System.Windows.Application.Run(Window window)

at System.Windows.Application.Run()

at Simple_Minecraft_Launcher.App.Main()

内部异常 1:

TypeInitializationException: “Simple_Minecraft_Launcher.MainWindow”的类型初始值设定项引发异常。

内部异常 2:

FileNotFoundException: 未能加载文件或程序集“KMCCC.Pro, Version=0.9.5.7, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。系统找不到指定的文件。


欢迎咨询 Microsoft Community,很荣幸有机会为您提供帮助。
首先麻烦您按照下方的方案进行操作,执行 “干净启动”,排除设备中第三方应用程序的干扰或冲突,然后查看问题是否依旧存在:
1. 卸载设备中全部的第三方反病毒软件与系统优化软件 (例如 360、腾讯电脑管家、鲁大师等)。
2. 按 “Windows 徽标键+R”,输入 “msconfig”,回车启动系统配置页面。点击 “服务”>“隐藏所有 Microsoft 服务”,点击 “全部禁用”。
3. 鼠标右击任务栏,启动任务管理器。点击 “启动” 选项卡,将所有的启动项全部禁用。
4. 通过开始菜单重启设备 (请选择重启设备,不要选择关机后再开机)。
在干净启动的基础上再使用下方的四条命令对系统执行修复操作,看一下能否解决此问题:
按 “Windows 徽标键+X”,启动 “Windows PowerShell (管理员)”,依次执行以下命令:
Dism /Online /Cleanup-Image /ScanHealth
Dism /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-image /RestoreHealth
sfc /SCANNOW
执行完毕后重启设备,查看问题是否解决。
希望此条回复可以帮助到您。
欢迎您随时回复此问题,衷心感谢您对 Microsoft 产品和服务的支持。
了解到您的问题,我是独立顾问(Independent Advisor Shawn Xu),很高兴能为您提供解答。
很抱歉,本社区主要面向的是Windows10/11系统一般性问题讨论解答,有关于vs开发相关建议您移步TechNet论坛以获得更加专业的技术支持及问题解答。
https://docs.microsoft.com/en-us/answers/products/
https://social.technet.microsoft.com/Forums/zh-...
希望这可以帮助到您。如果您有回复请在48小时之内进行回复,超时问题会被系统自动关闭,祝您有愉快的一天:) 如果有任何问题,请不要客气!
愿与您共同交流、成长、进步!