Domanda

I have the following appSettings section

<appSettings>
  <add key="Foo" value="http://foo.bar.com/?app=xxx&FormName=yyy" />
</appSettings>

But the IDE is giving me two errors:

  1. Error 25 Entity 'FormName' not defined.
  2. Error 26 Expecting ';'.

It seems the & is causing a problem. I'd like to not have to splt the values up into seperate keys. Is there an elegant way around this issue?

È stato utile?

Soluzione

You just need to use XML encoding here I believe - so & becomes &amp;

Altri suggerimenti

Try &amp;

<appSettings>
  <add key="Foo" value="http://foo.bar.com/?app=xxx&amp;FormName=yyy" />
</appSettings>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top