Skip to content

ValidationSource can not work at ASP.NET Core IOC #110

Closed Answered by 1257960069
1257960069 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks. I got the answer.
I found the reasion is that the code'location
services.AddServiceStack(typeof(MyServices).Assembly);

public class AppHost : AppHostBase, IHostingStartup
{
    public void Configure(IWebHostBuilder builder) => builder
        .ConfigureServices(services => {
            // I need move this line to Program.cs
            services.AddServiceStack(typeof(MyServices).Assembly);
        });

    public AppHost() : base("IssueValidationSource", typeof(MyServices).Assembly) {}

    public override void Configure(Container container)
    {
        SetConfig(new HostConfig {
                UseSameSiteCookies = false,
        });
    }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@1257960069
Comment options

Answer selected by mythz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants