Home Dashboard Directory Help
Search

Exception: Unable to cast transparent proxy to type 'Roslyn.Utilities.SerializableDataStorage'. by JLeBert


Status: 

Active


2
0
Sign in
to vote
Type: Other
ID: 778866
Opened: 2/8/2013 2:36:11 PM
Access Restriction: Public

Description

I have written a Visual Studio package (*.vsix) that uses Roslyn to analyze code in a project. When I upgraded to the 12/28/2012, version 1.2.20906.2 of Roslyn, I started getting the exception at the bottom of this text. Searching for the exception text finds an issue on StackOverflow when Roslyn is used inside a MSBuild task. I tried working around this by creating an empty Roslyn solution and adding documents and references but I just got the same error when trying to Solution.Create(solutionId).

Can this be fixed in a future CTP? Is there a workaround? There was a suggestion that using LoadFromCommandLineArgs() would fix this, but that is a LOT of work. Here is the exception I'm getting:

System.InvalidCastException: Unable to cast transparent proxy to type 'Roslyn.Utilities.SerializableDataStorage'.
at Roslyn.Utilities.RemoteServices.CreateInstance[T]()
at Roslyn.Services.Host.TemporaryStorageServiceFactory.CreateService(IWorkspaceServiceProvider workspaceServices)
at Roslyn.Services.Host.WorkspaceServiceProviderFactory.<>c__DisplayClass6.<OnImportsSatisfied>b__1(IWorkspaceServiceProvider wsp)
at Roslyn.Services.Host.WorkspaceServiceProvider.ConstructService(Type type)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Roslyn.Services.Host.WorkspaceServiceProvider.GetService[TWorkspaceService]()
at Roslyn.Services.SolutionServices..ctor(IWorkspaceServiceProvider workspaceServices)
at Roslyn.Services.Solution..ctor(SolutionId id, String filePath, VersionStamp version, VersionStamp latestProjectVersion, IWorkspaceServiceProvider workspaceServices)
at Roslyn.Services.Host.SolutionFactoryServiceFactory.SolutionFactoryService.CreateSolution(SolutionId id)
at Roslyn.Services.Host.TrackingWorkspace.CreateNewSolution(ISolutionFactoryService solutionFactory, SolutionId id)
at Roslyn.Services.Host.TrackingWorkspace..ctor(IWorkspaceServiceProvider workspaceServiceProvider, Boolean enableBackgroundCompilation, Boolean enableInProgressSolutions)
at Roslyn.Services.Host.HostWorkspace..ctor(IWorkspaceServiceProvider workspaceServiceProvider, Boolean enableBackgroundCompilation, Boolean enableInProgressSolutions, Boolean enableFileTracking)
at Roslyn.Services.Host.LoadedWorkspace..ctor(IWorkspaceServiceProvider workspaceServiceProvider, IDictionary`2 globalProperties, Boolean enableBackgroundCompilation, Boolean enableFileTracking)
at Roslyn.Services.Solution.LoadStandAloneProject(String projectFileName, String configuration, String platform, String language)
Details
Sign in to post a comment.
Sign in to post a workaround.