Hi guys. I've been writing an Add-in for VS.NET and I'm currently experiencing some odd behaviour from some of the objects in the Visual C++ Project Model. The MSDN documentation is a little light and I haven't been able to find a shred of evidence on the internet that anyone else is even using these interfaces, let alone having this problem, but hopefully someone here might know something.
Anyway my problem is specifically with the VCCLCompilerTool object. My add-in programmatically sets some of the compiler properties for projects. What is odd is some projects refuse to let their properties be changed (returning 0x80070005 "Access is Denied") and this behaviour seems to be dependent on how/when they're added to a solution! Without going into the complete specifics, basically some projects that don't work when loading up a solution do work when added into a solution that already worked... but then when that solution is saved and reloaded later it doesn't work again! What's worse is attempting to set the properties on a 'bad' project (one that fails) apparently 'poisons' the environment, such that no subsequently opened solution will work (even if it had originally) until I completely shutdown and restart devenv. I have yet to find any difference that might cause one project to be 'bad' versus another...
BTW, my program removes read-only from the project files if they were (was originally causing it not to work at all) and in my desperation I've removed all other vestiges of SourceSafe being involved so I'm fairly confident that that is not the cause.