System.Reflection.ReflectionTypeLoadException with Entity Framework 4

橙三吉。 提交于 2019-12-23 22:36:35

问题


I am using EF4 in windows form app. I got a problem whenever I run a release file in machine which doesn't have visual studio 2010 installed I always got this error :

System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information

So far, the only workaround is install VS 2010 and rebuild solution in order to make the release run. It's so annoying, I wonder if there is a better solution.


回答1:


assuming you have the correct client profile installed on the client machine you might have dependencies to frameworks that are not in the base installation and need to be included as part of your deployment to the client.

You can quickly verify by selecting all the referenced dlls and setting Copy Local=True

And testing everything in the bin on a client machine.




回答2:


maybe on machine without VS is not installed framework 4.0? or in "target framework" on settings project set "full framework", but must set "client framework 4.0 or 3.5".

sorry for my bad English.




回答3:


Sorry, just remove the "buildProviders" block. It will probably work =)



来源:https://stackoverflow.com/questions/7802061/system-reflection-reflectiontypeloadexception-with-entity-framework-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!