<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:35:57 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CSHARP-152] MongoConnectionStringBuilder fails at constructor using a connection string</title>
                <link>https://jira.mongodb.org/browse/CSHARP-152</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I&apos;m trying to get a server instance by using the MongoConnectionStringBuilder to read the connection string from the application configuration file. It fails stating that the connection string is in wrong format, even for the simplest of connection strings. Example:&lt;/p&gt;

&lt;p&gt;&amp;lt;add name=&quot;MongoDB&quot; connectionString=&quot;mongodb://localhost&quot; /&amp;gt;&lt;/p&gt;

&lt;p&gt;string connectionString = ConfigurationManager.ConnectionStrings&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;MongoDB&amp;quot;&amp;#93;&lt;/span&gt;.ConnectionString;&lt;br/&gt;
var builder = new MongoConnectionStringBuilder(connectionString);&lt;/p&gt;

&lt;p&gt;The second line will fail with the message of &quot;System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.&quot;&lt;/p&gt;

&lt;p&gt;StackTrace:&lt;br/&gt;
at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, ref String keyname, ref String keyvalue)&lt;br/&gt;
at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)&lt;br/&gt;
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)&lt;br/&gt;
at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value)&lt;br/&gt;
at MongoDB.CSharpDriver.MongoConnectionStringBuilder..ctor(String connectionString)&lt;/p&gt;</description>
                <environment></environment>
        <key id="14261">CSHARP-152</key>
            <summary>MongoConnectionStringBuilder fails at constructor using a connection string</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="darkstar">Pawel Krakowiak</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Jan 2011 07:58:25 +0000</created>
                <updated>Thu, 2 Apr 2015 18:28:32 +0000</updated>
                            <resolved>Thu, 20 Jan 2011 18:58:09 +0000</resolved>
                                                    <fixVersion>0.9</fixVersion>
                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="22532" author="rstam" created="Thu, 20 Jan 2011 18:58:09 +0000"  >&lt;p&gt;You have to decide whether to use the standard MongoDB URL connection string syntax as used by all the drivers, or the .NET format connection string syntax used only by the C# driver. When using the URL syntax use MongoUrlBuilder instead of MongoConnectionStringBuilder.&lt;/p&gt;

&lt;p&gt;so instead of:&lt;/p&gt;

&lt;p&gt;var builder = new MongoConnectionStringBuilder(connectionString);&lt;/p&gt;

&lt;p&gt;use:&lt;/p&gt;

&lt;p&gt;var builder = new MongoUrlBuilder(connectionString);&lt;/p&gt;

&lt;p&gt;You can also pass the connection string directly to MongoServer.Create:&lt;/p&gt;

&lt;p&gt;var server = MongoServer.Create(connectionString);&lt;/p&gt;

&lt;p&gt;which looks for the &quot;mongodb://&quot; prefix to decide which format connection string you are using.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrh9dz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14320</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>