Embedded resources in .NET: retarget to net10.0 and rename the library project - #2201
Merged
vladimir-pecanac-main merged 3 commits intoSep 18, 2026
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the sample for the "Embedded Resources in .NET" article.
Assert.AreEqual(content, expectedText)as MSTEST0017; the arguments are now in expected/actual order.Embedded_Resources_in_NET_Satelliterenamed toEmbedded_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.my-folder/note.txtresource plus a test asserting it embeds asEmbedded_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.EmbeddedResourceitem removed.Build and tests on SDK 10.0.302 / runtime 10.0.10: 0 warnings, 0 errors, 6 of 6 tests passing.