From 73a23433da6d7e4533b979fad5173b1ea629261a Mon Sep 17 00:00:00 2001 From: Ashley Hauck Date: Tue, 11 Jul 2017 13:52:44 -0700 Subject: [PATCH] Provide a message with invalid HostObjects Re-using an already-present error message: MSB3087: An incompatible host object was passed into the "{0}" task. The host object for this task must implement the "{1}" interface. --- src/Compilers/Core/MSBuildTask/Csc.cs | 2 +- src/Compilers/Core/MSBuildTask/Vbc.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Compilers/Core/MSBuildTask/Csc.cs b/src/Compilers/Core/MSBuildTask/Csc.cs index e37dde21826..2f54ead5f77 100644 --- a/src/Compilers/Core/MSBuildTask/Csc.cs +++ b/src/Compilers/Core/MSBuildTask/Csc.cs @@ -208,7 +208,7 @@ protected internal override void AddResponseFileCommands(CommandLineBuilderExten } else if (HostObject != null) { - throw new InvalidOperationException(); + throw new InvalidOperationException(string.Format(ErrorString.General_IncorrectHostObject, "Csc", "ICscHostObject")); } if (!designTime) { diff --git a/src/Compilers/Core/MSBuildTask/Vbc.cs b/src/Compilers/Core/MSBuildTask/Vbc.cs index f4ec6c95d0a..391cf444198 100644 --- a/src/Compilers/Core/MSBuildTask/Vbc.cs +++ b/src/Compilers/Core/MSBuildTask/Vbc.cs @@ -512,7 +512,7 @@ protected internal override void AddResponseFileCommands(CommandLineBuilderExten } else if (this.HostObject != null) { - throw new InvalidOperationException(); + throw new InvalidOperationException(string.Format(ErrorString.General_IncorrectHostObject, "Vbc", "IVbcHostObject")); } if (!designTime) { -- GitLab