I need to add a Shared Project reference to a project.
I tryed some methods from ProjectItems interface, but it didn't work. I did it because the shared project reference is listed in the Project.ProjectItems enumerable with a name "< SharedContent>"
I have compared csproj files with and without a shared reference. The only difference is an import element like this:
<Import Project="..\SharedContent\SharedContent.projitems"
Label="Shared"
Condition="Exists('..\SharedContent\SharedContent.projitems')" />
How can I add these import elements?
Obs: "SharedContent" is my project name
UPDATE 1:
I also noted that the solution file is modified too:
GlobalSection(SharedMSBuildProjectFiles) = preSolution
SharedContent\SharedContent.projitems*{f3e7148f-bcaf-4dc4-8138-1055ebf08e37}*SharedItemsImports = 13
SharedContent\SharedContent.projitems*{22bdf785-c2ad-4c18-9a39-b7a551f4756a}*SharedItemsImports = 4
EndGlobalSection
The second line reference is add with the guid of the project in which I added the shared reference.
I discarded this method for now, as it's seems that the Shared Project Extensions manages all references when vs is running. Also I'll be in merce of any changes in this extension.