Skip to content

[projectname].nuget.targets should use $(UserProfile) instead of hard-coded path #1095

@AArnott

Description

@AArnott

I observe that when using project.json for packages that include MSBuild imports, a [projectname].nugget.targets file is created. This file hard-codes the path to my home directory:

<PropertyGroup Condition="'$(NuGetPackageRoot)' == ''">
  <NuGetPackageRoot>C:\Users\andrew\.nuget\packages\</NuGetPackageRoot>
</PropertyGroup>

This makes the project now unshareable with others on the same machine. If instead, NuGet Restore created the file using the $(UserProfile) macro:

<PropertyGroup Condition="'$(NuGetPackageRoot)' == ''">
  <NuGetPackageRoot>$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
</PropertyGroup>

Then it would work appropriately for all users of the machine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:3Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.Product:VS.ClientType:Bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions