I am currently trying to set the BuildAction of files which are in a project. Additionally I really want to avoid the use of `BrowseObject`'s and the DTE. So I ended up with the following:
public void SetBuildAction(string buildAction)
{
ThreadHelper.ThrowIfNotOnUIThread();
var result = Hierarchy.SetProperty(ItemId, (int)__VSHPROPID4.VSHPROPID_BuildAction, buildAction);
ErrorHandler.ThrowOnFailure(result);
}
However, the method is returning me a the following error code:DISP_E_MEMBERNOTFOUND -2147352573 A return value indicating that the requested member does not exist, or the call to Invoke tried to set the value of a read-only property.Since the `GetProperty` method with the same `propId` works as expected, I suspect that this property is read-only. I know for a fact that you can change this value and you are even allowed to by the user, so how comes? Is there any alternative?