Skip to content
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

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

Open
xhafan opened this issue Apr 26, 2022 · 3 comments
Open

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

xhafan opened this issue Apr 26, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@xhafan
Copy link
Owner

xhafan commented Apr 26, 2022

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.

@xhafan xhafan added the bug Something isn't working label Apr 26, 2022
@xhafan
Copy link
Owner Author

xhafan commented Jan 26, 2023

@shmatt
Copy link

shmatt commented Apr 17, 2024

Came across this issue when searching for a solution to the same problem I am facing, but not using coreddd.

It seems that this is an issue with nhibernate itself, and not specifically with this library

@xhafan
Copy link
Owner Author

xhafan commented Apr 17, 2024

That's my feeling as well. Wanted to reproduce it purely using NHibernate and not CoreDdd, but have no time to do that. Hopefully I will do it at some point in the future 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants