Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have an WCF service that is hosted on a web site, but i can get Entity Framework to work with it. Everything works fine locally but not on the server. I get the following exception:
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Stack trace:
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)  at System.Reflection.Assembly.GetTypes() at System.Data.Metadata.Edm.ObjectItemAttributeAssemblyLoader.LoadTypesFromAssembly()  at System.Data.Metadata.Edm.ObjectItemAssemblyLoader.Load()   at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, ObjectItemLoadingSessionData loadingData)  at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, KnownAssembliesSet knownAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage, Object& loaderCookie, Dictionary`2& typesInLoading, List`1& errors)\r\n   at System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyFromCache(ObjectItemCollection objectItemCollection, Assembly assembly, Boolean loadReferencedAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage)\r\n   at System.Data.Metadata.Edm.ObjectItemCollection.ImplicitLoadAssemblyForType(Type type, EdmItemCollection edmItemCollection)\r\n   at System.Data.Metadata.Edm.MetadataWorkspace.ImplicitLoadAssemblyForType(Type type, Assembly callingAssembly)  at System.Data.Objects.ObjectContext.GetTypeUsage(Type entityCLRType)\r\n   at System.Data.Objects.ObjectContext.GetEntitySetFromContainer(EntityContainer container, Type entityCLRType, String exceptionParameterName) at System.Data.Objects.ObjectContext.GetEntitySetForType(Type entityCLRType, String exceptionParameterName)


I'm sorry that I'm not able to provide more details, but this is because i don't know what is going on. If there are any other details needed to solve this problem please let me know, i will post them. I have checked the following:

1. .Net version is the same on all projects.
2. Copy Local is set to "True" on all references.
Posted
Comments
Jim Jos 10-Oct-12 6:46am    
This won't please publish the code which is not working

1 solution

Finally solved it. My library project referenced System.Web.Mvc so i had to copy the following dll's to the Bin-folder:

Microsoft.Web.Infrastructure.dll
System.Web.Mvc.dll
System.Web.Razor.dll
System.Web.WebPages.Deployment.dll
System.Web.WebPages.dll
System.Web.WebPages.Razor.dll

What i don't understand is, if i set the copy local to "true" on a reference inside a library project why isn't it included, when i publish the web site.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900