Embedding files in ResX file in Rider
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?
Please sign in to leave a comment.
Hello Alex,
Could you please provide a working repro?
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.
Got the same problem, is there any news on this?
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:
In Form1.cs file:
Result after running in Rider 2020.3 EAP 6:
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!
Alex,
Great! Thank you for verifying it
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?
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?
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.
Agreed. Anyway, thanks for raising the issue.
Have a nice day!
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?
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