Skip to content

Unable to build the project from source #1744

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

Closed
deadlocklogic opened this issue Jul 11, 2023 · 6 comments
Closed

Unable to build the project from source #1744

deadlocklogic opened this issue Jul 11, 2023 · 6 comments

Comments

@deadlocklogic
Copy link
Contributor

Maybe not necessarily CppSharp related.
I am trying to run build/build.sh and I am getting lots of similar errors:

C:\Program Files\dotnet\sdk\7.0.302\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(135,5): error NETSDK1145: The Apphost pack is not installed and NuGet package restore is not supported. Upgrade Visual Studio, remove global.json if it specifies a certain SDK version, and uninstall the newer SDK. For more options visit   https://aka.ms/targeting-apphost-pack-missing  Pack Type:Apphost, Pack directory: C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Host.win-x64, targetframework: net6.0, Pack PackageId: Microsoft.NETCore.App.Host.win-x64, Pack Package Version: 6.0.16 [C:\Users\user\OneDrive\Documents\Development\CppSharp\build\vs2019\projects\Common.CLI.vcxproj]

Note: I have vs2019 and vs2022 installed on my machine.
Any clues?

@deadlocklogic
Copy link
Contributor Author

I had to uninstall dotnet 7.0.
After this I got an error which needs dotnet 6.0 and it is even installed on my machine. But apparently vs2019 doesn't support dotnet6.0.
I had to replace 6.0 by 5.0 in config.props and Helpers.lua.
So maybe somebody can fix this or make the build script generate a vs2022 solution.
Thanks.

@tritao
Copy link
Collaborator

tritao commented Jul 12, 2023

@josetr Any idea how we can improve this? Do we need to auto-detect or allow the user to select the .NET SDK version someway?

@tritao
Copy link
Collaborator

tritao commented Jul 12, 2023

@deadlocklogic Looks like I added this a few months ago: https://github.com/mono/CppSharp/pull/1718/files

Can you check it if helps at all?

@deadlocklogic
Copy link
Contributor Author

Ok I will try it out and see what I get.
BTW I got everything to build correctly after replacing 6.0 by 5.0 but I will try your PR maybe we can improve this for others.

@deadlocklogic
Copy link
Contributor Author

@tritao Unfortunately this PR still gives the same problem:
NETSDK1045: The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0.

@deadlocklogic
Copy link
Contributor Author

I got around this by simply opening the solution in vs2022.
@tritao I begun the custom scripting branch here.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants