diff --git a/src/Workspaces/Core/Portable/Workspace/Host/HostWorkspaceServices.cs b/src/Workspaces/Core/Portable/Workspace/Host/HostWorkspaceServices.cs index fdfa6a89b3a25a0fd0145700d23d8c0592f8a6b1..818a09c9a71877da20019e7857901a88014bbe6a 100644 --- a/src/Workspaces/Core/Portable/Workspace/Host/HostWorkspaceServices.cs +++ b/src/Workspaces/Core/Portable/Workspace/Host/HostWorkspaceServices.cs @@ -38,7 +38,7 @@ public abstract class HostWorkspaceServices var service = GetService(); if (service == null) { - throw new InvalidOperationException(WorkspacesResources.WorkspaceServicesUnavailable); + throw new InvalidOperationException(string.Format(WorkspacesResources.WorkspaceServicesUnavailable, typeof(TWorkspaceService).FullName)); } return service; diff --git a/src/Workspaces/Core/Portable/Workspace/Workspace.cs b/src/Workspaces/Core/Portable/Workspace/Workspace.cs index ff80db0a212ccc1100fde57c3adaf650a716de71..eccc46527f33f8580e18d021e4ef179ad447b344 100644 --- a/src/Workspaces/Core/Portable/Workspace/Workspace.cs +++ b/src/Workspaces/Core/Portable/Workspace/Workspace.cs @@ -59,7 +59,7 @@ protected Workspace(HostServices host, string workspaceKind) _services = host.CreateWorkspaceServices(this); // queue used for sending events - var workspaceTaskSchedulerFactory = _services.GetService(); + var workspaceTaskSchedulerFactory = _services.GetRequiredService(); _taskQueue = workspaceTaskSchedulerFactory.CreateTaskQueue(); // initialize with empty solution diff --git a/src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs b/src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs index b768181af3e1105718602b2f579cdef5e6f376b5..a674ef37a9e185dc2b696acfbd62649269e2f424 100644 --- a/src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs +++ b/src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs @@ -1079,7 +1079,7 @@ internal class WorkspacesResources { } /// - /// Looks up a localized string similar to Services required to accomplish the task are not available from the workspace.. + /// Looks up a localized string similar to Service of type '{0}' is required to accomplish the task but is not available from the workspace.. /// internal static string WorkspaceServicesUnavailable { get { diff --git a/src/Workspaces/Core/Portable/WorkspacesResources.resx b/src/Workspaces/Core/Portable/WorkspacesResources.resx index cc94c72e6b7cd4c34d4d112cc164455bd26f1783..0ffa4bec52173808bbf2b4a9bc0b75f85396448f 100644 --- a/src/Workspaces/Core/Portable/WorkspacesResources.resx +++ b/src/Workspaces/Core/Portable/WorkspacesResources.resx @@ -397,7 +397,7 @@ Removing project references is not supported. - Services required to accomplish the task are not available from the workspace. + Service of type '{0}' is required to accomplish the task but is not available from the workspace. Supplied diagnostic cannot be null.