question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't build netcoreapp2.2 project with 5.0.0-rc3

See original GitHub issue

Feel free to check out my travis output.

dotnet “/home/travis/.nuget/packages/microsoft.extensions.apidescription.server/0.3.0-preview7.19365.7/build//…/tools/dotnet-getdocument.dll” --assembly “/home/travis/build/JustArchiNET/ArchiSteamFarm/ArchiSteamFarm/out/source/ArchiSteamFarm.dll” --file-list “obj/ArchiSteamFarm.OpenApiFiles.cache” --framework “.NETCoreApp,Version=v2.2” --output “obj” --project “ArchiSteamFarm” --assets-file “/home/travis/build/JustArchiNET/ArchiSteamFarm/ArchiSteamFarm/obj/project.assets.json” --platform “AnyCPU” No method ‘BuildWebHost’, ‘CreateHostBuilder’ or ‘CreateWebHostBuilder’ found in type ‘ArchiSteamFarm.Program’ with expected signatures.

I have a rather specific project in which I use kestrel and MVC with your library, but it’s not asp.net core project. Therefore I don’t have any generic host builders, but rather I create and start kestrel on as-needed basis.

I’m not sure what I’m supposed to do here. Of course everything worked fine with rc2, but I feel like this can be a blocker for me once 5.0.0 is released, and I don’t want to miss out on the opportunity of using your awesome library. I’m not sure what is the apidescription step here (the core program builds fine, this is post-compilation step) and whether it can be ignored/fixed on your side, or perhaps we need to forward to the upstream, I believe you know better in this regard and will make the right call. From my side, the error mentioned in this issue is the direct result of upgrading to rc3, so I’m reporting to you.

Thank you in advance for looking into my issue. Feel free to use the project referenced by me above for reproducing the problem.


Update

Hey, thank you all for your responses.

I can confirm that <OpenApiGenerateDocuments>false</OpenApiGenerateDocuments> has solved the issue for me with no visible drawbacks, thank you a lot for that workaround.

In regards to me, I consider this issue resolved and it can be closed, but I’ll keep it open in case @domaindrivendev would want it to stay to help people with similar issues. If by any chance you decide it’s no longer relevant/needed, feel free to close it anytime you wish.

Thanks again for your help.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:16
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

12reactions
martincostellocommented, Sep 22, 2019

The above looks like a bug in ASP.NET Core 3.0, which I’ve reported here: https://github.com/aspnet/AspNetCore/issues/14232

The macOS build failure can be fixed by setting the following MSBuild property:

<OpenApiGenerateDocuments>false</OpenApiGenerateDocuments>
6reactions
jadanahcommented, Sep 24, 2019

I can confirm I have a similar build issue from when I upgraded from rc2 to rc3. Any projects that targeted netcoreapp2.2 would get the following build error (net48 works fine):

System.NullReferenceException: Object reference not set to an instance of an object.	
 at Microsoft.Extensions.Hosting.HostFactoryResolver.GetServiceProvider(Object host)
 at Microsoft.Extensions.ApiDescription.Tool.Commands.GetDocumentCommandWorker.Process()	
Severity	Code	Description	Project	File	Line	Suppression State
Error	MSB3073	The command "dotnet "C:\Users\Joe\.nuget\packages\microsoft.extensions.apidescription.server\0.3.0-preview7.19365.7\build\/../tools/dotnet-getdocument.dll" --assembly "Z:\Repos\ukgd\src\Services\Courier\FedEx.API\bin\Debug\netcoreapp2.2\win-x64\FedEx.API.dll" --file-list "obj\FedEx.API.OpenApiFiles.cache" --framework ".NETCoreApp,Version=v2.2" --output "obj" --project "FedEx.API" --assets-file "Z:\Repos\ukgd\src\Services\Courier\FedEx.API\obj\project.assets.json" --platform "x64" --runtime "win-x64" " exited with code 7.	FedEx.API	C:\Users\Joe\.nuget\packages\microsoft.extensions.apidescription.server\0.3.0-preview7.19365.7\build\Microsoft.Extensions.ApiDescription.Server.targets	41	

I tried bumping both the net core sdk from 2.2.402 to 3.0.100 and microsoft.extensions.apidescription.server from 0.3.0-preview7.19365.7 to both 3.0.0-rc1.19457.4 and 3.0.0 but with no luck.

Only solution that worked was by setting the property as above:

<OpenApiGenerateDocuments>false</OpenApiGenerateDocuments>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't build netcoreapp2.2 project with 5.0.0-rc3
dotnet "/home/travis/.nuget/packages/microsoft.extensions.apidescription.server/0.3.0-preview7.19365.7/build//.
Read more >
NET Core 2.2 Can't be Selected In Visual Studio Build ...
I have same problem. I am trying fix this issue about one day. Finally I figuret out. My VS version is 15.9.11 and...
Read more >
Can't Compile .Net Core 2.2 Project
I have the latest 2.2 preview installed, since upgrading VS to 15.9.2, I can no longer build my project. I get this error:...
Read more >
Started to get "This project is targeting a version of .NET ...
1). In VS Installer > Individual components tab > check if components like .NET 5.0 Runtime or related components are checked. If it/they...
Read more >
Issues trying to build unreal engine from source (version ...
I just grabbed unreal engine 5.0.3 from github and ran setup.bat. During the setup process it pulled up a link to download some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found