首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >通过NuGet - RelayCommand.cs获得的MVVM光未找到

通过NuGet - RelayCommand.cs获得的MVVM光未找到
EN

Stack Overflow用户
提问于 2013-06-03 16:45:52
回答 3查看 2.4K关注 0票数 2

我的程序通过NuGet合并了一份MVVM的副本。直到大约5分钟前,它还能正常工作,但是现在我收到了一个错误,上面写着"RelayCommand.cs未找到“。因为我从NuGet获得了这个包,所以我没有RelayCommand.cs本身,只有dll。我已经尝试卸载和重新安装MVVM,并且问题仍然存在。现在我真的不知所措。如果有人能帮我解决这个问题,让我继续工作,我会非常感激的。

代码语言:javascript
运行
复制
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‘元素未声明。”这会有关系吗?

EN

回答 3

Stack Overflow用户

发布于 2013-07-30 12:00:03

加拉索夫特也有同样的问题找到了你的帖子。-最后我想明白了,或者至少这个错误不再弹出:

转到Tools-Options...-Debugging-General并勾选Enable Just My Code,错误就消失了。我假设MvvmLight是在调试模式下编译的,现在Visual会查找MvvmLight、pdb和cs文件,这些文件在通过nuget安装时当然不在那里。

票数 4
EN

Stack Overflow用户

发布于 2013-06-03 19:34:52

我不知道这为什么会导致这样的错误,但我相信这是因为试图从一个不存在的文件中读取数据。我删除了那个代码,错误就消失了。

票数 0
EN

Stack Overflow用户

发布于 2016-09-07 18:47:46

当我得到这个错误时,是因为一个无效的强制转换异常。我有这样的经历:

代码语言:javascript
运行
复制
MyCommand = new RelayCommand<int>((i) => MyMethod(i));

但是我在XAML中绑定的属性是长的。我把它改成了这个,它起了作用:

代码语言:javascript
运行
复制
MyCommand = new RelayCommand<long>((i) => MyMethod(i));
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16901736

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档