Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using packages from custom NuGet repositories #143

Closed
3 tasks
amellnik opened this issue May 8, 2017 · 6 comments
Closed
3 tasks

Using packages from custom NuGet repositories #143

amellnik opened this issue May 8, 2017 · 6 comments

Comments

@amellnik
Copy link

amellnik commented May 8, 2017

What's the suggested method for providing the location for NuGet packages in private repositories to CF? Is there a way to specify this in the .csproj file or manifest.yml?

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

{
   "name": "",
   "build": "",
   "support": "http://...",
   "version": 0,
   "description": "...",
   "authorization_endpoint": "https://...",
   "token_endpoint": "https://...",
   "min_cli_version": "6.0.0",
   "min_recommended_cli_version": "6.10.0",
   "api_version": "2.68.0",
...
}

6.23.1+a70deb3.2017-01-13

What version of the buildpack you are using?

If you were attempting to accomplish a task, what was it you were attempting to do?

Push a .NET Core application that relies on a NuGet package installed from a custom repository.

What did you expect to happen?

I had hoped Install-Package Package.Name -Source MyRepo would record the source repo somewhere (which is not an issue with this buildpack). Because it does not, I'm hoping that there's a way to specify it in the project or as an option in manifest.yml or similar.

What was the actual behavior?

CF push gets a "unable to resolve Package.Name" error:

         Installing Microsoft.Extensions.CommandLineUtils 1.0.1.
       /tmp/app/.dotnet/sdk/1.0.3/NuGet.targets(97,5): error : Unable to resolve 'Package.Name (>= 2017.5.5.
1536)' for '.NETCoreApp,Version=v1.1'. [/tmp/app/AppName.csproj]

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction
@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/145076297

The labels on this github issue will be updated when the story is started.

@itzunagi
Copy link
Contributor

itzunagi commented May 8, 2017

You can provide a NuGet.Config file in the root directory of your application to specify which repositories should be used. You can find a basic example here which just specifies the standard nuget.org repository. Also see NuGet.Config File Reference for more details.

@amellnik
Copy link
Author

amellnik commented May 8, 2017

Even using the default NuGet.Config you linked above I'm getting

       /tmp/app/.dotnet/sdk/1.0.3/NuGet.targets(97,5): error : NuGet.Config is not valid XML. Path: '/tmp/app/NuGet.Conf
ig'. [/tmp/app/Poukai.csproj]
       /tmp/app/.dotnet/sdk/1.0.3/NuGet.targets(97,5): error :   Data at the root level is invalid. Line 1, position 1.
[/tmp/app/Poukai.csproj]

before it attempts to restore any packages. I think this might be related to NuGet/Home#2667.

@amellnik
Copy link
Author

amellnik commented May 9, 2017

What version of NuGet is the buildpack currently using, and is there any way to bump it to 3.4.4 which apparently fixes this?

@itzunagi
Copy link
Contributor

@amellnik The buildpack uses the .NET Core SDK to restore packages, which uses NuGet internally, so the version of NuGet is tied to the SDK version. SDK versions can be specified in the global.json file.

@sclevine
Copy link

sclevine commented Jun 5, 2017

Seems like this was answered. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants