I have been experimenting with switching nopCommerce from targeting .net frame 4.6.1
to netcoreapp2.0
There has been some unexpected surprises along the way but I do have a reasonably working version currently.
I am willing to do a pull request on GitHub but I think with the beta so close it's probably not the time for such a major change in the backend
Some notes though:
1. Entity Framework Core
- Redo the mapping classes. The instructions now go in the OnConfigure method not constructor
- Many to many relationships can be done however they need to be explicitly defined and configured
- Any usage of the many to many has to work on the join entity
- Surprisingly lazy loading is not as much of an issue as expected. So far just mostly related to PermissionRecord, product attributes and specifications, and Address. Otherwise most of everything else (tested so far) is working
- Sql Server Compact Edition does not work in .net core 2
- Have added SQLite (with MySQL and PostgreSQL to come)
2. Incompatible references
- ImageResizer depends on Bitmap which is only available on full .net. SixLabors.ImageSharp looks like a good replacement
3. Other gotchas
- File paths. Must use unix style paths. Windows will work with both Win32 and unix style paths (including combination in one path) but unix will throw an error if Win32 paths are used
- File/Folder naming. Unix is case sensitive so incorrect case may cause problems. Example: Check HomePagePolls folder (for the Component) and where it is called in the cshtml file. It has different case
4. Todo
- Find any further lazy loading issues
- Add MySQL and PostgreSQL support
- Docker support (currently very experimental)
5. Known issues
- Tasks can throw an error sometimes
-- A second operation started on this context before a previous operation completed
-- Perhaps just limitation of SQLite and sql server will manage
- Pdf generation
-- GetFont doesn't work. Haven't investigated properly yet
- Docker throws an error during startup
-- Attempted to read or write protected memory. This is often an indication that other memory is corrupt
-- Breakpoint is on the constructor of AdminMapperConfiguration
- Some plugins don't compile yet, some do
Below is running under Ubuntu Bash for Windows