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