NopCommerce and ASP.NET Core 3 Blazor

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 年 前
Nice job. Can you please write the steps or make a video on How did you do it? Thinking about it since Blazor announcement date!!

Thanks.


aybelanov wrote:
Hi everyone!

I experimented and have ported nopCommerce to blazor and what I have:

https://blazor.skywell.net/

If someone interest in how it works, please, ask. There are many interesting things.

PS
If someone give me English or Multilanguage DB, I will try set up it.
4 年 前
Hi, aurony

I need to clear the code from unnecessary notes and implement a demo db before publishing. Maybe I will publish without db implementation. But I am tired a little bit of the project  and I am lazy to do it right now. Your question is very wide. I changed target framework (for client-side in future), overrode the router, implemented native DI (memory leak of Autofac on preview stages), rewrote all necessary views to razor pages, rewrote all necessary controllers to the same razor pages, moved out all scripts to a js file, wrote some of extensions and utilities. I tried hard not to modify the native nopcommerce code like core, data, services and framework, only wrapping or overriding if it had needed.
4 年 前
The source code https://github.com/aybelanov/spaCommerce
3 年 前
HI,
I was wondering if there is a chance we can just use Blazor in addition to the standard pages and services in NOP 4.3 since it is using .NET Core 3.1.

If not, what steps would we have to do to add it? I seem to have gotten as far as being able to load a .razor component, but it doesn't communicate with the server from the page. It is acting as a static form. I seem to be missing something.

THANKS!!!
J
3 年 前
Hi,
In common, yes, we can. Unfortunately your question is quite wide one to give you a more exact answer. I think you should have learnt asp.net core, Nop and Blazor a little bit deeply. Blazor is being based on asp.net core so you can combine and mix the 'standard' asp.net core mvc pages and the blazor pages in one app. In respect to your second piece of the topic, I don't know how I can help you because I haven't seen your code.
3 年 前
HI,

I am new to NOP and somewhat to .NET CORE. I am trying to use Blazor components in my NOP 4.3 project. I have followed the steps in many tutorials to add Blazor to an existing project. Such as:
> https://jonhilton.net/use-blazor-in-existing-app/
> https://medium.com/@waelkdouh/integrating-blazor-components-into-existing-asp-net-core-mvc-applications-b1a2aec4ac1f

I have been quite successful in other smaller projects, but I haven't gotten it to work completely in my NOP 4.3 solution. Everything I have will load and run though, but it doesn't communicate with server once it is rendered.

I need help identifying where to add the parts correctly to make Blazor work. I am not getting any errors, and I am sure others would benefit from knowing this as well. I have gone through the NOP documentation and I didn't find it there.

My question is: Is there documentation on adding Blazor to NOP 4.3 and if so, would you please share that? If there is no documentation, would anyone be willing to share an updated version of the tutorials I have linked to on how to add Blazor to a NOP Commerce 4.3 solution?

Thank you,
J
3 年 前
I have finally found a solution after struggling for a whole day.
The solution is to follow the instructions from the blog posts above but instead of registering Blazor  the normal way, add this class in Nop.Web.Framework.Infrastructure

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Nop.Core.Infrastructure;

namespace Nop.Web.Framework.Infrastructure
{
    public class BlazorStartup : INopStartup
    {
        public int Order => 999;//It has to be registered before NopMVCStartup

        public void Configure(IApplicationBuilder application)
        {
            application.UseRouting();

            application.UseEndpoints(endpoints =>
            {
                endpoints.MapBlazorHub();
                endpoints.MapFallbackToController("Blazor", "Home");
            });
        }

        public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
        {
            services.AddServerSideBlazor();
        }
    }
}
2 年 前
a.m. wrote:
Please let me quote the following statement from the official asp.net website (origin):

"Blazor is an unsupported, experimental web framework that shouldn't be used for production workloads at this time"

If it's official supported and recommended by asp.net team for web development, then we can discuss it. But not right now

Blazor has officially realesed several month ago https://devblogs.microsoft.com/dotnet/blazor-webassembly-3-2-0-now-available/

Any news from which version we will get this with defaufat nopCommerce ?
2 年 前
rk.menon wrote:
Any news from which version we will get this with defaufat nopCommerce ?

We haven't decided yet whether Blazor will be used in nopCommerce
1 年 前
Hello.

Have anyone else been able to make blazor work in nopCommerce?

I have issues which i have explained here: https://www.nopcommerce.com/en/boards/topic/94752/blazor-in-admin-plugin#297715
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.