(Adding the answer after OP confirmed that my comments pointed him in the right direction...)
The reason why the OP got the The 'crossDomainScriptAccessEnabled' attribute is not allowed
error was because this attribute was first introduced in .NET 4.0 and the OP's project was targeting .NET 3.5. After changing the project to .NET 4.0, the problem was fixed.