ModernRonin / ProjectRenamer

Conveniently rename your csproj files
Other
155 stars 14 forks source link

Error: Could not find project or directory because of wrong file path construction #22

Closed ghost closed 3 years ago

ghost commented 3 years ago
[user@ws csharp]$ renameproject KombiN ./kombin
Please review the following settings:
Project:                   KombiN
found at:                  /home/user/libs/KombiN/csharp/KombiN\KombiN.csproj
Rename to:                 kombin
at:                        /home/user/libs/KombiN/csharp/kombin/kombin.csproj)
VS Solution folder:        none
exclude:                   
Paket in use:              no
Run paket install:         yes
Run build after rename:    no
Create automatic commit:   yes
Git version:               git version 2.29.2

-----------------------------------------------
Do you want to continue with the rename operation? [Enter=Yes, any other key=No]
Analyzing references in your projects - depending on the number of projects this can take a bit...
Could not find project or directory `/home/user/libs/KombiN/csharp/KombiN\KombiN.csproj`.
call 'dotnet list "/home/user/libs/KombiN/csharp/KombiN\KombiN.csproj" reference' failed - aborting
...running git reset to undo any changes...
HEAD is now at a8e168e changed xml doc and rename test file
$ dotnet --info
.NET SDK (reflecting any global.json):
 Version:   5.0.102
 Commit:    71365b4d42

Runtime Environment:
 OS Name:     fedora
 OS Version:  33
 OS Platform: Linux
 RID:         fedora.33-x64
 Base Path:   /usr/lib64/dotnet/sdk/5.0.102/

Host (useful for support):
  Version: 5.0.2
  Commit:  cb5f173b96

.NET SDKs installed:
  3.1.111 [/usr/lib64/dotnet/sdk]
  5.0.102 [/usr/lib64/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.11 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.2 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.11 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.2 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
ModernRonin commented 3 years ago

I think this happens because there is a backslash in the path and you are on a *nix platform. It seems somewhere in code I've forgotten to use Environment.DirectorySeparator, I'll have to find that.

I have actually never tested this on *nix yet, but you just gave me good reason.

As mentioned in the other issue you filed, I'm a bit under stress now in my work, but I'll try and fix this this week. Thanks for finding and reporting!

ModernRonin commented 3 years ago

would be nice if someone could take this over who's used to developing C# on a nix machine - my nix days are decades past. and I never really did C# on *nix.

ghost commented 3 years ago

@ModernRonin I will be happy to help in this one but might be slow. I will start working on it.

ModernRonin commented 3 years ago

@pranav-ninja This is open source. There is no rush or deadline :-) And I am very grateful if you can take this one over, as will all the other people be who use C#/.net on *nix machines.

Thanks a lot!