Open Closed

A page must define a public, non-static 'Model' property #1964


User avatar
0
hitaspdotnet created
  • ABP Framework version: v5.0.0-beta.1
  • Template type: Microservice
  • DB provider: EF Core
  • Exception message and stack trace:
System.InvalidOperationException: The type 'vAnOhd8kBREcGO1P7Oo.vERgfT88EFtV78GBxyV' is not a valid page. A page must define a public, non-static 'Model' property.
   at Microsoft.AspNetCore.Mvc.ApplicationModels.DefaultPageApplicationModelProvider.CreateModel(PageActionDescriptor actionDescriptor, TypeInfo pageTypeInfo)
   at Microsoft.AspNetCore.Mvc.ApplicationModels.DefaultPageApplicationModelProvider.OnProvidersExecuting(PageApplicationModelProviderContext context)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.CompiledPageActionDescriptorFactory.CreateCompiledDescriptor(PageActionDescriptor actionDescriptor, CompiledViewDescriptor viewDescriptor)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.DefaultPageLoader.LoadAsyncCore(PageActionDescriptor actionDescriptor, EndpointMetadataCollection endpointMetadata)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageLoaderMatcherPolicy.ApplyAsyncAwaited(CandidateSet candidates, Task`1 actionDescriptorTask, Int32 index)
   at Microsoft.AspNetCore.Routing.Matching.DfaMatcher.SelectEndpointWithPoliciesAsync(HttpContext httpContext, IEndpointSelectorPolicy[] policies, CandidateSet candidateSet)
   at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.<Invoke>g__AwaitMatch|8_1(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task matchTask)
   at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
  • Steps to reproduce the issue:"
  1. Create project using CLI abp new Acme.BookStore -t microservice-pro --preview && cd shared/Acme.BookStore.DbMigrator && dotnet run
  2. ./run-tye.ps1
  3. Use the tye dashboard and go to the auth-server app or try login from apps

Unziped version of cached template has this problem too, with same vAnOhd8kBREcGO1P7Oo.vERgfT88EFtV78GBxyV type error


4 Answer(s)
  • User Avatar
    0
    hitaspdotnet created

    I have tried with /graphbuild

    error CS0433: The type 'PermissionDefinitionProvider' exists in both 'Volo.Abp.Authorization.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Volo.Abp.Authorization, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null'
    

    local project references with bug fix works.

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    I couldn't reproduce the problem.

    I created a test microservice application using cli

    Used dotnet build /graphBuild. Completed without any error. Can you try rebuilding solution after deleting bin/obj folders?

  • User Avatar
    0
    hitaspdotnet created

    Can you try rebuilding solution after deleting bin/obj folders?

    I have tried with clean nuget cache/bin/obj/sdks/run times everythings related to a .net project. Can you login? The type 'vAnOhd8kBREcGO1P7Oo.vERgfT88EFtV78GBxyV' is not a valid page. A page must define a public, non-static 'Model' property. I got this error with same vAnOhd8kBREcGO1P7Oo.vERgfT88EFtV78GBxyV with fresh app-pro tired identityServer

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Can you try rebuilding solution after deleting bin/obj folders?

    I have tried with clean nuget cache/bin/obj/sdks/run times everythings related to a .net project. Can you login? The type 'vAnOhd8kBREcGO1P7Oo.vERgfT88EFtV78GBxyV' is not a valid page. A page must define a public, non-static 'Model' property. I got this error with same vAnOhd8kBREcGO1P7Oo.vERgfT88EFtV78GBxyV with fresh app-pro tired identityServer

    I have reproduced this when trying to reach Account/Login page on both tiered and non-tiered app-pro app. This seems a problem related with Account Web module.

    We'll investigate. Thanks for reporting! I will refund your question.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09