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

Can no longer use relative pathing #148

Open
whodges opened this issue Jan 23, 2025 · 2 comments
Open

Can no longer use relative pathing #148

whodges opened this issue Jan 23, 2025 · 2 comments

Comments

@whodges
Copy link

whodges commented Jan 23, 2025

When I run "dnt switch-to-projects" now with my switcher.json as something along the lines of:

{
  "solution": "Solution.sln",
  "mappings": {
    "Project": "../Project/Project.csproj"
  }
}

I get the following error that's caused by my use of relative pathing:

Executing: dotnet
Names cannot:
- contain any of the following characters: / ? : \ * " < > |
- contain control characters
- be system reserved names, including 'CON', 'AUX', 'PRN', 'COM1' or 'LPT2'
- be '.' or '..' (Parameter 'name')
System.InvalidOperationException: Process execution failed: dotnet
   at Dnt.Commands.Infrastructure.ProcessUtilities.ExecuteAsync(String command, String arguments, Boolean verbose, Boolean writeConsole, CancellationToken cancellationToken) in C:\projects\dnt\src\Dnt.Commands\Infrastructure\ProcessUtilities.cs:line 60
   at Dnt.Commands.CommandBase.ExecuteCommandAsync(String command, String arguments, Boolean writeConsole, IConsoleHost host, CancellationToken cancellationToken) in C:\projects\dnt\src\Dnt.Commands\CommandBase.cs:line 30
   at Dnt.Commands.Packages.SwitchPackagesToProjectsCommand.AddProjectsToSolutionAsync(ReferenceSwitcherConfiguration configuration, IConsoleHost host) in C:\projects\dnt\src\Dnt.Commands\Packages\SwitchPackagesToProjectsCommand.cs:line 57
   at Dnt.Commands.Packages.SwitchPackagesToProjectsCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in C:\projects\dnt\src\Dnt.Commands\Packages\SwitchPackagesToProjectsCommand.cs:line 29
   at NConsole.CommandLineProcessor.ProcessSingleAsync(String[] args, Object input)
   at NConsole.CommandLineProcessor.ProcessAsync(String[] args, Object input)
   at NConsole.CommandLineProcessor.Process(String[] args, Object input)
   at Dnt.Program.Main(String[] args) in C:\projects\dnt\src\Dnt\Program.cs:line 33

If I take out the ".." and use an absolute path, everything is fine. I updated my DNT installation (I was on 1.9.0 and now I'm on 2.0.1) and it happened with both. I did update Visual Studio to 17.13.0 Preview 3 recently (from Preview 2). Could it possibly be tied to that? Something with the build tools?

@whodges
Copy link
Author

whodges commented Jan 24, 2025

Actually, even absolute paths are insufficient when the folder isn't somewhere under the current working directory because the ":" is also banned too.

@whodges
Copy link
Author

whodges commented Jan 24, 2025

Last note: when I roll back to 17.13.0 Preview 2.1, the problem goes away. I've submitted a VS ticket.

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

1 participant