Permalink
Browse files

Exception message improved.

  • Loading branch information...
dotnetjunkie committed Jan 1, 2019
1 parent 4bead5b commit 56c55d8df41bcb19fe2d8853808625cf18d32691
Showing with 7 additions and 4 deletions.
  1. +1 −4 src/SimpleInjector/Lifestyles/ScopedProxyLifestyle.cs
  2. +6 −0 src/SimpleInjector/StringResources.cs
@@ -57,10 +57,7 @@ public ScopedProxyLifestyle() : base("Scoped")
private static ScopedLifestyle ThrowDefaultScopeLifestyleIsNotSet()
{
throw new InvalidOperationException(
"To be able to use the Lifestyle.Scoped property, please ensure that the container is " +
"configured with a default scoped lifestyle by setting the Container.Options." +
"DefaultScopedLifestyle property with the required scoped lifestyle for your type of " +
"application. See: https://simpleinjector.org/lifestyles#scoped");
StringResources.ScopePropertyCanOnlyBeUsedWhenDefaultScopedLifestyleIsConfigured());
}
}
}
@@ -203,6 +203,12 @@ internal static string DiagnosticWarningsReported(IList<DiagnosticResult> errors
nameof(Container) + "." + nameof(Container.Options),
nameof(ContainerOptions.AllowOverridingRegistrations));

internal static string ScopePropertyCanOnlyBeUsedWhenDefaultScopedLifestyleIsConfigured() =>
"To be able to use the Lifestyle.Scoped property, please ensure that the container is " +
"configured with a default scoped lifestyle by setting the Container.Options." +
"DefaultScopedLifestyle property with the required scoped lifestyle for your type of " +
"application. For more information, see https://simpleinjector.org/scoped.";

internal static string MakingConditionalRegistrationsInOverridingModeIsNotSupported() =>
string.Format(CultureInfo.InvariantCulture,
"The making of conditional registrations is not supported when {0} is set, because it is " +

0 comments on commit 56c55d8

Please sign in to comment.