-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesquestion
Description
Describe the bug
When attempting to write tests using the WebApplicationFactory from the Testing project, attempting to create a client against the factory, it blows up because it seems like it is assumed this is being run from a .NET Core assembly.
System.InvalidOperationException : The provided Type 'FilterParamsTestStartup' does not belong to an assembly with an entry point. A common cause for this error is providing a Type from a class library.
at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.EnsureDepsFile()
at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.EnsureServer()
at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateDefaultClient(DelegatingHandler[] handlers)
at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateClient(WebApplicationFactoryClientOptions options)
To Reproduce
Steps to reproduce the behavior:
- Create a net472 test assembly
- create an test that creates a WebapplicationFactory
- attempt to call CreateClient for the factory.
Expected behavior
The client is created and tests can be executed from a .net framework assembly.
Metadata
Metadata
Assignees
Labels
area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesquestion