Error when running with docker and in-memory database
See original GitHub issueHello-
I cloned the repo from the master branch today and attempted to build and run it using the instructions in readme. I’m using a reasonably fresh install of Windows 10 Pro and VS 2019 Pro, with Docker Desktop for Windows. Here are the steps I took:
1.Cloned this repo from the master branch
2. Installed Docker Desktop for Windows
3. Built the solution
4. Ran docker-compose build
which seems to have completed successfully
5. Ran docker-compose up
which failed:
docker-compose up Starting eshoponweb_eshopwebmvc_1 … done Attaching to eshoponweb_eshopwebmvc_1 eshopwebmvc_1 | fail: Microsoft.eShopWeb.Infrastructure.Data.CatalogContextSeed[0] eshopwebmvc_1 | The entity type ‘Address’ requires a primary key to be defined.
The error was repeated 10 times.
Next I tried just hitting “play” and running with IIS Express (no docker). It prompted me to trust the IIS Express certificate and then seemed to work fine. I haven’t tried running with a persistent SQL Server instance yet.
Thank you for the e-book (which I’ve just finished and will probably read at least one more time) and this sample app!
Jared
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top GitHub Comments
@JaredPhelps Just an update for you, I’ve identified what the issue is, I’m just working on the proper fix for it. I hope to have something in, in the next couple days. I’ll explain more after I come up with the best solution but basically the the
OwnsOne
method on theOrderConfiguration
should be treatingAddress
like a value object, but it is trying to treat it as an entity.Explicitly adding the
[Owned]
attribute to theAddress
model “fixes” it but I’m not sure why the fluent mapping isn’t working in the container. This is what I want to investigate further before closing it out.Hope to have an update to you soon.
Hey @JaredPhelps - thanks for raising the issue. I was able to reproduce only in running from Docker. I will take a look tomorrow for sure.