Fody.Propertychanged preventing Edit and Continue when used with MVVMLight

333 views Asked by At

I understand that using AOP tooling could/should interfere with edit and continue for a class that is weaved. But I have a case where simply using MVVMLight and Fody.PropertyChanged in the same project prevents edit and continue anywhere if there is a class inheriting from ObservableObject in the project.

To reproduce, I simply create a WPF 4.6.2 project in VS 2017 Update 3 (happens in all the updates), add nuget references to MVVMLight & Fody.PropertyChanged, and then I can't edit and continue even simple code like this:

private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
    int i = 0;
    i++;
    i++;
}

Error is:

CS7038 Failed to emit module 'WithFodyPropertyChangedAndMvvmLight'.

If I remove the PropertyChanged tag from the FodyWeavers.xml file, the problem goes away. If I don't use MVVMLight and instead just:

class Class : INotifyPropertyChanged
{
    public int Test { get; set; }
    public event PropertyChangedEventHandler PropertyChanged;
}

it works fine. So it looks MVVMLight specific.

Anyone seen this? Thanks!

0

There are 0 answers