visual-studio - 通过 NuGet 获取的 MVVM Light - 未找到 RelayCommand.cs

标签 visual-studio mvvm visual-studio-2012 mvvm-light

我的程序通过 NuGet 合并了 MVVM Light 的副本。直到大约 5 分钟前,它都可以顺利运行,但现在我收到一条错误消息,提示“RelayCommand.cs 未找到”。由于我从 NuGet 获取了包,因此我没有 RelayCommand.cs 本身,只有 dll。我尝试卸载并重新安装 MVVM Light,但问题仍然存在。现在我真的很茫然。如果有人可以帮助我解决这个问题,以便我可以继续工作,我将不胜感激。

Locating source for 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\Command\RelayCommand.cs'. Checksum: MD5 {9c e1 3c 59 78 15 34 23 2b e 9b 39 ef 5d eb d0}
The file 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\Command\RelayCommand.cs' does not exist.
Looking in script documents for 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\Command\RelayCommand.cs'...
Looking in the projects for 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\Command\RelayCommand.cs'.
The file was not found in a project.
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\crt\src\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\crt\src\vccorlib\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\mfc\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\atl\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: d:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\Command\RelayCommand.cs.
The debugger could not locate the source file 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\Command\RelayCommand.cs'.

更新:此时我认为这是 VS 的问题。我手动下载了 dll 文件并引用它们,但仍然遇到相同的错误。我认为创建一个新项目并迁移我的数据可能是值得的。不过,如果有人对如何解决这个问题有任何想法,我会洗耳恭听。

更新:我不知道这是否是问题所在,但该程序似乎正在寻找 MvvmLight (NET35)。我获得的版本(到目前为止一直在工作)是 WPF45。

更新:当我在解决方案中打开 packages.config 时,我收到一条警告,提示“未声明 'packages' 元素”。这可能相关吗?

最佳答案

在 Galasoft 上遇到了同样的问题,并找到了您的帖子。 - 终于我弄清楚了,或者至少不再弹出错误:

转到工具-选项...-调试-常规并勾选仅启用我的代码,错误消失了。我假设 MVVM-Light 是在 Debug模式下编译的,现在 Visual Studio 会查找 MvvmLight pdb 和 cs 文件,通过 nuget 安装时当然不存在这些文件。

关于visual-studio - 通过 NuGet 获取的 MVVM Light - 未找到 RelayCommand.cs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16901736/

相关文章:

c++ - Visual Studio 2012 "Smart"缩进自定义

c - 仅在 Visual 中出现奇怪的语法错误 C2143(在 ';' 之前缺少 'type')

c# - 在 ASP.NET MVC 应用程序中看不到资源命名空间

c# - 从 AvalonDock 2.0 中的集合绑定(bind) LayoutDocument 的标题

c# - 如何从大文本中提取匹配字符串?

css - 在 visual studio 中定义自定义颜色?

c++ - 使用 VS Community 2017 打开 vdproj 文件?

visual-studio - ReSharper 迟钝

c# - 当 SelectedValue 为 0 时 WPF 组合框,则组合框不应选择

unit-testing - 如何在包含命名空间的 TFS Build 中使用 TestCaseFilter 排除单元测试