xamarin-macios/dotnet
Chris Hamons ab5c0c6b56
[net6] Fix ILStrip'ed apps to actually work again (#13098)
* [net6] Fix ILStrip'ed apps to actually work again

- In a late minute change to the ILStrip PR (https://github.com/xamarin/xamarin-macios/pull/12563) a change to support XVS support broke execution of Apps that were stripped
- Applications were broken because none of the stripped assemblies were actually copied into the bundle
- However, the tests still passed, because all assemblies that were there had no IL (zero assemblies total)

Now why did this happen?
- The stripped assemblies were changed to return via an msbuild Output Element
- Output Element can return an Property or ItemGroup, depending if you use the PropertyName or ItemName attributes
- Unfortunately I used PropertyName, when I expected an ItemGroup. So I silently had a property created instead.
- Thus zero items were added to the list of files to copy into the bundle
- Which was undetected as the test did not confirm files were copied in, and manual tests were not run so late into the PR (3 weeks after PR was opened)

How was it fixed?
- Correctly using ItemName on Output created a valid item group to reference
- However, that still failed with an absurdly confusing error:

 PATH/Microsoft.NET.Publish.targets(277,5): error MSB3024: Could not copy the file FILE to the destination file PATH, because the destination is a folder instead of a file. To copy the source file into a folder, consider using the DestinationFolder parameter instead of DestinationFiles.

- After a splunking through netcore targets, I found the metadata on these assemblies references really matters. Without it, they are not processed correctly at all.
- Thus, I updated ILStripBase to clone the existing metadata when changing the original assembly reference to the stripped path
- Finally, I corrected the test to assert that required files are copied in. I also manually ran our device test.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-10-25 11:31:42 -05:00
..
Microsoft.MacCatalyst.Sdk [dotnet] Update logic for default global namespaces and fix the templates. Fixes #12457. (#12471) 2021-08-19 07:47:03 +02:00
Microsoft.iOS.Sdk [dotnet] Update logic for default global namespaces and fix the templates. Fixes #12457. (#12471) 2021-08-19 07:47:03 +02:00
Microsoft.iOS.Windows.Sdk Import .NET 6 property page targets path in iOS sdk targets (#12556) 2021-08-27 12:17:06 +02:00
Microsoft.macOS.Sdk [dotnet] Update logic for default global namespaces and fix the templates. Fixes #12457. (#12471) 2021-08-19 07:47:03 +02:00
Microsoft.tvOS.Sdk [dotnet] Update logic for default global namespaces and fix the templates. Fixes #12457. (#12471) 2021-08-19 07:47:03 +02:00
Templates [dotnet/Templates] Add preview language (#12965) 2021-10-11 08:00:01 +02:00
Workloads [CI] Update SignList.xml to fix publishing 2021-10-20 21:46:13 -04:00
package [dotnet] Remove watchOS code and from our .NET support. (#12764) 2021-09-20 07:40:03 +02:00
targets [net6] Fix ILStrip'ed apps to actually work again (#13098) 2021-10-25 11:31:42 -05:00
.gitignore [dotnet] use **FromWorkload** for targeting/runtime pack versions (#12449) 2021-08-19 09:03:11 +02:00
DefaultCompilationIncludes.md [dotnet] Remove watchOS code and from our .NET support. (#12764) 2021-09-20 07:40:03 +02:00
HIERARCHY.md [dotnet] Add support for 'dotnet publish'. Fixes #11807. (#12397) 2021-08-11 10:01:16 +02:00
Makefile Generate msi files and VS setup authoring for all .NET 6 platforms (#12581) 2021-09-01 13:55:08 -04:00
PackageInfo.plist Fix typos in comments. 2020-10-19 10:38:11 +02:00
SingleProject.md [dotnet] rename $(AppleShortVersion) to $(ApplicationDisplayVersion) (#12647) 2021-09-08 10:13:29 -04:00
VERSIONS.md Rename master to main. (#8851) 2020-06-16 15:51:44 +02:00
build-custom-runtime.sh [configure] Add option to use a locally built dotnet/runtime. (#11643) 2021-05-21 22:18:25 +02:00
generate-target-platforms.csharp Bump to .NET 5.0.100-rc.2.20459.1 (#9758) 2020-10-02 08:31:38 +02:00
generate-wix.csharp [dotnet] Package the workloads in a Windows installer (.msi) as well. (#9979) 2020-10-28 11:09:55 +01:00