unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
9.03k stars 733 forks source link

Brand new project does not compile in Release #18827

Closed ArchieCoder closed 3 days ago

ArchieCoder commented 3 days ago

Current behavior

I have this error:

1>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(112,5): error NETSDK1152: Found multiple publish output files with the same relative path: D:\source\UnoAppRelease\UnoAppRelease\obj\Release\net8.0-windows10.0.26100\MsixContent\resources.pri, D:\source\UnoAppRelease\UnoAppRelease\bin\Release\net8.0-windows10.0.26100\resources.pri.

Expected behavior

No compilation error

How to reproduce it (as minimally and precisely as possible)

1- Create new project, select Skia (Desktop/Linux/Mac) and Windows only 2- Change target to Release 3- Compile

UnoAppRelease.zip

Workaround

No response

Works on UWP/WinUI

No

Environment

No response

NuGet package version(s)

"Uno.Sdk": "5.5.43"

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

jeromelaban commented 3 days ago

Thanks for the report, @ArchieCoder. I'm not able to reproduce this issue, can you provide a binlog?

ArchieCoder commented 3 days ago

It works now 🤔. I did nothing different. There are 3 weird errors below.

If the warnings are harmless, you can close the issue. Thanks.

UnoAppRelease_Release_AnyCPU_Build_2024-11-18T15_44_49.6685370-05_00.zip

1>CSC : warning CS8785: Generator 'ServerProcessorGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'InvalidOperationException' with message 'Sequence contains no elements'. 1>CSC : warning CS8785: Generator 'ServerProcessorGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'InvalidOperationException' with message 'Sequence contains no elements'. 1>CSC : warning CS8785: Generator 'ServerProcessorGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'InvalidOperationException' with message 'Sequence contains no elements'.

jeromelaban commented 3 days ago

Thanks! Those three errors will be fixed in a upcoming uno.sdk service release.

Would you have changed the target framework between tests? Or maybe built with a different version of VS? Sometimes the caches in obj get confused.

ArchieCoder commented 3 days ago

I actually just reproduced it with a new project again:

1- Create the project Skia + Windows 2- Compile Debug (success) 3- Compile Release

Here is the binlog

UnoApp6_Release_AnyCPU_Build_2024-11-18T16_00_45.6846092-05_00.zip

jeromelaban commented 3 days ago

I just tried your steps, but I still can't repro. I would not be surprised if it's some kind of design-time issue in winappsdk. Does it happen if you clear the obj and build again?

ArchieCoder commented 3 days ago

Deleting the obj/bin does the job. I even got the error when creating a blank solution + compile in debug.

I think I know the issue: I was not patient enough to let the solution loads completely before building. If I wait long enough, it works.