-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Could not load type 'System.Object' from assembly System.Private.CoreLib #918
Comments
This is a new one :) try adding the assembly in question to the assemblies list (you can add multiple assembly paths in the ui, one per line) |
Did you publish the app first? With all dlls? |
So I added "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.0\System.Private.CoreLib.dll" When I try to generate the code, I have this error: Server stack trace: Exception rethrown at [0]: |
I got this error with NSwag v11.5.0 (Build 866), are you sure you have latest NSwag v11.5.1? |
Was just a demo, not a repro. Can you provide one? |
Just informing ranouf to check the latest version that fixed this error |
Can you provide a repro sample project? |
Hi, So C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.0 was already in my Paths to search, and I have: I updated to the last version, and I have the same error:
|
My project is too big to be able to reproduce it sorry. Do you have other suggestions? |
Have you tried to manually add the => https://github.com/RSuter/NSwag/wiki/Assembly-loading#troubleshooting |
My problem is that I don't have a large .NET Core 2.0 project to test NSwag - all my core projects are currently still on 1.1... Isnt there a way to reproduce this in an "empty" project? The simplest solution is to use the NSwag middleware to serve the spec directly from the ASP.NET Core process, but this way you cannot generate the spec from cmd line... |
Closed, see duplicate: |
Hi, i m not sure to understand. I read the other Issue (#922), so currently, there is no solution, the only way to generate the TypeScript services used for angular is with the command line: Do I Understand well the situation? |
So I downloaded the file : https://localhost:XXXXX/swagger/v1/swagger.json Executing file 'XXX.Web\swagger.json'... Duration: 00:00:02.6554803 This is my nswag configuration: And, my generated angular Service Ts file is supposed to be updated? Current the file is not updated, maybe there is something is misconfigured or I dont understand ... Can you give me more details please? |
Please test this new feature: #953 |
Hi, Thank you for your reactivity :) There is 2 tests:
I went to #953. I m not sure what I have to do to test your fix, i have the last version available (v11.7.2.0) but in the WebApi Assemble Tab there is not Runtime DropDown. Thank you for you help. |
You have to download the CI build from the AppVeyor build server... the new Runtime option is not released yet. |
So i went to https://ci.appveyor.com/project/rsuter/nswag-25x6o/build/2662, but nowhere i can download any file. I signin too just in case the link is available only for logged in users, but it didnt work |
Thanks, So i downloaded the app. When I open it, i have error messages, but it works! I can generate the file with my Sample Project (https://github.com/ranouf/AspNetCore2Angular4/tree/nswag). I updated the settings, but strangely I have the same problem as i have with swagger.config.nswag, all my functions are in the same Class Service : I would like something like SampleService and TestService. Is there an option to enable in the nswag studio app? [EDITED] It works now 🥇 !! (Currently it s not working on my main project, i will work more on it and I let you know if it s work :)) Thanks |
Currently you cannot output in multiple files.. Can you post the error messages? |
I reopen the app, there is no error message anymore. Sorry I didnt take a screenshot of them the first time. About all the functions in the same class, it s not I would like to have them in different files, i would like in the same file but in different class, exemple:
Currently I have :
|
I think you can use SwaggerOperation(“Sample_GetSample”) And use multiple clients from operation id in the code generator settings and “{client}Service” as client name |
OperationGenerationMode |
I found the solution :) I removed the [SwaggerOperation] Attribute from my Controllers, and now I have different class for each controller. The issue is now resolved! |
Yes, by default, the operation ids are generated in the form "Controller_Action" which are then splitted and grouped by the code generators... |
Hi, I just Added Identity core and now I have a new error when I went to use nswag:
I did a publish in a local folder which is included in Nswag Configuration. For AccountControler the app asks for Microsoft.Extensions.Identity.Core and AuthorizationController, Microsoft.Extensions.Identity.Stores Let me know if you need more details. |
v11.8 has been released, please test your projects with it: The wiki has been updated: https://github.com/RSuter/NSwag/wiki/Assembly-loading |
Hi I went on https://github.com/RSuter/NSwag/wiki/NSwagStudio And there is an error: |
Download it from here (v11.8.1) as soon as its released: |
I think the link is broken as long as a release is building :) |
Ok, now the link works again with v11.8.1 |
Please report if anything works as expected... |
I followed the instructions from here: https://github.com/RSuter/NSwag/wiki/Assembly-loading Thank you! |
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.b__14_1(MethodInfo m)
at System.Linq.Enumerable.<>c__DisplayClass6_0
1.<CombinePredicates>b__0(TSource x) at System.Linq.Enumerable.WhereArrayIterator
1.MoveNext()at NSwag.SwaggerGeneration.WebApi.WebApiToSwaggerGenerator.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.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.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(IEnumerable
1 controllerClassNames, String settingsData) at System.Threading.Tasks.Task
1.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.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.<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.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.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.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.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.<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.<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.d__12`1.MoveNext()
The text was updated successfully, but these errors were encountered: