Skip to content

Commit

Permalink
[dotnet] Improve documentation about the PublishFolderType metadata a…
Browse files Browse the repository at this point in the history
… bit. (#21434)

Ref: #20947
  • Loading branch information
rolfbjarne authored Oct 17, 2024
1 parent d3a9de4 commit 92c9d2f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions dotnet/BundleContents.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ For this purpose, we support the `PublishFolderType` metadata on items in the
Below is a list of known/valid `PublishFolderType` values and the
corresponding action taken for each.

> [!IMPORTANT]
See [`PublishFolderType` doesn't work from a referenced library project](#transitiveProject) for using `PublishFolderType` in library projects.

In all cases the relative directory is preserved (i.e. we don't follow the
behavior in [dotnet/sdk#9643](https://github.com/dotnet/sdk/issues/9643).

Expand Down Expand Up @@ -276,6 +279,29 @@ The easiest way is to set `PublishFolderType` to `None`:
<EmbeddedResource Include="MyFile.bin" CopyToOutputDirectory="PreserveNewest" PublishFolderType="None" />
```

<a name="transitiveProject" />

### `PublishFolderType` doesn't work from a referenced library project.

The `PublishFolderType` metadata does not work in transitive / referenced
projects that aren't platform-specific. For example: if an executable project
references a `net9.0` library project, adding the `PublishFolderType` metadata
on items in the `net9.0` library project doesn't have any effect, and you'll get a warning like this:

> Xamarin.Shared.Sdk.targets(1836,3): Warning : The file '/myresource/file.psd' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle.
The workaround is to set
`MSBuildDisableGetCopyToPublishDirectoryItemsOptimization=true` in the
library project:

```xml
<PropertyGroup>
<MSBuildDisableGetCopyToPublishDirectoryItemsOptimization>true</MSBuildDisableGetCopyToPublishDirectoryItemsOptimization>
</PropertyGroup>
```

See https://github.com/xamarin/xamarin-macios/issues/20947 for more information.

## References

* [.NET: What to do about files in ResolvedFileToPublish](https://github.com/xamarin/xamarin-macios/issues/12572)
Expand Down

5 comments on commit 92c9d2f

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ API diff for current PR / commit

.NET (No breaking changes)

✅ API diff vs stable

.NET (No breaking changes)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 92c9d2fe3a9ff85138685377936ca17b620b4570 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 92c9d2fe3a9ff85138685377936ca17b620b4570 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 92c9d2fe3a9ff85138685377936ca17b620b4570 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 92c9d2fe3a9ff85138685377936ca17b620b4570 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

19 tests crashed, 0 tests failed, 0 tests passed.

Failures

❌ cecil tests

🔥 Failed catastrophically on VSTS: test results - cecil (no summary found).

Html Report (VSDrops) Download

❌ dotnettests tests (iOS)

🔥 Failed catastrophically on VSTS: test results - dotnettests_ios (no summary found).

Html Report (VSDrops) Download

❌ dotnettests tests (MacCatalyst)

🔥 Failed catastrophically on VSTS: test results - dotnettests_maccatalyst (no summary found).

Html Report (VSDrops) Download

❌ dotnettests tests (macOS)

🔥 Failed catastrophically on VSTS: test results - dotnettests_macos (no summary found).

Html Report (VSDrops) Download

❌ dotnettests tests (Multiple platforms)

🔥 Failed catastrophically on VSTS: test results - dotnettests_multiple (no summary found).

Html Report (VSDrops) Download

❌ dotnettests tests (tvOS)

🔥 Failed catastrophically on VSTS: test results - dotnettests_tvos (no summary found).

Html Report (VSDrops) Download

❌ framework tests

🔥 Failed catastrophically on VSTS: test results - framework (no summary found).

Html Report (VSDrops) Download

❌ fsharp tests

🔥 Failed catastrophically on VSTS: test results - fsharp (no summary found).

Html Report (VSDrops) Download

❌ generator tests

🔥 Failed catastrophically on VSTS: test results - generator (no summary found).

Html Report (VSDrops) Download

❌ interdependent-binding-projects tests

🔥 Failed catastrophically on VSTS: test results - interdependent-binding-projects (no summary found).

Html Report (VSDrops) Download

❌ introspection tests

🔥 Failed catastrophically on VSTS: test results - introspection (no summary found).

Html Report (VSDrops) Download

❌ linker tests

🔥 Failed catastrophically on VSTS: test results - linker (no summary found).

Html Report (VSDrops) Download

❌ monotouch tests (iOS)

🔥 Failed catastrophically on VSTS: test results - monotouch_ios (no summary found).

Html Report (VSDrops) Download

❌ monotouch tests (MacCatalyst)

🔥 Failed catastrophically on VSTS: test results - monotouch_maccatalyst (no summary found).

Html Report (VSDrops) Download

❌ monotouch tests (macOS)

🔥 Failed catastrophically on VSTS: test results - monotouch_macos (no summary found).

Html Report (VSDrops) Download

❌ monotouch tests (tvOS)

🔥 Failed catastrophically on VSTS: test results - monotouch_tvos (no summary found).

Html Report (VSDrops) Download

❌ msbuild tests

🔥 Failed catastrophically on VSTS: test results - msbuild (no summary found).

Html Report (VSDrops) Download

❌ xcframework tests

🔥 Failed catastrophically on VSTS: test results - xcframework (no summary found).

Html Report (VSDrops) Download

❌ xtro tests

🔥 Failed catastrophically on VSTS: test results - xtro (no summary found).

Html Report (VSDrops) Download

Successes

Pipeline on Agent
Hash: 92c9d2fe3a9ff85138685377936ca17b620b4570 [CI build]

Please sign in to comment.