views:

971

answers:

3

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(IEnumerable1 xmlReaders, IEnumerable1 sourceFilePaths, SchemaDataModelOption dataModelOption, DbProviderManifest providerManifest, ItemCollection itemCollection, Boolean throwOnError) +232 System.Data.Metadata.Edm.EdmItemCollection..ctor(IEnumerable1 xmlReaders, IEnumerable1 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://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/470ee417-082b-4298-8402-62227a0f2057/

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.

A: 

If I were you, I would contact GoDaddy support and make sure they get a developer to help you. You are right to do research about the Trust Level required as there must be some misunderstanding about what the Entity Framework requires and what GoDaddy provides. If you are thinking about leaving GoDaddy, you should know that I've had similar issues with Network Solutions (not with EF but with other elevated tasks).

YeahStu
+1  A: 

Does GoDaddy have asp.net 3.5 SP1 installed? I think you need SP1 installed to run entity framework.


Added: Just got a response.

Thank you for contacting Online Support. Unfortunately, we do not have Service Pack 1 installed for ASP.NET 3.5. I apologize for any inconvenience this may cause. Please let us know if we can help any other way.

Vitalik
A: 

Hi, Have you had any progress on this? I'm trying to do the same thing and am getting the same error.

Shotto

Wait until GoDaddy support .NET 3.5 SP1.
Cedrik