Skip to content

Commit

Permalink
Update binder resources (#1229)
Browse files Browse the repository at this point in the history
- cleanup
- update designer
- update PatchConfig.props
  • Loading branch information
HaoK authored and dougbu committed Mar 15, 2019
1 parent d6a8450 commit 81c9002
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
6 changes: 6 additions & 0 deletions eng/PatchConfig.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,10 @@
</PackagesInPatch>
</PropertyGroup>

<PropertyGroup Condition=" '$(VersionPrefix)' == '2.1.10' ">
<PackagesInPatch>
Microsoft.Extensions.Configuration.Binder;
</PackagesInPatch>
</PropertyGroup>

</Project>
4 changes: 2 additions & 2 deletions src/Configuration/Config.Binder/src/ConfigurationBinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ private static bool TryConvertValue(Type type, string value, out object result,
}
catch (Exception ex)
{
error = new InvalidOperationException(Resources.FormatError_FailedBinding(value, type), ex);
error = new InvalidOperationException(Resources.FormatError_FailedBinding(type), ex);
}
return true;
}
Expand Down Expand Up @@ -567,4 +567,4 @@ private static IEnumerable<PropertyInfo> GetAllProperties(TypeInfo type)
return allProperties;
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Configuration/Config.Binder/src/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<value>Cannot create instance of type '{0}' because it is either abstract or an interface.</value>
</data>
<data name="Error_FailedBinding" xml:space="preserve">
<value>Failed to convert '{0}' to type '{1}'.</value>
<value>Failed to convert configuration value to type '{0}'.</value>
</data>
<data name="Error_FailedToActivate" xml:space="preserve">
<value>Failed to create instance of type '{0}'.</value>
Expand All @@ -132,4 +132,4 @@
<data name="Error_UnsupportedMultidimensionalArray" xml:space="preserve">
<value>Cannot create instance of type '{0}' because multidimensional arrays are not supported.</value>
</data>
</root>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,13 @@ public void ConsistentExceptionOnFailedBinding(Type type)
Assert.NotNull(exception.InnerException);
Assert.NotNull(getException.InnerException);
Assert.Equal(
Resources.FormatError_FailedBinding(IncorrectValue, type),
Resources.FormatError_FailedBinding(type),
exception.Message);
Assert.Equal(
Resources.FormatError_FailedBinding(IncorrectValue, type),
Resources.FormatError_FailedBinding(type),
getException.Message);
Assert.Equal(
Resources.FormatError_FailedBinding(IncorrectValue, type),
Resources.FormatError_FailedBinding(type),
getValueException.Message);
}

Expand Down

0 comments on commit 81c9002

Please sign in to comment.