I am trying to write a plugin für R# which is able to do stuff like modifying a project name and adding project references.
I was able to get to the point where I could select a project in the solution explorer and then call my plugin thru the "Resharper" menu. Then I retrieve a reference to the selected project like this:
IProject myProject = context.GetData<IProjectModelElement>(DataConstants.PROJECT_MODEL_ELEMENT) as IProject;
Now I try to change the name of this project:
This does not lead to any effect. Also no error message seems to be displayed.
Now I found out that may need to use a WriteLock to do that:
This also has no effect.
Same thing with adding a reference:
No visible effect in Solution explorer. However, in this case when I look in the debugger I can see that myProject.myProjectReferences actually increases it's size from 0 to 1. But I cannot see the reference in the solution explorer.
Does anyone know what I do wrong? Would you suggest to write a native Visual Studio Add-in for tasks like this instead?