public async Task MetadataReference_RoundTrip_Test() { var hostServices = MefHostServices.Create( MefHostServices.DefaultAssemblies.Add(typeof(Host.TemporaryStorageServiceFactory.TemporaryStorageService).Assembly)); var workspace = new AdhocWorkspace(hostServices); var reference = MetadataReference.CreateFromFile(typeof(object).Assembly.Location); var serializer = new Serializer(workspace.Services); var trees = new ChecksumTreeNodeCacheCollection(); var assetBuilder = new AssetBuilder(trees.CreateRootTreeNodeCache(workspace.CurrentSolution)); var assetFromFile = await assetBuilder.BuildAsync(reference, CancellationToken.None).ConfigureAwait(false); var assetFromStorage = await CloneAssetAsync(serializer, assetBuilder, assetFromFile).ConfigureAwait(false); var assetFromStorage2 = await CloneAssetAsync(serializer, assetBuilder, assetFromStorage).ConfigureAwait(false); }
public Service(HostWorkspaceServices workspaceServices, ChecksumTreeNodeCacheCollection caches) { _workspaceServices = workspaceServices; _caches = caches; }