Skip to content

Hot Reload seems not to work properly for ASP.NET Core #26

@xhafan

Description

@xhafan

Error:

2022-04-26 13:06:35.722 +02:00 [ERR] An unhandled exception has occurred while executing the request.
System.InvalidCastException: Unable to cast object of type '<some entity>' to type 'NHibernate.Proxy.INHibernateProxy'.
   at PointOfInterestProxy.NHibernate.Proxy.INHibernateProxy.get_HibernateLazyInitializer()
   at NHibernate.Engine.StatefulPersistenceContext.Clear()
   at NHibernate.Impl.SessionImpl.Close()
   at NHibernate.Impl.SessionImpl.Dispose(Boolean isDisposing)
   at NHibernate.Impl.SessionImpl.Dispose()
   at CoreDdd.Nhibernate.UnitOfWorks.NhibernateUnitOfWork.RollbackAsync()
   at CoreDdd.AspNetCore.Middlewares.BaseUnitOfWorkMiddleware.InvokeAsync(HttpContext context, RequestDelegate next, IUnitOfWork unitOfWork)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

How to replicate: Hot Reload a change, execute the change couple of times.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions