Visualstudio-docs: No way to refer project root name

Created on 15 Oct 2018  Â·  6Comments  Â·  Source: MicrosoftDocs/visualstudio-docs

Hi,

I have a project composed of few platforms that looks like the following:

  • MyProject.Shared
  • MyProject.UWP
  • MyProject.Droid
  • etc.

I need to add a reference in all projects that point to the shared project. The problem is that the generated _csproj_ (for instance in the UWP one) replaces $safeprojectname$.Shared with the full project name, so instead of adding MyProject1.Shared, MyProject1.UWP.Shared is added.

How can I overcome this?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

doc-bug easy support-request

Most helpful comment

So you would use: $ext_safeprojectname$.Shared

All 6 comments

Isn't that what the ext_ prefix is for, to get the parent's variables?

So you would use: $ext_safeprojectname$.Shared

Yes it does. But it's not mentioned in the docs whatsoever.
Here's my Q/A in SO.

@weitzhandler Thanks for confirming that works. I'll add this to the backlog to update the article.

@rhyous Thanks for providing the solution!

@gewarren I believe this one is area-extensibility since it concerns authoring project templates.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DaanV2 picture DaanV2  Â·  4Comments

H35am picture H35am  Â·  4Comments

suhailmahmood picture suhailmahmood  Â·  3Comments

wellwind picture wellwind  Â·  3Comments

rlundy picture rlundy  Â·  3Comments