taublast / DrawnUi.Maui

UI Rendering Engine for .NET MAUI powered by SkiaSharp
MIT License
206 stars 15 forks source link

Sandbox build failed: doesn't have a target for 'net8.0-windows10.0.19041.0'. #87

Closed ToolmakerSteve closed 1 month ago

ToolmakerSteve commented 1 month ago

Downloaded main branch (at 1.2.3.8 + 1 commit)

Two problems.

Error List:

Unable to read project information for 'Sandbox': The property PackageVersion was expected to have a single value across all target frameworks, but instead had the following values: 1.0, 1.2.3.8

9>C:\Program Files\dotnet\sdk\8.0.303\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1005: Assets file 'D:\github\DrawnUi.Maui\src\samples\Sandbox\obj\project.assets.json' doesn't have a target for 'net8.0-windows10.0.19041.0'. Ensure that restore has run and that you have included 'net8.0-windows10.0.19041.0' in the TargetFrameworks for your project. 9>Done building project "Sandbox.csproj" -- FAILED.

taublast commented 1 month ago

Hey that looks like just an IDE problem to me. Are you in VS? Try to open the terminal where the sandbox project resides and do a dotnet restore for windows or sudo dotnet restore for mac.. This usually helps to manually restore projects and solutions when IDE gets messed up with its obsolete obj's.

EDIT: forgot I already had a github action for main branch to restore/build, so normally this should indicate the problem is from IDE..

If you still fail to restore please let me know.

ToolmakerSteve commented 1 month ago

Thanks. I searched for where 1.2.3.8 might be coming from. Looks like it is Directory.Build.props higher up in src.

So Sandbox by itself would not have this issue.

I worked around it by adding PropertyGroup with PackageVersion 1.2.3.8 to Sandbox.csproj.
Good enough for my purposes - now I can build & run sandbox and the drawnui engine all together. To see how it all works.

If I start over again at some point, I'll try dotnet restore at the sandbox project folder, as you suggest.

taublast commented 1 month ago

This all sounds very weird, this shouldn't normally require any workaround just a clean 'dotnet restore [name of solution]' from the folder where .sln files reside. Try restore manually?