【发布时间】:2013-06-03 16:45:52
【问题描述】:
我的程序通过 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' 元素。”这可能是相关的吗?
【问题讨论】:
-
从 Nuget 更新后是否出现错误?如果是这样,请恢复到以前的程序集。是不是突然出现了错误,re: no other new dependencies (references) were added to the project,然后清理解决方案(右键解决方案>清理解决方案)然后重建。还是失败?从一个新的解决方案开始,开始一点一点地添加,一路构建,直到找到故障点。
-
当我在处理一些与 RelayCommand 没有任何关系的代码时发生了错误。据我所知,NuGet 没有更新任何东西(我下载的只是 MVVM Light)。我尝试清理和重建解决方案,但没有成功。我会尝试一个新的解决方案。
标签: visual-studio mvvm visual-studio-2012 mvvm-light