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 type 'System.Object' from assembly System.Private.CoreLib

See original GitHub issue

Hi,

Framework Asp.Net Core 2.0 Angular 4

Can you help to fix this error:

Could not load type ‘System.Object’ from assembly ‘System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e’ because the parent does not exist.

System.TypeLoadException: Could not load type ‘System.Object’ from assembly ‘System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e’ because the parent does not exist.

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() — 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 NSwag.SwaggerGeneration.WebApi.WebApiToSwaggerGenerator.<GenerateForControllersAsync>d__9.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 NSwag.SwaggerGeneration.WebApi.WebApiAssemblyToSwaggerGenerator.WebApiAssemblyLoader.<GenerateForControllersAsync>d__1.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 NSwag.SwaggerGeneration.WebApi.WebApiAssemblyToSwaggerGenerator.WebApiAssemblyLoader.GenerateForControllers(IEnumerable`1 controllerClassNames, String settingsData) 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.GenerateForControllers(IEnumerable1 controllerClassNames, String settingsData) 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 NSwag.SwaggerGeneration.WebApi.WebApiAssemblyToSwaggerGenerator.<GenerateForControllersAsync>d__2.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 NSwag.Commands.WebApiToSwaggerCommandBase.<<RunAsync>b__77_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 NSwag.Commands.WebApiToSwaggerCommandBase.<RunAsync>d__77.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 NSwag.Commands.WebApiToSwaggerCommandBase.<RunAsync>d__76.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 NSwag.Commands.NSwagDocumentBase.<GenerateDocumentAsync>d__29.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 NSwag.Commands.NSwagDocumentBase.<ExecuteAsync>d__28.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 NSwagStudio.ViewModels.DocumentViewModel.<>c__DisplayClass15_0.<<GenerateAsync>b__0>d.MoveNext() in C:\Data\Projects\NSwag\src\NSwagStudio\ViewModels\DocumentViewModel.cs:line 46 — 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()

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ranoufcommented, Sep 25, 2017

I followed the instructions from here: https://github.com/RSuter/NSwag/wiki/Assembly-loading I added in the csproj: <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest> Every thing works perfectly!

Thank you!

1reaction
RicoSutercommented, Sep 25, 2017

Ok, now the link works again with v11.8.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not load type 'System.Object' from assembly ...
0.0" in the event viewer when I manually put System.Runtime.dll version 6.0.0.0 inside the gac a different error is coming, saying that Could...
Read more >
Could not load type 'System.Object' from assembly ...
However, when we write the console.exe to disk using: csharpCompilation.Emit(fileNameOnDisk, Path.Combine(Path.GetDirectoryName(fileNameOnDisk), ...
Read more >
Could not load type 'System.Object' from assembly 'mscorlib'
"Could not load type 'System.Object' from assembly 'mscorlib'" error after activating a module or moving the project to another environment.
Read more >
Could not load type 'System.Object' from assembly ...
Hi, Does anyone know what's causing an error below? Could not load type 'System.Object' from assembly 'System.Private.CoreLib ...
Read more >
How to solve "Could not load System.Private.CoreLib"
Serializer adds assemblies next to types you use. System.Private.CoreLib does not exist in .NET Framework and the error is thrown.
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