Targetting .net core 2 (aka .net core 2 running on .net core 2)

1 2 >
Posted: October 05, 2017 at 11:33 AM Quote #194225
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



This post/answer is useful
7
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: October 05, 2017 at 12:14 PM Quote #194228
Hi Chris,

Thanks a lot for so detailed post. We've also played with it. Briefly saying the limited functionality of Entity Framework Core is the main reason why we have to stay with .NET Framework now. The work item is here

Chris25 wrote:
I am willing to do a pull request on GitHub

Please do it! It'll definitely be very helpful for us!!!
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Interested in the dedicated Premium support services provided by core developers? Please visit http://www.nopcommerce.com/supportservices.aspx

Regards,
Andrei Mazulnitsyn
Posted: October 06, 2017 at 5:00 AM Quote #194258
Sure. Will do a pull request sometime this weekend. Currently everything is unsaved modifications in the working tree so needs some work to put in its own branch
This post/answer is useful
2
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: October 11, 2017 at 5:19 PM Quote #194548
Pull Request 2636 is now created.

The branch I'm working on is at https://github.com/ChrisJollyAU/nopCommerce/tree/target-net-core-2 and I do try and merge the upstream changes every couple of days

Since the last post I have added the MySQL and PostgreSQL providers although have not tested them yet
This post/answer is useful
3
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: December 22, 2017 at 5:17 AM Quote #198203
Thanks Chris, I tested the mysql connector, There is currently an issue with Oracle's MySQL connector and .NET Core 2.0. You may receive an error stating: System.TypeLoadException occurred HResult=0x80131522 Message=Method 'Clone' in type.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: January 12, 2018 at 2:33 PM Quote #199144
Hi

At the time Oracle only had a pre-release version around. They have subsequently released a version that is compatible with .Net Core 2 and .Net Standard 2 however it still has some issues. Namely it has no idea how to deal with GUID c# types and mapping to the database column type.

The third party Pomelo provider works fine so have switched to that. I have currently tested the install and basic product browsing and it is currently working.

The installer currently only configures it to NOT use SSL although if you modify the connection string in datasettings.json it will probably work
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: March 05, 2018 at 10:11 AM Quote #201496
Updated the branch to use .net core 2.1 preview1

Have enabled the following new features

- Sockets
- Hsts/https redirection
- Lazy loading

The MySQL provider won't work as there is no updated version available for .net core 2.1 preview1
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: June 03, 2018 at 6:18 AM Quote #205200
Hi a.m.

Was busy updating the branch I have on the pull request to the stable .net core 2.1 and noticed that you have already implemented some of the changes independently (and more to come I assume).

Is it worth it me keeping the branch updated?

Also while I'm at it are you looking at adding support for SQLite database? In that case you would need to add the code for sql ce back in. More specifically the code related to supporting database that do not have support for stored procedures

Even though you haven't merged the pull request, I hope it managaged to help some
This post/answer is useful
3
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: June 03, 2018 at 11:26 AM Quote #205206
Hi Chris,

Thanks a lot for your contribution. Right, we've finished the migration. There's no need to support the brach but please do not delete it now. It could be helpful in the future.

We plan to add new databases support in 4.20 (not in 4.10)
This post/answer is useful
3
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Interested in the dedicated Premium support services provided by core developers? Please visit http://www.nopcommerce.com/supportservices.aspx

Regards,
Andrei Mazulnitsyn
Posted: August 25, 2018 at 1:05 PM Quote #211051
Hi a.m.

When do you planning to release version 4.20 and would this version run in linux os?

Thanks.
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
1 2 >
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.