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

Give a better error with Swashbuckle.AspNetCore.Cli when there is .dll version mismatch #2666

Closed
mcraiha opened this issue Jun 13, 2023 · 1 comment

Comments

@mcraiha
Copy link

mcraiha commented Jun 13, 2023

If one uses dotnet tool to install Swashbuckle.AspNetCore.Cli and the actual project uses different version of Swashbuckle.AspNetCore.Swagger.dll (e.g. 6.5.0 vs 6.4.0) you will get error like

Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'Swashbuckle.AspNetCore.Swagger, Version=6.0.7.0, Culture=neutral, PublicKeyToken=62657d7474907593'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'Swashbuckle.AspNetCore.Swagger, Version=6.0.7.0, Culture=neutral, PublicKeyToken=62657d7474907593'
   at Swashbuckle.AspNetCore.Cli.Program.<>c.<Main>b__0_3(IDictionary`2 namedArgs)
   at Swashbuckle.AspNetCore.Cli.CommandRunner.Run(IEnumerable`1 args) in C:\projects\ahoy\src\Swashbuckle.AspNetCore.Cli\CommandRunner.cs:line 68
   at Swashbuckle.AspNetCore.Cli.CommandRunner.Run(IEnumerable`1 args) in C:\projects\ahoy\src\Swashbuckle.AspNetCore.Cli\CommandRunner.cs:line 59
   at Swashbuckle.AspNetCore.Cli.Program.Main(String[] args) in C:\projects\ahoy\src\Swashbuckle.AspNetCore.Cli\Program.cs:line 111

but it would be better to tell the use that there is a version mismatch.

So something like:

Swashbuckle.AspNetCore.Cli version 6.5.0 cannot process %path%/Swashbuckle.AspNetCore.Swagger.dll because it is based on version 6.4.0 and both versions must match!

@martincostello
Copy link
Collaborator

You could suggest that any tool write custom exception messages to handle mismatched dependency versions in any combination.

This isn't worth us maintaining custom support for.

@martincostello martincostello closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2024
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