-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assembly "foo.dll" does not contain an entrypoint #14370
Comments
I confirm this error occurs whenever you add Swashbuckle.AspnetCore to a class project. |
I had the same problem also. A quick fix for the build is to not generate the openApi documents. Add this to your project's propertyGroup (in the .csproj):
|
cc: @bradygaster |
what @Dontrym3 said - Swashbuckle in Class Library projects isn't a scenario with which we're quite familiar or that we support. The only scenario with which we have elaborate expertise is using Swashbuckle in a Web or Minimal API project. The package does offer quite a bit of customization, and has some good docs, so I'd encourage folks look there. |
Sounds like this should be closed then? |
Had the same issue:
And failed in "...\packages\microsoft.extensions.apidescription.server\3.0.0\build\Microsoft.Extensions.ApiDescription.Server.targets" Having a class library seems a common use-case in a modular application. Did you expect all related stuff is just put in a single project? I disabled build time generation by "OpenApiGenerateDocumentsOnBuild=false" I've found in the targets, but have not found any documentation about this parameter and what it exactly does. Also comparing to OpenApiGenerateDocuments=false. Can someone give a link? |
Closing this issue since as @bradygaster said this isn't a scenario we support. |
Describe the bug
After upgrading to dotnet core 3 I get a build error
GenerateOpenApiDocuments: dotnet "C:\Users\joakim.lindqvist\.nuget\packages\microsoft.extensions.apidescription.server\0.3.0-preview7.19365.7\build\/../tools/dotnet-getdocument.dll" --assembly "foo.dll" --file-list "obj\foo.OpenApiFiles.cache" --framework ".NETCoreApp,Version=v3.0" --output "obj" --project "Foo" --assets-file "...\obj\project.assets.json" --platform "AnyCPU" 2>Assembly 'foo.dll' does not contain an entry point.
This assembly is a class library and as such can not define an entrypoint (and a error is produced if I try to ad it), but it contains code shared between multiple aspnet web api projects (all of whom generate swagger documentation).
While this GenerateOpenApiDocuments step fails, my assembly generates just fine so if I do another build the up to date check determine there is no work to do and my build succeeds.
I did not see this issue using dotnet core 3 preview 7.
To Reproduce
Steps to reproduce the behavior:
Using Aspnet Core 3
Add a class library that uses swagger (I use Swashbuckle.AspnetCore and Swashbuckle.Aspnet.Core.ReDoc). This class library should be set to use Web SDK:
Project Sdk="Microsoft.NET.Sdk.Web">
Build this class library
Expected behavior
No build errors.
The text was updated successfully, but these errors were encountered: