Home: Package Manager Console not working with path containing grave accent (`)

Created on 20 Apr 2017  路  6Comments  路  Source: NuGet/Home

Details about Problem

Package Manager Console

NuGet version: 4.1.0

VS version: MS VS Community 2017 15.1 (26403.7)

OS version: win10 v1607 (14393.1066)

  1. I tried to integrate VCPKG to a project with the command line provided by VCPKG (I like to organize my folders with a grave accent (`) in front of them, it is a valid path):

Install-Package vcpkg.F.vcpkg -Source "F:/`vcpkg/scripts/buildsystems"

  1. Package Manager Console returned an error:

Install-Package : Unable to find package 'vcpkg.F.vcpkg' at source 'F:/ cpkg/scripts/buildsystems'.

  1. It appears that it merges ' with v to produce vertical tab which messes up the paths.

  2. Pasting the error in Notepad++ results in:

F:/VTcpkg/scripts/buildsystems

From which I assumed it is converted to a verticle tab

Logs:

PM> Install-Package vcpkg.F.vcpkg -Source "F:/`vcpkg/scripts/buildsystems"
Install-Package : Unable to find package 'vcpkg.F.vcpkg' at source 'F:/cpkg/scripts/buildsystems'.
At line:1 char:1
+ Install-Package vcpkg.F.vcpkg -Source "F:/`vcpkg/scripts/buildsystems ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Time Elapsed: 00:00:00.0208434
PM>
VS.PMConsole External

All 6 comments

The back tick is the escape character in powershell.

does it work if you use: Install-Package vcpkg.F.vcpkg -Source "F:/\`vcpkg/scripts/buildsystems" or escape it in some other way?

That is unfortunate.

Same result:

PM> Install-Package vcpkg.F.vcpkg -Source "F:/\`vcpkg/scripts/buildsystems"
Install-Package : Unable to find package 'vcpkg.F.vcpkg' at source 'F:/\cpkg/scripts/buildsystems'.
At line:1 char:1
+ Install-Package vcpkg.F.vcpkg -Source "F:/\`vcpkg/scripts/buildsystem ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Time Elapsed: 00:00:00.0863047
PM> 

I was off on the escaping, double back tick works.

PM> Write-Host "F:/\`vcpkg/scripts/buildsystems"
F:/\鈾俢pkg/scripts/buildsystems
PM> Write-Host "F:/``vcpkg/scripts/buildsystems"
F:/`vcpkg/scripts/buildsystems

Indeed. Thanks a lot for the help.

What do you think - should I file a bug in VCPKG bug-base about this. Since I just copied and pasted this from vcpkg output:

F:\`vcpkg\scripts\buildsystems>vcpkg.exe integrate project
Created nupkg: F:\`vcpkg\scripts\buildsystems\vcpkg.D.Development.VCPKG.vcpkg.1.0.0.nupkg

With a project open, go to Tools->NuGet Package Manager->Package Manager Console and paste:
    Install-Package vcpkg.D.Development.VCPKG.vcpkg -Source "F:/`vcpkg/scripts/buildsystems"

@DVMirchev if that is what the instructions for VCPKG say, then yes it looks like an issue with the docs.

From what I can tell this looks like normal powershell behavior, NuGet isn't getting a chance to handle this.

This was a bug in vcpkg and should be fixed by Microsoft/vcpkg#964. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sylvainlavoie picture sylvainlavoie  路  3Comments

vsfeedback picture vsfeedback  路  3Comments

livarcocc picture livarcocc  路  3Comments

dotMorten picture dotMorten  路  3Comments

p-kaczynski picture p-kaczynski  路  3Comments