Skip to content

Conversation

@eerhardt
Copy link
Member

I noticed that in my Maui application System.CodeDom was being referenced. This is because we don't have a PrivateAssets="all" on the PackageReference in Microsoft.Maui.Controls.Build.Tasks.csproj.

This causes a problem when submitting an app to the Apple App Store, because CodeDom is preventing some unnecessary System.Diagnostics.Process code from being trimmed.

Adding the PrivateAssets="all", and removing unnecessary Conditions since this project only builds for netstandard2.0.

Fix #3290
Fix dotnet/runtime#61265

Reimplementing the fix from #888

cc @Redth @PureWeen

I noticed that in my Maui application System.CodeDom was being referenced. This is because we don't have a `PrivateAssets="all"` on the PackageReference in Microsoft.Maui.Controls.Build.Tasks.csproj.

This causes a problem when submitting an app to the Apple App Store, because CodeDom is preventing some unnecessary System.Diagnostics.Process code from being trimmed.

Adding the PrivateAssets="all", and removing unnecessary Conditions since this project only builds for netstandard2.0.

Fix dotnet#3290
Fix dotnet/runtime#61265
@danmoseley
Copy link
Member

Is it feasible to protect this with a test somehow -- since it already regressed?

@eerhardt
Copy link
Member Author

No good ideas come to mind. Do we have some tests that verify nuget packages?

A crazy idea would be to build an app and ensure System.CodeDom isn't referenced by default.

mattleibow
mattleibow previously approved these changes Nov 10, 2021
@mattleibow
Copy link
Member

I see Microsoft.Maui.Graphics also has no private assets... Can you update that as well?

Maybe we can add a step after that:

<PackageReference Include="@(PackageReference)" PrivateAssets="all" />

Not sure if that works because packages are special.

@eerhardt
Copy link
Member Author

I see Microsoft.Maui.Graphics also has no private assets... Can you update that as well?

Yes, I just noticed that too. Let me see if I can fix it for good.

@eerhardt
Copy link
Member Author

OK, I got something to work where locally dotnet pack produces a .nupkg with no dependencies. Comparing it to the released, it has all the same files as before.

I also went ahead and changed Controls.Build.Tasks.csproj with this fix as well. (I'm not sure why there are 2...)

PTAL

@mattleibow
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@mattleibow mattleibow merged commit 95f24f0 into dotnet:main Nov 11, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
@samhouts samhouts added the fixed-in-6.0.101-preview.11.3 Look for this fix in 6.0.101-preview.11.3! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

fixed-in-6.0.101-preview.11.3 Look for this fix in 6.0.101-preview.11.3!

Projects

None yet

4 participants