diff options
author | Jason Malinowski <jason.malinowski@microsoft.com> | 2016-01-27 03:39:06 +0300 |
---|---|---|
committer | Jason Malinowski <jason.malinowski@microsoft.com> | 2016-01-27 03:48:44 +0300 |
commit | 7f5b07a9b8bd75e03387440e55cd6110983971dc (patch) | |
tree | 19aff9f69796085bd0afe92c3de1e1c8a16b7a55 | |
parent | 6d5532276ed05781421e33572bc7602d4c7b7f2d (diff) |
Tighten ExceptionFromResource to take only string message arguments
This simplifies some unit tests I want to write.
-rw-r--r-- | src/Microsoft.NuGet.Build.Tasks/ExceptionFromResource.cs | 4 | ||||
-rw-r--r-- | src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/Microsoft.NuGet.Build.Tasks/ExceptionFromResource.cs b/src/Microsoft.NuGet.Build.Tasks/ExceptionFromResource.cs index 07de3c0..e958cde 100644 --- a/src/Microsoft.NuGet.Build.Tasks/ExceptionFromResource.cs +++ b/src/Microsoft.NuGet.Build.Tasks/ExceptionFromResource.cs @@ -16,9 +16,9 @@ namespace Microsoft.NuGet.Build.Tasks internal sealed class ExceptionFromResource : Exception { public string ResourceName { get; private set; } - public object[] MessageArgs { get; private set; } + public string[] MessageArgs { get; private set; } - public ExceptionFromResource(string resourceName, params object[] messageArgs) + public ExceptionFromResource(string resourceName, params string[] messageArgs) { ResourceName = resourceName; MessageArgs = messageArgs; diff --git a/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs b/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs index 8538ea6..f8e04a7 100644 --- a/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs +++ b/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs @@ -636,7 +636,7 @@ namespace Microsoft.NuGet.Build.Tasks } else { - ThrowExceptionIfNotAllowingFallback(nameof(Strings.MissingFramework), TargetMonikers.First()); + ThrowExceptionIfNotAllowingFallback(nameof(Strings.MissingFramework), TargetMonikers.First().ItemSpec); } // If we're still here, that means we're allowing fallback, so let's try @@ -691,7 +691,7 @@ namespace Microsoft.NuGet.Build.Tasks } } - private void ThrowExceptionIfNotAllowingFallback(string resourceName, params object[] messageArgs) + private void ThrowExceptionIfNotAllowingFallback(string resourceName, params string[] messageArgs) { if (!AllowFallbackOnTargetSelection) { |