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

PRI workaround is needed to fix missing file errors #13483

Open
nickrandolph opened this issue Sep 1, 2023 · 3 comments
Open

PRI workaround is needed to fix missing file errors #13483

nickrandolph opened this issue Sep 1, 2023 · 3 comments
Labels
difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working

Comments

@nickrandolph
Copy link
Contributor

Current behavior

Developers run into errors where the build is complaining about missing files (often xbf files but can also apply to other content files). The fix is to add the following code to the class library.

	<!-- Workaround to avoid including Uno.Toolkit.UI XBFs in the PRI file -->
	<Target Name="AdjustGetPackagingOutput1" AfterTargets="GetMrtPackagingOutputs">
		<Message Importance="high" Text="Applying NuGet packaging workaround for dependent PRI files exclusion" />
		<ItemGroup>
			<_OtherPriFiles Include="@(PackagingOutputs)" Condition="'%(Extension)' == '.pri' and ('%(PackagingOutputs.ReferenceSourceTarget)' == 'ProjectReference' or '%(PackagingOutputs.NugetSourceType)'=='Package')" />
			<PackagingOutputs Remove="@(_OtherPriFiles)" />
		</ItemGroup>
	</Target>
	<Target Name="AdjustGetPackagingOutput2" BeforeTargets="AddPriPayloadFilesToCopyToOutputDirectoryItems">
		<Message Importance="high" Text="Applying NuGet packaging workaround for dependent PRI files exclusion" />
		<ItemGroup>
			<_OtherPriFiles1 Include="@(_ReferenceRelatedPaths)" Condition="'%(Extension)' == '.pri' and ('%(_ReferenceRelatedPaths.ReferenceSourceTarget)' == 'ProjectReference' or '%(_ReferenceRelatedPaths.NugetSourceType)'=='Package')" />
			<_ReferenceRelatedPaths Remove="@(_OtherPriFiles1)" />
			<_OtherPriFiles2 Include="@(ReferenceCopyLocalPaths)" Condition="'%(Extension)' == '.pri' and ('%(ReferenceCopyLocalPaths.ReferenceSourceTarget)' == 'ProjectReference' or '%(ReferenceCopyLocalPaths.NugetSourceType)'=='Package')" />
			<ReferenceCopyLocalPaths Remove="@(_OtherPriFiles2)" />
		</ItemGroup>
	</Target>

Expected behavior

No response

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

No response

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

Suggestion is to apply this workaround either as a .target in uno.winui, or as a separate nuget package

@nickrandolph nickrandolph added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Sep 1, 2023
@jeromelaban
Copy link
Member

I opened an issue in microsoft/microsoft-ui-xaml#8857

@nickrandolph
Copy link
Contributor Author

@jeromelaban in the meantime, did we want to include the workaround within Uno?

@jeromelaban
Copy link
Member

I don't think we should be including it, as it may cause double inclusion. I think the route is still to make a separate package.

@MartinZikmund MartinZikmund added difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants