Hi
I'm trying to setup the PostBuildEvent of a C++ project programmatically (from C#) but I'm getting the following exception:
{"The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"}
Here's my code:
private void AddBuildevent(object inputParams)
{
ArrayList Inputs = inputParams as ArrayList;
Project pExisting = Inputs[0] as Project;
object[] buildEvents = Inputs[1] as object[];
using (new VMessageFilter())
{
VSProject oProj = pExisting.Object as VSProject;
string buildEvent = buildEvents[1].ToString();
try
{
oProj.Project.Properties.Item("PostBuildEvent").Value = buildEvents;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}