question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not load "Swashbuckle.AspNetCore.SwaggerGen"

See original GitHub issue

Hi,

I added a Xunit project for my integration tests and now I m not able to generate the services.ts file with nswag studio.

This is the error :

System.IO.FileNotFoundException: Could not load file or assembly ‘Swashbuckle.AspNetCore.SwaggerGen, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d84d99fb0135530a’ or one of its dependencies. The system cannot find the file specified. File name: ‘Swashbuckle.AspNetCore.SwaggerGen, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d84d99fb0135530a’

Server stack trace: at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes) at System.Reflection.RuntimeAssembly.GetExportedTypes() at NSwag.SwaggerGeneration.WebApi.WebApiToSwaggerGenerator.GetControllerClasses(Assembly assembly) at System.Linq.Enumerable.<SelectManyIterator>d__162.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.OrderedEnumerable1.<GetEnumerator>d__1.MoveNext() at System.Linq.Buffer1…ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at NSwag.SwaggerGeneration.WebApi.WebApiAssemblyToSwaggerGenerator.WebApiAssemblyLoader.GetControllerClasses(String[] assemblyPaths, IEnumerable1 referencePaths) at NSwag.SwaggerGeneration.WebApi.WebApiAssemblyToSwaggerGenerator.GetControllerClasses() at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.Tasks.Task.Execute() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NSwagStudio.ViewModels.SwaggerGenerators.WebApiToSwaggerGeneratorViewModel.<<LoadAssembliesAsync>b__29_0>d.MoveNext() in C:\projects\nswag\src\NSwagStudio\ViewModels\SwaggerGenerators\WebApiToSwaggerGeneratorViewModel.cs:line 127 — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MyToolkit.Mvvm.ViewModelBase.<>c__DisplayClass14_0.<<RunTaskAsync>b__0>d.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MyToolkit.Mvvm.ViewModelBase.<RunTaskAsync>d__12`1.MoveNext()

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

I installed the nugget package: “Swashbuckle.AspNetCore.SwaggerGen” in all my project.

Do you know how to resolve this problem?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ranoufcommented, Nov 3, 2017

Seems to be ok 😃

0reactions
RicoSutercommented, Nov 1, 2017

Please retest with the latest version of NSwag and use a .NET Core runtime…

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - AspNetCore Could not load type 'Swashbuckle. ...
To fix this try to add Swashbuckle.AspNetCore.Annotations package. Install-Package Swashbuckle.AspNetCore.Annotations -Version 3.0.0. For dotnet ...
Read more >
Could not load file or assembly Swashbuckle.AspNetCore. ...
Hi After updating the CLI from 5.4.1 to 6.0.7 we are getting the following error on our GitHub Action build: Unhandled exception. System.IO....
Read more >
Get started with Swashbuckle and ASP.NET Core
Enter "Swashbuckle.AspNetCore" in the search box. Select the latest "Swashbuckle.AspNetCore" package from the Browse tab and click Install.
Read more >
Swashbuckle.AspNetCore.SwaggerGen 6.5.0
Swagger Generator for APIs built on ASP.NET Core.
Read more >
C# – AspNetCore Could not load type 'Swashbuckle. ...
I have ASP.NET Core Web application where I am using swagger using the following: public void ConfigureServices(IServiceCollection services) { services.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found