Coder Social home page Coder Social logo

benmccallum / dotnet-references Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 3.0 81 KB

A dotnet global tool for working with references in solution and project files

License: MIT License

C# 100.00%
dotnet-global-tool csproj-tooling dotnet-core docker github-actions

dotnet-references's Issues

Error running fix mode

I follow the steps as outlined. I end up with a flat root source folder with one sln file and several csproj files. However, when I run dotnet references fix I get the following error, which seems to originate from dotnet itself. Any ideas how to fix?

Step 15/25 : RUN dotnet references fix -ep MySolution.sln -wd . -rupf
---> Running in b13ea6e2a0a9
Specify which project file to use because this '/src' contains more than one project file.
The command '/bin/sh -c dotnet references fix -ep MySolution.sln -wd . -rupf' returned a non-zero code: 1

Here's my dockerfile build phase that results in the error:

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build

#Set up dotnet tools
ENV PATH="${PATH}:/root/.dotnet/tools"
RUN dotnet tool install -g dotnet-references

WORKDIR /src
COPY *.sln ./
COPY */*.csproj ./
RUN dotnet references fix -ep MySolution.sln -wd . -rupf

Mixed backslash and forward slash issue

Hi. Thanks for this tool! I use it for the docker restore issue.

I have encountered a small issue on a big windows-developed project compiled on Linux machines.

On

var lastSlashIndex = input.LastIndexOf('\\');

You use the windows separator instead of Path.DirectorySeparatorChar. So whenever we have linux-style separators, we get a Could not find csproj file path for: 'Include="../xxxProject/xxxProject.csproj'. error.

However, as many projects actually a happy mix of forward and back slashes, I believe the best way to deal with this is to String.Replace all back with forward, as you actually already do in FixLocationsOfProjectsProcessor.cs.

Thanks for your help!

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.