[CSHARP-510] Unhandled exception by creating an inex in a special way Created: 24/Jun/12 Updated: 14/May/14 Resolved: 28/Jun/12 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.4.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Michael Stupp | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | C# | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Win7 / 64 bit (Virtual Box) |
||
| Attachments: |
|
| Backwards Compatibility: | Minor Change |
| Description |
|
Creating an index in like so works fine: But creating an index like so (define the options before the CreateIndex throws an unhandled exception in many situations): |
| Comments |
| Comment by Robert Stam [ 28/Jun/12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@Michael, if you would like to try to reproduce this on your machine using the attached test program let me know what your results are. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Robert Stam [ 28/Jun/12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Attached test program that calls CreateIndex with and without using a temporary variable in an attempt to reproduce the issue reported. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Robert Stam [ 28/Jun/12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I am unable to reproduce this. Attached is a simple command line program that consists of only these lines:
The program creates two indexes on two different collections. The first time using an intermediate variable (which you state throws an unhandled exception) and the second time passing the options directly to the CreateIndex method without an intermediate variable. I used the mongo shell to verify that both indexes were created identically:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Robert Stam [ 25/Jun/12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The most immediately useful information is the error message and the full stack trace. If you do provide a Program.cs file what is helpful is a short command line program (10-20 lines) that reproduces the issue. Don't attach your entire program. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Robert Stam [ 25/Jun/12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It should make no difference whether you use an intermediate variable to hold the index options or not. In fact, the CreateIndex method can't even tell if you used an intermediate variable or not. Can you provide the message of the unhandled exception you got and a full stack trace? Even better, can you attach a Program.cs file to reproduce the issue? |