Skip to content

Embedded resources in .NET: retarget to net10.0 and rename the library project - #2201

Merged
vladimir-pecanac-main merged 3 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/116937-dotnet-embedded-resources
Sep 18, 2026
Merged

vladimir-pecanac-main merged 3 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/116937-dotnet-embedded-resources

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Updates the sample for the "Embedded Resources in .NET" article.

  • All three projects retargeted from net8.0 to net10.0.
  • Test packages bumped: MSTest.TestAdapter and MSTest.TestFramework 3.1.1 to 4.4.0, Microsoft.NET.Test.Sdk 17.8.0 to 18.10.0, coverlet.collector 6.0.0 to 10.0.1.
  • MSTest 4 flags the swapped arguments in Assert.AreEqual(content, expectedText) as MSTEST0017; the arguments are now in expected/actual order.
  • Embedded_Resources_in_NET_Satellite renamed to Embedded_Resources_in_NET_Library. The project is an ordinary referenced class library: it has no culture-specific .resx, it does not build a .resources.dll, and it lands flat in the output folder rather than in a culture subfolder, so none of the three requirements for a satellite assembly holds.
  • New my-folder/note.txt resource plus a test asserting it embeds as Embedded_Resources_in_NET.my_folder.note.txt, which makes the folder-name mangling rule executable. The existing console-line count moves from 8 to 9 with it.
  • Three unused usings and one dead commented-out EmbeddedResource item removed.

Build and tests on SDK 10.0.302 / runtime 10.0.10: 0 warnings, 0 errors, 6 of 6 tests passing.

…roject, add the folder-mangling case

- All three projects move from net8.0 to net10.0.
- MSTest 3.1.1 -> 4.4.0, Microsoft.NET.Test.Sdk 17.8.0 -> 18.10.0, coverlet.collector 6.0.0 -> 10.0.1.
- Fix the swapped Assert.AreEqual arguments that MSTest 4 flags as MSTEST0017.
- Rename Embedded_Resources_in_NET_Satellite to Embedded_Resources_in_NET_Library: the project is an ordinary referenced class library, not a satellite assembly.
- Add my-folder/note.txt and a test asserting it embeds as Embedded_Resources_in_NET.my_folder.note.txt.
- Remove three unused usings and one dead commented-out EmbeddedResource item.
The project is a referenced class library, so SatelliteAssembly becomes
ReferencedAssembly and ListResourcesInOurSatelliteAssembly becomes
ListResourcesInReferencedAssembly, with the test name and the console
banner following them.
@vladimir-pecanac-main
vladimir-pecanac-main merged commit f015a50 into CodeMazeBlog:main Sep 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant