// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#if NET_2_0
-
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
this.task = task;
this.taskElement = taskElement;
this.taskType = taskType;
- values = new Dictionary <string, object> (StringComparer.InvariantCultureIgnoreCase);
+ values = new Dictionary <string, object> (StringComparer.OrdinalIgnoreCase);
foreach (KeyValuePair <string, string> de in parameters) {
currentProperty = taskType.GetProperty (de.Key, BindingFlags.Public | BindingFlags.Instance
throw new InvalidProjectFileException ("This is not output property.");
o = propertyInfo.GetValue (task, null);
- // FIXME: maybe we should throw an exception here?
- if (o == null)
- continue;
-
if (itemName != String.Empty) {
PublishItemGroup (propertyInfo, o, itemName);
} else {
object o,
string propertyName)
{
- BuildProperty bp = ChangeType.ToBuildProperty (o, propertyInfo.PropertyType, propertyName);
+ if (o == null) {
+ parentProject.EvaluatedProperties.RemoveProperty (propertyName);
+ return;
+ }
+
+ BuildProperty bp;
+ try {
+ bp = ChangeType.ToBuildProperty (o, propertyInfo.PropertyType, propertyName);
+ } catch (Exception e) {
+ throw new Exception (String.Format ("Error publishing Output from task property '{0} {1}' to property named '{2}' : {3}",
+ propertyInfo.PropertyType, propertyInfo.Name, propertyName, e.Message),
+ e);
+ }
parentProject.EvaluatedProperties.AddProperty (bp);
}
object o,
string itemName)
{
- BuildItemGroup newItems = ChangeType.ToBuildItemGroup (o, propertyInfo.PropertyType, itemName);
+ if (o == null)
+ return;
+
+ BuildItemGroup newItems;
+ try {
+ newItems = ChangeType.ToBuildItemGroup (o, propertyInfo.PropertyType, itemName);
+ } catch (Exception e) {
+ throw new Exception (String.Format ("Error publishing Output from task property '{0} {1}' to item named '{2}' : {3}",
+ propertyInfo.PropertyType, propertyInfo.Name, itemName, e.Message),
+ e);
+ }
+
newItems.ParentProject = parentProject;
if (parentProject.EvaluatedItemsByName.ContainsKey (itemName)) {
}
}
}
-
-#endif