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

Difficult to understand error when switcher.json file has spelling mistakes. #137

Open
viblo-majority opened this issue Dec 9, 2023 · 2 comments

Comments

@viblo-majority
Copy link

I created a switcher.json file with the following content

{
  "solution": "Minority.Transactions.sln",
  "mapptings": {
      "some nuget name": "path-to-csproj"
   }

This gives a null ref exception:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Dnt.Commands.Packages.SwitchPackagesToProjectsCommand.AddProjectsToSolutionAsync(ReferenceSwitcherConfiguration configuration, IConsoleHost host) in C:\projects\dnt\src\Dnt.Commands\Packages\SwitchPackagesToProjectsCommand.cs:line 42
   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

Of course, this is a stupid spelling mistake to make ('mapptings' should be 'mappings'), but took me a while to find. It would have been great if it had done some kind of validation and told me I had a mistake in the file, since now I dont know if my file is bad or something else (this was the first time I tried dnt).

@7645re
Copy link

7645re commented Jan 2, 2024

#141

If you have any ideas, then tell me, I want to make a small contribution to the project 🐱
While we wait for Rico to sober up from Jack Daniels, Happy New Year! ☃️

@viblo-majority
Copy link
Author

I dont have any specific comment, any fix would be great from my point of view. From a quick look it seems your PR will improve the error given nicely :)

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

2 participants