dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.27k stars 5.9k forks source link

dotnet add package String reference error #3368

Closed ugreg closed 7 years ago

ugreg commented 7 years ago

String reference error

Notice how there is no proper string replacement done below.

Error while adding package '{0}' to project '{1}'

Would like to help fix, but not sure where the repo or if it is open source for the ERROR handling in the dotnet CLI.

Error

C:\GitHub\_mr.robot\DYN.Gamification\DYN.Gamification [master ≡ +2 ~2 -0 !]> dotnet add package Microsoft.CrmSdk.CoreAssemblies --version 8.2.0.2
  Writing C:\Users\grdegr\AppData\Local\Temp\tmp399F.tmp
info : Adding PackageReference for package 'Microsoft.CrmSdk.CoreAssemblies' into project 'C:\GitHub\_mr.robot\DYN.Gamification\DYN.Gamification\DYN.Gamification.csproj'.
error: Error while adding package '{0}' to project '{1}'. dotnet add package command supports adding package to one project at a time. But no project was found at the project path '{0}'.
C:\GitHub\_mr.robot\DYN.Gamification\DYN.Gamification [master ≡ +2 ~2 -0 !]>
mairaw commented 7 years ago

Thanks @gregdegruy. Can you provide the info you get when you run dotnet --info? The CLI repo is open source too. You can find it at https://github.com/dotnet/cli/.

I have 2.0.0 SDK installed and the message I get is different. So it would be good to know which version you're running.

C:\Temp\projects\DYN.Gamification [master ≡ +2 ~2 -0 !]>dotnet add package Microsoft.CrmSdk.CoreAssemblies --version 8.2.0.2
Could not find any project in `C:\Temp\projects\DYN.Gamification [master ≡ +2 ~2 -0 !]\`.
Usage: dotnet add <PROJECT> package [options] <PACKAGE_NAME>

Arguments:
  <PROJECT>        The project file to operate on. If a file is not specified, the command will search the current directory for one.
  <PACKAGE_NAME>   The package reference to add.

Options:
  -h, --help                                Show help information.
  -v, --version <VERSION>                   Version for the package to be added.
  -f, --framework <FRAMEWORK>               Adds reference only when targeting a specific framework.
  -n, --no-restore                          Adds reference without performing restore preview and compatibility check.
  -s, --source <SOURCE>                     Specifies NuGet package sources to use during the restore.
  --package-directory <PACKAGE_DIRECTORY>   Restores the packages to the specified directory.

/cc @livarcocc @dsplaisted

ugreg commented 7 years ago

I'm also on 2.0.0

.NET Command Line Tools (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.0\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
mairaw commented 7 years ago

Interesting. And so do you have a project on that path or not? If so, what's the name of the csproj file? I'm wondering if the engine is getting lost with all those special characters in the file path, given this output without the full folder name:

Adding PackageReference for package 'Microsoft.CrmSdk.CoreAssemblies' into project 'C:\GitHub\_mr.robot\DYN.Gamification\DYN.Gamification\DYN.Gamification.csproj'.

ugreg commented 7 years ago

I do and there's one extra period in the name (I've removed the name between the period so I'll just the word Customer in there for now) it's called DYN.Customer.Gamification.csproj

dsplaisted commented 7 years ago

This issue was moved to dotnet/cli#7889

dsplaisted commented 7 years ago

I've moved this issue to the dotnet/cli repo, but I don't have permission to close it here in the docs repo.

BillWagner commented 7 years ago

Thanks @dsplaisted I'll close the issue here. See dotnet/cli#7889