4

I would like to set some of my files as Embedded Resources.

There are tutorials on the easy task like that, only for Visual Studio, but not for Rider.

Here is a question about Rider with no answer: https://www.reddit.com/r/Jetbrains/comments/dw93rf/rider_add_file_a_embedded_resource/

Arekadiusz
  • 419
  • 4
  • 11

1 Answers1

9

You've got to right-click on the file (or the selected files - with Ctrl+A or Ctrl + left-click)

enter image description here

And then press Properties (or shortcut: Alt+Enter) and set Editable/Build action to EmbeddedResource. enter image description here

Arekadiusz
  • 419
  • 4
  • 11
  • Thanks, but how can I access it afterwards ? Answers on this topic dealing with Visual Studio instead of rider tell to access it via `.Properties.Resources.` but the code analyzer outputs an error "Cannot resolve symbol 'Properties'" – adamency Dec 05 '22 at 16:14
  • @adamency In your project create a new class and add: `var rootType = typeof(MyClassWithEmbeddedFilesSomewhere); var resourceNames = rootType.Assembly.GetManifestResourceNames();` – Arekadiusz Dec 05 '22 at 22:08