1. Ysmary Daza
  2. SnapDevelop
  3. Monday, 25 January 2021 04:48 AM UTC

Hello,

I started to work in PowerBuilder 2019 R3 working on the example https://docs.appeon.com/dwconverter2019r3/CRUD_Operations_with_.NET_DataStore/index.html#introduction CRUD Operations with .NET DataStore, I did all step until the test the Retrieve() method in the SampleController.

Even, I reviewed many times all step to try to find what is going on because I got the following error: 

 

System.Collections.Generic.KeyNotFoundException: No metadata for DataWindow 'd_department' found
   at DWNet.Data.DwModelManager.GetDwModelType(String name)
   at DWNet.Data.DataSourceFactory.Create(IDataStoreBase dataStore, String dataObject, DataContext context)
   at DWNet.Data.DataStoreBase.CreateDataSource(String name, Type modelType, IDwMeta dwMeta, DataContext context)
   at DWNet.Data.DataStoreBase.OnInitializeSource(String name, Type modelType, IDwMeta dwMeta, DataContext context)
   at DWNet.Data.DataStoreBase..ctor(String name)
   at DWNet.Data.DataStore..ctor(String dataObject)
   at WebAPI2.Controllers.SampleController.Retrieve() in C:\Users\ognaranjo\source\repos\WebAPI2\WebAPI2\Controllers\SampleController.cs:line 31
   at lambda_method(Closure , Object , Object[] )
   at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

HEADERS
=======
Cache-Control: no-cache
Connection: Keep-Alive
Accept-Charset: utf-8
Accept-Encoding: gzip, deflate
Accept-Language: en, zh
Cookie: .AspNet.Consent=yes
Host: localhost:5000

 

 

Best Regards,

Ysmary

 

Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Monday, 25 January 2021 06:15 AM UTC
  2. SnapDevelop
  3. # 1

Hi Ysmary,

Thanks for reporting this issue. Please modify the Configure method in the StartUp.cs file. If you are using a non-generic .NET DataStore, you need to add UseDatawindow() to parse the model.

 public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            // Parses and loads models from assemblies loaded in current application domain.
            app.UseDataWindow();

        }

Regards,

Logan

Comment
  1. Ysmary Daza
  2. Tuesday, 26 January 2021 00:54 AM UTC
Thank you so much!

This issue is solved!

  1. Helpful
  1. Zhang JX
  2. Wednesday, 25 May 2022 06:26 AM UTC
To all,

I hit the same with SnapDevelop2021, and tried to solve the issue by installing "DWNet.Data.AspNetCore" Nuget Package by referencing to below Logan's post.

https://community.appeon.com/index.php/qna/q-a/beginner-snapdevelop-demo-issues#reply-25306

Thanks Logan for your advice.



Regards,

JX

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.