MVVM Light obtained via NuGet - RelayCommand.cs not found

后端 未结 3 1174
粉色の甜心
粉色の甜心 2020-12-12 01:31

My program incorporates a copy of MVVM Light via NuGet. Up until about 5 minutes ago it worked without a hitch, but now I\'m getting an error saying \"RelayCommand.cs not fo

相关标签:
3条回答
  • 2020-12-12 01:39

    I don't know why this would cause such an error, but I believe it was caused by trying to read in data from a file that didn't exist. I removed that code and the error went away.

    0 讨论(0)
  • 2020-12-12 01:50

    When I got this error it was because of an invalid cast exception. I had this:

    MyCommand = new RelayCommand<int>((i) => MyMethod(i));
    

    But the property I was Binding in my XAML was a long. I changed it to this and it worked:

    MyCommand = new RelayCommand<long>((i) => MyMethod(i));
    
    0 讨论(0)
  • 2020-12-12 02:02

    Got just the same Problem with Galasoft and found your post. - Finally I figured it out, or at least the error no longer pops up:

    Go to Tools-Options...-Debugging-General and tick Enable Just My Code and the error disappeared. I assume MVVM-Light is compiled in Debug Mode and now Visual Studio Looks for the MvvmLight pdb and cs file which are of course not there when installed via nuget.

    0 讨论(0)
提交回复
热议问题