Trying to set Project Properties from custom task in C#
"Macdiarmid, James D." <[email protected]> Thu, 14 Jul 2011 12:17:13 -0400
| Newsgroups | gmane.comp.windows.dotnet.nant.user |
|---|---|
| Message-ID | <F7A8C27240D1154593A0F16214BF0BBD02F25617@0015-its-exmb14.us.saic.com> |
I'm working on a custom task dll trying to determine how to set the project properties. When I run a build script with my custom task it works fine using the following syntax: Properties["Color"] = "Red"; However, when I run this in the VS2008 IDE while debugging the code, I keep getting a nullreferenceException on the Project object. Is there any way to create a project object based on a passed in name if the project object doesn't exist or is Null? Right now I have a class called ConnectionInformation which has methods for connecting to TFS and another class called BaseTask which inherits from the NAnt.Core.Task and has an instantiation of ConnectionInformation to pass on to other tasks in my DLL. I'm doing this so that in my Build script I can set my connection information once and refer back to it as an element in each task that needs it. I'm just not sure how to instantiate a test Project object for debugging purposes. Thanks in advance, Jim ------------------------------------------------------------------------------ AppSumo Presents a FREE Video for the SourceForge Community by Eric Ries, the creator of the Lean Startup Methodology on "Lean Startup Secrets Revealed." This video shows you how to validate your ideas, optimize your ideas and identify your business strategy. http://p.sf.net/sfu/appsumosfdev2dev _______________________________________________ NAnt-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nant-users