Can I store an xml string in a resources file (.resx), without it getting encoded with < and >?

StackOverflow https://stackoverflow.com/questions/19190082

  •  30-06-2022
  •  | 
  •  

質問

In Visual Studio, I can put an xml string into the "Value" field. However, when I open up the actual .resx file, I see that it has been encoded to have < and >. I want the .resx file to be able to be edited manually without using the Visual Studio UI, and obviously this is messy with the > and <s. Could I somehow do this without the encoding?

役に立ちましたか?

解決

My solution for the time being: use JSON for the value.

他のヒント

I'm not sure if this is what you're looking for, but I usually wrap values in my resx files in CDATA if I don't want to deal with < and >. Of course this is a mess too if you have CDATA in your xml string. Also as soon as you edit with the Visual Studio UI again, it will revert back to < >

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top