chromelyapps / Chromely

Build Cross Platform HTML Desktop Apps on .NET using native GUI, HTML5, JavaScript, CSS, Owin, AspNetCore (MVC, RazorPages, Blazor)
MIT License
2.98k stars 279 forks source link

RequestAction do not work and RegisterRequest works well #252

Closed xjfnet closed 4 years ago

xjfnet commented 4 years ago

chromely.cefsharp.5.1.83-pre02 RequestAction do not work and RegisterRequest works well

mattkol commented 4 years ago

@xjfnet I think you need to provide more info.

CefSharpDemo.zip

namespace CefSharpDemo
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {

            AppBuilder
            .Create()
            .UseApp<DemoApp>()
            .Build()
            .Run(args);
        }
    }

    public class DemoApp : ChromelyBasicApp
    {
        public override void ConfigureServices(ServiceCollection services)
        {
            base.ConfigureServices(services);
            RegisterControllerAssembly(services, typeof(DemoApp).Assembly);
        }
    }

    [ControllerProperty(Name = "DemoController")]
    public class DemoController : ChromelyController
    {
        [RequestAction(RouteKey = "/democontroller/hello")]
        public IChromelyResponse Hello(IChromelyRequest request)
        {
            return new ChromelyResponse(request.Id)
            {
                Data = "Hello Chromely"
            };
        }
    }
}

image

xjfnet commented 4 years ago

change ChromelyBasicApp to ChromelyFramelessApp and try again!

mattkol commented 4 years ago

Changing to ChromelyFramelessApp works.

CefSharpDemo_with_ChromelyFrameLassApp.zip

xjfnet commented 4 years ago

maybe it's my mistake it works now, and i don't know what happend i use JetBrains Rider to build my program, anyway it works thanks.