This project has moved. For the latest updates, please go here.


Do not overwrite MongoServerSettings if present in app.config/web/config when updating via nuget


If the key

<add name="MongoServerSettings" connectionString="mongodb://localhost:27017/db" />

is already present, please do not overwrite the value and add the comment.

Each time I update MongoRepository, I had to go through each app and library in my solution and correct the connection string.
Closed Feb 12, 2015 at 5:02 PM by RobIII
Today we moved the MongoRepository project to GitHub so I would kindly like to request you open your issue there if you still want to comment / discuss or think the issue is not ready to be closed yet to keep everything in one place.

We're sorry for any inconvenience.


RobIII wrote Feb 11, 2014 at 10:25 AM

I would like to, sometime, make the update to the app.config/web.config conditional (for example: detect a connectionstring with "mongodb://" in the config; when it's not in there add the example, otherwise do nothing). But that will require some powershell scripting if I'm not mistaken (install.ps1 or something in the nuspec file). Currently I don't have any idea how to do that so I'll need to figure that out first and I am, currently, a bit short on time unfortunately. I can't promise this will be fixed "next week".

The reason why I'd like to do it this way is that new users tend to not read docs and forget to add a (or "the") connectionstring. Also the comment with the link for more information about connectionstrings is handy for new users.

mello702 wrote Jun 15, 2014 at 1:50 PM

+1 this breaks all my app.config and web.config files since they're setup like this:

<connectionStrings configSource="Configuration\Shared\connectionstrings.config"></connectionStrings>

and the default connection that gets added causes a runtime error loading the config file.

wrote Feb 12, 2015 at 5:02 PM