Save your AzureCosmosDb connection string to web.config
In Azure, I created an AzureCosmosDb account to use MongoDb.
I have a connection string that works fine but ends with /?ssl=true&replicaSet=globaldb
. So I cannot save it in the connectionStrings section of my web.config file. It says:
Entity 'replicaSet' not defined
Expecting ;
Application Configuration file "Web.config" is invalid. '=' is an unexpected token. The expected token is ';'.
I don't want to store it in a constant, so is there a way to make it work?
Thank.
+3
source to share
1 answer
web.config
file is an XML file, so any value must be valid XML.
You need to replace the sign &
with a sign &
:
/?ssl=true&replicaSet=globaldb
Here's a similar question .
+3
source to share