Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
The type initializer for 'MongoDB.Bson.ObjectId' threw an exception.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
CJ  
View profile  
 More options Oct 29 2011, 11:24 am
From: CJ <carlosjl...@gmail.com>
Date: Sat, 29 Oct 2011 08:24:53 -0700 (PDT)
Local: Sat, Oct 29 2011 11:24 am
Subject: The type initializer for 'MongoDB.Bson.ObjectId' threw an exception.
Hi :)

Recently i started developing a web app in which i use MongoDB and it
worked beautifully, that until i uploaded to my Windows Shared Hosting
where the security policy is set to "Medium Trust" and Asp.Net it
always gave me this error "[SecurityException: That assembly does not
allow partially trusted callers.]".

After some research and debugging i finally set my development server
with the same policy (Medium Trust), but in order to solve that error
i had to download the C# Driver source code and compile it again, but
this time adding the following lines to the "AssemblyInfo.cs" files of
the "Bson" and "Driver" classes.

using System.Security;
...
...
[assembly: AllowPartiallyTrustedCallers()]

Finally that error was gone "[SecurityException: That assembly does
not allow partially trusted callers.]", But now i'm getting this new
error "The type initializer for 'MongoDB.Bson.ObjectId' threw an
exception." and i have no idea what should be done in that case.

Any ideas ?

PS: C# .Net Driver's developers should consider adding those lines to
the next driver's version, or come up with some solution so that we
don't get those errors while running on Medium Trust .Net servers


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Stam  
View profile  
 More options Oct 29 2011, 6:51 pm
From: Robert Stam <rstam10...@gmail.com>
Date: Sat, 29 Oct 2011 15:51:15 -0700 (PDT)
Local: Sat, Oct 29 2011 6:51 pm
Subject: Re: The type initializer for 'MongoDB.Bson.ObjectId' threw an exception.
We have not tested the C# driver in a Medium Trust environment. My
guess is that while adding the Assembly attribute allowed the assembly
to be loaded, the type initializer for ObjectId is still making some
operating system calls that are not permitted in a Medium Trust
environment.

I have created a JIRA issue to investigate whether the C# driver can
be made to run in a Medium Trust environment. See:

https://jira.mongodb.org/browse/CSHARP-348

On Oct 29, 9:24 am, CJ <carlosjl...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »