Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

TestHost.Create() has incompatible overloads #497

Closed
@joaroyen

Description

@joaroyen

rc1 added a set of "Func<IServiceCollection, IServiceProvider> configureServices" overloads to TestHost.Create() that is not compatible with the existing "Action configureServices" overloads:

public static TestServer Create(Action<IApplicationBuilder> configureApp, Action<IServiceCollection> configureServices)
public static TestServer Create(Action<IApplicationBuilder> configureApp, Func<IServiceCollection, IServiceProvider> configureServices)

After upgrading to rc1 I get this error from the compiler:
Error CS0407 'void Startup.ConfigureServices(IServiceCollection)' has the wrong return type MediaStreams.Test.

I've currently implemented a workaround by changing signature from void to System.IServiceProvider and returning services.BuildServiceProvider() at the end of the method.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions