Embedding files in ResX file in Rider

Answered

I have several test files embedded as resource. I creates a project in MSVS and it looks like:

 

<data name="RequestStatusUpdateMessage" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\RequestStatusUpdateMessage.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="RequestMessageIE" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\RequestMessageIE.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="RequestMessageLE" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\RequestMessageLE.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>

When I run it in VS I get file content as string, but when I run it in rider, I get "Resources\RequestMessageLE.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8" which is obviosly not what I need.

 

How could it be fixed?

3
12 comments

Hello Alex,

Could you please provide a working repro?

0
Avatar
Permanently deleted user

I have the same experience. In Visual Studio simply add a new resource file, and embed a File into that resource file. Rider does not appear to support resource files, forcing me to go back to Visual Studio.

0

Got the same problem, is there any news on this?

0

Folks,

Unfortunately, we didn't manage to reproduce the issue. We'd be really grateful if someone could create a repro project and attach in to a new YouTrack issue or Support Request.

For example, with these steps everything works fine:

1. Create new non-Core WinForms project

2. Add a resource file to it

3. Embed a txt file to it with some random content, e.g. "My text"

4. Create a Text Box on Form1 and set its text to the content of your text file

In resource file:

<data name="TextFile1" type="System.Resources.ResXFileRef, System.Windows.Forms">
  <value>Resources\TextFile1.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1250</value>
</data>

In Form1.cs file:

this.textBox1.Text = Resource1.TextFile1;

Result after running in Rider 2020.3 EAP 6:

 

0
Avatar
Permanently deleted user

Just tried to reproduce the issue with exact project that caused the original error: problem solved, I can see proper results. Version 2020.2.4

I think it was solved somewhere midway. Thanks for work!

0

Alex,

Great! Thank you for verifying it

0
Avatar
Permanently deleted user

Hmmm, now when you replied I recalled that I had this issue on Mac. Did you test it on Windows? If so then could you be so kind to re-examine it on Mac or maybe Linux?

 

0

Hi Alex,

We've just tried the same scenario on Mac, and it works fine. Did you test your project on VS for Mac? Perhaps the issue is Mac-specific, and has nothing to do with Rider?

0
Avatar
Permanently deleted user

Hmm. Thanks for reply.

I think it may be closed until anyone can provide a link with repository that allows to reproduce the issue. Although I doubt it will happen: feature works just fine.

It could be bug in early netcore SDKs, which is also unrelated to Rider.

0

Agreed. Anyway, thanks for raising the issue.

Have a nice day!

0

Hello, but to insert a file inside the resources it is not possible to do it simply as in visual studio, that is with the drag and drop and manage everything from the graphics window?

0

Daqfra1,

Yep, managing files in the Localization manager is not supported yet. I've created a feature request, please feel free to upvote: https://youtrack.jetbrains.com/issue/RIDER-63393

0

Please sign in to leave a comment.