Mono take mscorlib.dll 2.0 instead of 4.0

风格不统一 提交于 2019-12-01 06:30:18

问题


I am having a problem with an MONO application, I'm trying to compile the project (with MonoDevelop) so as to load the library run mscorlib.dll 4.0 instead of version 2.0. (I need System.Type.op_Equality method that is in version 4.0 but not in 2.0).

I've temporarily solved by making a link:

# cd /usr/lib/mono/2.0
# mv mscorlib.dll mscorlib.dll.bak
# ln ../4.0/mscorlib.dll mscorlib.dll

But of course this is not a valid solution.

Does anyone know how to MONO load mscorlib 4.0 instead of 2.0?

Thanks and sorry for my English


回答1:


Finaly I found a solution for this problem:

https://bugs.launchpad.net/ubuntu/+source/gtk-sharp2/+bug/884035/comments/14

Simply modify the "app.config" file and change the content for this:

<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0"/></startup></configuration>

Recompile the proyect and now work fine.




回答2:


Right-click the project -> open the Build/General page and make sure Target Framework is Mono / .NET 4.0:



来源:https://stackoverflow.com/questions/10878948/mono-take-mscorlib-dll-2-0-instead-of-4-0

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