Skip to content
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

"library.dll does not contain an entry point" error when using "TargetFrameworks" vs "TargetFramework" #1511

Closed
ghost opened this issue Jan 30, 2020 · 13 comments
Labels
responded Responded with solution or request for more info
Milestone

Comments

@ghost
Copy link

ghost commented Jan 30, 2020

Creating a dll using .net core 3.1
Reference: Swashbuckle.AspNetCore Version=5.0.0

Build -> compiles succesfully

Change: <TargetFramework>netcoreapp3.1</TargetFramework>
To: <TargetFrameworks>netcoreapp3.1;</TargetFrameworks>
Or What i'm using: <TargetFrameworks>netcoreapp3.1;netstandard2.0;net461;</TargetFrameworks>

Compile -> failure, two errors:
"library.dll does not contain an entry point"
"The command "dotnet "blah\microsoft.extensions.apidescription.server\3.0.0\build/../tools/dotnet-getdocument.dll" --assembly "library.dll" --file-list "obj\library.OpenApiFiles.cache" --framework ".NETCoreApp,Version=v3.1" --output "obj" --project "library" --assets-file "library\obj\project.assets.json" --platform "AnyCPU" " exited with code 3."

I found that that comand does not run when using just TargetFramework.

There is a workaround: underneath add false

But this doesn't seem like the expected requirement

@gloriali2011
Copy link

Hi there, I have the same issue, did you find out the root cause and ways to fix the error? Thank you!

@SonicGD
Copy link

SonicGD commented Sep 22, 2020

I have same problem when cross-target library to 3.1 and 5.0

<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>

Adding

<OpenApiGenerateDocumentsOnBuild>false</OpenApiGenerateDocumentsOnBuild>

helps.

@domaindrivendev
Copy link
Owner

@andrewmcclellankibo are you still experiencing this problem with the latest version of SB (5.6.3 at time of writing)? If so, please create a minimal app (i.e. starting from empty project) that repro's the issue and post to github so I can pull it down and troubleshoot. Thx

@domaindrivendev domaindrivendev added the responded Responded with solution or request for more info label Jan 18, 2021
@liuyongtao
Copy link

I have the same problem

@aliabusaleh
Copy link

aliabusaleh commented Jan 25, 2021

I faced the same problem when I was targeting net461, check this #1967 it might help.

@domaindrivendev
Copy link
Owner

SB doesn't currently support apps that target net461 but not sure if that's the OP's issue. If this is happening for other targets then I need someone to create a minimal app that repro's it and post to github where I can pull down and troubleshoot. I'm going to close the issue until someone provides that.

@jonathh21
Copy link

I've got this - targeting core 3.1 and .net 5

@ravimittal84
Copy link

ravimittal84 commented Sep 7, 2021

Add this to your csproj

<OpenApiGenerateDocuments>false</OpenApiGenerateDocuments>

Update: Apparently it disables the swagger documentation, so it may not help.

@jonclare
Copy link

I came across the same issue when attempting to multi-target .NET 5.0 and 6.0
@domaindrivendev, I've created a minimal solution that reproduces the issue here: https://github.com/jonclare/SwashbuckleBuildErrors

Can you re-open this issue?

@wsaeed
Copy link

wsaeed commented Apr 14, 2022

I came across the same issue when attempting to multi-target .NET 5.0 and 6.0 @domaindrivendev, I've created a minimal solution that reproduces the issue here: https://github.com/jonclare/SwashbuckleBuildErrors

Can you re-open this issue?

I'm also experiencing the same issue when multi-targeting .net 5 and .net 6.

@Meandron
Copy link

I have the same issue

@GitBasse
Copy link

GitBasse commented Jul 8, 2022

I'm also getting this error with Framework Version 4.8

@ben-page
Copy link

@domaindrivendev Hi, here's an example of the problem using .NET Core 6 & 7. The build works with TargetFramework, but not TargetFrameworks. Can you reopen this issue?

https://github.com/ben-page/SwashbuckleMultiTargetError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
responded Responded with solution or request for more info
Projects
None yet
Development

No branches or pull requests