Try the following solution to resolve this error
- Open Solution Explorer
- Right click project name
- Click on Properties
- Click on build tab as in image below
- Make sure Prefer-32 bit is not selected as in below image.If is checked then uncheck the check box and save.