I am trying to use the Entity Framework in an ASP.NET application hosted at GoDaddy. I keep receiving the following error:
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: System.Security.Permissions.SecurityPermission [SecurityException: System.Security.Permissions.SecurityPermission] EntityBid.Trace(String fmtPrintfW, String a1) +0 System.Data.EntityUtil.InvalidSchemaEncountered(String errors) +172 System.Data.Metadata.Edm.EdmItemCollection.LoadItems(IEnumerable
1 xmlReaders, IEnumerable
1 sourceFilePaths, SchemaDataModelOption dataModelOption, DbProviderManifest providerManifest, ItemCollection itemCollection, Boolean throwOnError) +232 System.Data.Metadata.Edm.EdmItemCollection..ctor(IEnumerable1 xmlReaders, IEnumerable
1 filePaths) +167 System.Data.Metadata.Edm.EdmMetadataEntry.LoadEdmItemCollection (MetadataArtifactLoader loader) +75 System.Data.Metadata.Edm.EdmItemCollectionLoader.LoadItemCollection (EdmMetadataEntry entry) +13 System.Data.Metadata.Edm.MetadataCache.LoadItemCollection (IItemCollectionLoader`1 itemCollectionLoader, T entry) +114 System.Data.Metadata.Edm.MetadataCache.GetOrCreateEdmItemCollection (String cacheKey, MetadataArtifactLoader loader, Object& entryToken) +133 System.Data.EntityClient.EntityConnection.LoadEdmItemCollection (MetadataWorkspace workspace, MetadataArtifactLoader artifactLoader) +51 System.Data.EntityClient.EntityConnection.GetMetadataWorkspace (Boolean initializeAllCollections) +161 System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection () +19 System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor) +144 System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName) +197 ...
It's my understanding that GoDaddy is a "Medium Trust" environment, and some posts I've found indicate that this is the problem. However, other posts, like the ones below, seem to imply Entity Framework should work within a medium trust environment.
http://forums.asp.net/t/1290380.aspx
http://support.microsoft.com/kb/958975
I have my edmx in a separate class library as recommended and have removed the edmx buildprovider from the web.config, but still receive the same error. Is this just another reason to leave GoDaddy? :)
Any suggestions would be greatly appreciated.
Thanks.