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.

TypeLoadException: Could not load type TaskAwaiter from System.Runtime

See original GitHub issue

I am trying to generate a CSharp client for my asp.net core Web Api project. I added the “PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>” to the csproj, which didnt work and then I compiled self contained via CLI. When generating output I get the following exception however:

Could not load type ‘System.Runtime.CompilerServices.TaskAwaiter`1’ from assembly 'System.Runtime, Version=4.0.0.0, Culture…

Server stack trace: at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs) at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit) at System.Attribute.GetCustomAttributes(MemberInfo element, Boolean inherit) at NSwag.SwaggerGeneration.WebApi.WebApiToSwaggerGenerator.<>c.<GetActionMethods>b__14_1(MethodInfo m) at System.Linq.Enumerable.<>c__DisplayClass6_01.<CombinePredicates>b__0(TSource x) at System.Linq.Enumerable.WhereArrayIterator1.MoveNext() at NSwag.SwaggerGeneration.WebApi.WebApiToSwaggerGenerator.<GenerateForControllerAsync>d__11.MoveNext()

Whats up here?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
RicoSutercommented, Sep 18, 2017
1reaction
RicoSutercommented, Sep 11, 2017

In v11.7 the annotations redirect is removed, you can use studio to create the nswag.json file and run it via cmd line and the core binaries.

I hope to find a solution for this so that it also works in a full .net process.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not load type 'System.Runtime.CompilerServices. ...
I had this problem, except the type it couldn't load was System.Reflection.AssemblyMetadataAttribute. The web application was built on a machine ...
Read more >
Error "Could not load type System.Runtime.CompilerServices ...
When running Data Health Check node in a workspace, it gives an error message "Could not load type System.Runtime.CompilerServices.
Read more >
Could not load type 'System.Runtime.InteropService...
Hi, Im experiencing issue to start PBI Desktop today 29/July/21. Does anybody has the same issue with me? I already click 'Send the...
Read more >
Getting 'Could not load type 'System.Runtime.Diagnostics. ...
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information ...
Read more >
Receiving System.TypeLoadException when calling Folder ...
I am using the Laserfiche.RepositoryAccess SDK. When I run the Folder.GetFolderInfo(path, session) command I get the following error...
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