无法加载文件或程序集“System.Drawing中,版本= 4.0.0.0 [英] Could not load file or assembly 'System.Drawing, Version=4.0.0.0

查看:3706
本文介绍了无法加载文件或程序集“System.Drawing中,版本= 4.0.0.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装Monogame,并试图运行一个非常简单的Hello World风格的游戏,我得到这个例外的时候。据我所知,有对堆栈溢出几个职位对这个错误,但我仍然困惑的是,如何解决这个问题。我是否需要卸载.Net和重新安装一个不同的版本?如果是这样,我怎么做呢?

I installed Monogame, and when trying to run a very simple hello world style game I get this exception. I understand that there are several posts on stack overflow regarding this error, but am still puzzled as to how to fix this. Do I need to uninstall .Net and reinstall a different version? If so, how do I do that?

一个System.IO.FileNotFoundException被抛出。
无法加载文件或程序集System.Drawing中,版本= 4.0.0.0,文化=中性公钥= b03f5f7f11d50a3a'或其依赖项之一。

A System.IO.FileNotFoundException was thrown. Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

这里有一个下载链接Xamarin项目:

Here's a downloadable link to the Xamarin Project:

https://www.dropbox.com/s/q7quw26lg1etdts/MonoGameTester.zip

推荐答案

这样的错误,如果你有提及该做的不可以附带Xamarin.iOS组件发生会。这对 System.Drawing.dll程序的情况。

Such errors will occurs if you have reference to assemblies that do not ship with Xamarin.iOS. That's the case for System.Drawing.dll.

在你的情况可能是因为你的项目有两个引用 monotouch.dll MonoMac.dll 这不是要去工作。

In your case it's likely because your project has references to both monotouch.dll and MonoMac.dll and that's not gonna work.

您需要建立单独的项目对每个目标,即一个用于iOS系统(monotouch.dll)和OSX(MonoMac.dll)。

You need build separate projects for each target, i.e. one for iOS (monotouch.dll) and for OSX (MonoMac.dll).

从可以共享源代码和/或组件(共享逻辑)每个项目。这两个项目还需要包括特定于平台的代码和引用。

From each project you can share source code and/or assemblies (for shared logic). Both projects also needs to include platform specific code and references.

在结束了一个很大的共享代码(源或组件)与代码的一些平台特定位。

In the end up with a lot of shared code (in source or assemblies) with a few platform specific bits of code.

这篇关于无法加载文件或程序集“System.Drawing中,版本= 4.0.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆