System.Reflection.ReflectionTypeLoadException with

2019-07-12 23:49发布

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.

3条回答
做自己的国王
2楼-- · 2019-07-13 00:29

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.

查看更多
仙女界的扛把子
3楼-- · 2019-07-13 00:36

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.

查看更多
孤傲高冷的网名
4楼-- · 2019-07-13 00:46

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

查看更多
登录 后发表回答