AddRazorRuntimeCompilation not working when working directory is changed

I’m using newest .Net 5 RC2. For some reason when I run debug, working directory is set to project directory, not “binDebugnet5.0-windows”. That causes some problems because I use some shared files from other projects (they are all copied into one folder on build) so it’s important for me to have working dir in $(TargetDir). I tried to achieve it with 2 ways:

ASP.Net Object is set back to null after OnGet() method

I build a shopping website and I encountered this error when I tried to post some data.The weird thing is the object apparently is null, even though, I can place the product’s name,price,photo and quantity on the page.I have a product class and a product model class which contains a list of products.In the product model class constructor I create the list with the products that I want to display on the site.Anyway, I have the “Clothing” page which has a list of “Product” objects and it uses the ProductModel class to access the product list which has all the data regarding the products that I want to display.When I used a breakpoint to check if the products are sent to the “Clothing” page, I found out that the Product list is null.