Friday, 8 June 2012

Weird Roslyn.Utilities.SerializableDataStorage casting issue when using new version

While writing a couple Roslyn scripts I started having a weird problem when consuming the June 2012 CTP dlls.

I was having the exception:

Unable to cast transparent proxy to type 'Roslyn.Utilities.SerializableDataStorage'. Unable to cast transparent proxy to type 'Roslyn.Utilities.SerializableDataStorage'.


... when I opened an solution file with:


Workspace.LoadSolution(solutionFile);

Since this command was working fine before (and I don't think there is an dependency of VisualStudio), I knew that something weird was going on.

It turned out that there was a Roslyn.Services.dll started which used the previous version (hence the remoting serialization problem), and after stopping this process, the script was working again (btw, I don't think that that the new version starts this process (unless it does it very fast)) Update: the Roslyn.Services.dll process is also used in the latest version. The issue is that I was compiling the O2 Platform to target x86 while I'm on a 64bit machine (for now the solution is to use 'Any CPU' as the platform target)


Here is a document with some screenshots on what was going on and the before and after errors:


1) Using Roslyn (first tests).pdf