If you are using any variable as ref then that variable should not have get; set; access specifiers. If you are having then you will get above mentioned error.