[CSHARP-348] Test the driver in a Medium Trust environment Created: 29/Oct/11 Updated: 02/Apr/15 Resolved: 15/Jun/12 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.3 |
| Fix Version/s: | 1.5 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Robert Stam | Assignee: | Craig Wilson |
| Resolution: | Done | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Test the driver in a Medium Trust environment. At the very least the type initializer for ObjectId apparently fails under Medium Trust. There may be other issues as well. Note: we may end up determining that we won't support the driver in a Medium Trust environment. A final determination will be made when more information is available. |
| Comments |
| Comment by Craig Wilson [ 15/Jun/12 ] |
|
These changes will be available in the next release, version 1.5. Notes: |
| Comment by Craig Wilson [ 13/Jun/12 ] |
|
There are 2 issues that prevent the driver from working in ASP.NET Medium trust and Azure Partial Trust. 2) Communication with MongoDB occurs over a TCP socket which, in our case, appears to require unrestricted permissions. You can create a custom trust config to enable this by appling the following to a copy of web_mediumtrust.config.
In addition, the driver will need to include the [AllowPartiallyTrustedCallers] attributes into our assemblies. |
| Comment by Robert Stam [ 06/Jun/12 ] |
|
Can you provide links to where medium trust is well defined? |
| Comment by Daniel Sinclair [ 06/Jun/12 ] |
|
Medium trust doesn't mean a custom trust level. They are well defined, although may vary by version. There's a definition of Partial Trust for Azure for instance. |
| Comment by Robert Stam [ 13/Dec/11 ] |
|
From my research so far apparently "medium trust" is a bit of an undefined term. It basically means less than full trust, but exactly which permissions are taken away depend on settings controlled by the provider. Any recommendations on how to determine exactly what medium trust means? Anyone know how to run NUnit tests under medium trust? That would be by far the easiest way to get decent code coverage under medium trust, since there are no compiler errors related to medium trust, only runtime errors. I also want to mention that we do lots of things that are apparently not allowed under medium trust (reflection, IL code generation, compiling lambdas, etc...) so there's a pretty high probability that we are not going to support medium trust. Note also that Azure now runs all web applications under full trust. They found that too many things just don't work under medium trust and it was causing too many support issues. |
| Comment by David Baxter [ 30/Nov/11 ] |
|
By not working in a medium trust environment you are basically killing the ability to use mongodb for c# in any shared hosting setting. Considering a large portion of developers at least start in a shared environment, I would hope this gets bumped up to a higher priority. As for my project, I have to go back to using another driver until this is fixed even though I would prefer to the official driver. |