Two ways binding NullReferenceException
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
# Configuration
|Name|Version|
|:-:|:-:|
|dotnet tool| 5.0.302 |
|target framework| net452, net461, net472 |
# Problem
When I use background binding, provided `Path`, `Source` and set mode `TwoWay`, always throw NullReferenceException , but in net5.0 no exception, but how can i do when in NET Framework?
Whether i use `SetBinding` or `BindingOperations.SetBinding`.
# StackTrack
```
at MS.Internal.AvTrace.AntiFormat(String s)
```

# Code
```csharp
var q = new Binding();
q.Path = new PropertyPath("RotateTransform");
q.Source = obj.RotateTransformDesigner;
q.Mode = BindingMode.TwoWay;
Bd.SetBinding(Control.RenderTransformProperty, q);
BindingOperations.SetBinding(Bd, Control.RenderTransformProperty, q);//ERROR
```
Contributor guide
Assessment
This issue has not been assessed yet.