This is interesting and it seems you need to change permissions of how the project runs, Try doing the following
- go to project properties > Security
- enable click-once security settings and select Full trust application
More infor in this link WPF security