Coder Social home page Coder Social logo

Comments (5)

benmccallum avatar benmccallum commented on June 5, 2024

Hi @NArnott, I've indeed seen this before and it's a limitation of the dotnet cli from memory. Are you able to have a quick google for that error, I'm sure you'll find the issue on the dotnet core repo. If you can post your list of files when you run the CMD too that might help us figure out what the circumstance is!

from dotnet-references.

NArnott avatar NArnott commented on June 5, 2024

At this point, there is a single sln file, and 6 csproj files in the /src folder. That's all that was copied to the container at that point. It seems like the dotnet executable just doesn't like having multiple sln/proj files in the same folder, which is what I was hoping this tool would fix due to docker's COPY limitations.

I'm wondering if it's only an issue with the 3.x (3.1) dotnet tools? Have you tested using that version?

from dotnet-references.

benmccallum avatar benmccallum commented on June 5, 2024

I'm using this on 2.2 and 3.1 builds at the moment, but I think you're suspicions are correct because I've got my .sln file one level down in a subfolder by itself as it so happens.

Here's the dotnet cli issue: dotnet/sdk#7226

The problem is the .sln file needs to be in the correct relative path to start with so that the rest of the .csproj files moves into their correct place too, but I think the issue is caused by the cwd when you execute the dotnet cmd, so potentially if you just create a directory like ./temp, set that as your CWD and then use the arguments to point to the rights files, all might be good in the world.

WORKDIR /src
COPY *.sln ./
COPY */*.csproj ./

# Make and go to a temp directory to execute the tool from
RUN mkdir temp # or equivalent linux cmd
WORKDIR temp

# Refer to sln file and working directory with ..
RUN dotnet references fix -ep ../MySolution.sln -wd .. -rupf

Can you give that a try and let me know how you go? If it's all good, I'll update the docs. Bit painful this one :P

from dotnet-references.

NArnott avatar NArnott commented on June 5, 2024

Didn't seem to work using WORKDIR temp, but a slight tweak of your idea works for me:

WORKDIR /src/temp 
RUN dotnet references fix -ep ../MySolution.sln -wd .. -rupf
WORKDIR /src

Thanks for you help

from dotnet-references.

benmccallum avatar benmccallum commented on June 5, 2024

Ah yep, I guess you weren't already in the /src directory. My example started with a WORKDIR /src.

Cool, I'll update the docs. Glad we could find a workaround!

from dotnet-references.

Related Issues (6)

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.