GithubHelp home page GithubHelp logo

Comments (4)

priya-kinthali avatar priya-kinthali commented on September 3, 2024

Hello @Denyyyys 👋,
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.

from setup-dotnet.

suyashgaonkar avatar suyashgaonkar commented on September 3, 2024

Hi @Denyyyys, we did had look into this and we see that cache-dependency-path does not accept multiple paths in a array. You can try by passing multiple paths with help of pipe operator, that should hopefully resolve your issue. Please let us know incase you still face the issue. Please find a small example below for your reference.
with:
dotnet-version: 8.0.x
cache-dependency-path: |
'./appsettings.Development.json'
'./appsettings.json'

from setup-dotnet.

Denyyyys avatar Denyyyys commented on September 3, 2024

Hello @suyashgaonkar.

Thank you for your response!

Unfortunatelly, your solution didn't work for me. When I use the same configuration as you showed, it implicitly sets cache: false, which means the cache is not used. In this case, everything works as expected, but I want to use the cache. When I try to add cache: true and use the pipe operator like this:
dotnet-version: 8.x
cache: true
cache-dependency-path: |
'./backend/WebServer'
'./tetBackend'

I see the following error: Error: Some specified paths were not resolved, unable to cache dependencies. You can see my job logs for this configuration using that link. My repository in that state is available under this link, so feel free to use this repo.

Even if you figure out how to use the cache with package.lock.json files from ./testBackend and ./backend/WebServer paths, the build pipeline fails during the test phase.

Any help you can provide would be greatly appreciated!

from setup-dotnet.

suyashgaonkar avatar suyashgaonkar commented on September 3, 2024

Hi @Denyyyys , the way cache dependency works is that builds and restore the cache depending on the changes found in packages.lock.json file, hence we need to pass the absoloute path to the package.lock.json file in the cache-dependency-path.You can check the official documentation on the same in the following url: https://github.com/actions/setup-dotnet?tab=readme-ov-file#caching-nuget-packages.
We did fork your repo to work upon the issue and attached screenshot has the result with suggested solution.

image

Another alternative that we can suggest to help you with caching dependecy is actions/cache Github action. You can find detailed documentation and examples related to caching in the follwing links :
https://github.com/actions/cache
https://github.com/actions/cache/blob/main/examples.md#c---nuget

from setup-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.