解决VS 2010中编译程序时弹出"Type universe cannot resolve assembly"的错误

文章详细解释了在使用VS2010编译程序时遇到的Typeuniversecannotresolveassembly错误原因及解决办法。此错误是因为System.Design.dll未包含在.NET Framework 4 Client Profile中导致的。
在使用VS 2010编译程序时有时候会遇到"Type universe cannot resolve assembly"的错误,从而导致程序编译出错,如下图。

untitled

  如果你对这个错误信息感觉到很迷惑,说明你不太理解什么是"Type universe"。Type universe其实是deployment framework中所有类型和程序集的集合,换句话说,这个错误信息其实是告诉你System.Design.dll在目标framework中不存在。

  为什么会这样呢?

  Microsoft Visual Studio的开发团队决定在VS 2010中将应用程序默认的目标framework设置成了.NET Framework 4 Client Profile,这样做主要是为了在客户端对应用程序的部署进行优化,如减小程序部署时package的大小,部署的时间,提高应用程序的可靠性以及性能等等。

  不幸的是许多用户和开发人员没有意识到这一点。例如我曾经在应用程序中使用一个开源的UI框架名字叫DockPanel,编译程序的时候就遇到过这种问题。要想真正解决这个问题其实是需要去修改这个框架的源代码然后重新生成程序集并重新在应用程序中引用,但是这很难做到。

  按照错误的提示信息,该错误主要是因为我们将第三方控件从VS 2010的工具箱拖放到窗体上,控件在设计时所需要的类依赖于System.Design.dll程序集,而该程序集并没有包含在Client Profile的.NET Framework框架中而产生的。我们可以在控件的源代码中添加设计时所需要的类,但是这样做显然不够好。在VS 2010中一个变通的方法是将Target framework修改成非Client Profile的Framework,然后重新编译应用程序。

untitled1

本文转自Jaxu博客园博客,原文链接:http://www.cnblogs.com/jaxu/archive/2011/08/01/2123918.html,如需转载请自行联系原作者

What is VMProtect? VMProtect protects code by executing it on a virtual machine with non-standard architecture that makes it extremely difficult to analyze and crack the software. Besides that, VMProtect generates and verifies serial numbers, limits free upgrades and much more. VMProtect Features Here you can find the description of the most important features of VMProtect, some screenshots and other useful information. For the full list of supported features, see the comparison chart. Supported Files And Formats VMProtect supports both 32 and 64-bits executable files, dynamically loaded libraries and drivers. This includes screensavers, Active-X components, BPL libraries and other files in PE-format. Protected files are run on almost any version of Windows, even old Windows 95! However, licensing feature requires at least Windows 2000. VMProtect doesn’t support .NET executables. Serial Numbers The Ultimate edition of VMProtect allows to add serial numbers to the protected application with minimal efforts. The feature is supported by PayPro Global e-commerce provider, so you even don’t need to setup your own serial number generator (of course, you can do that if you really need). Licensing feature allows to limit the period of free updates, set the time of life of serial number, prevent the code execution without serial numbers and much more. Any serial number can be blocked and newly protected files will not accept it. User Interface VMProtect features two modes of the user interface: simple and expert. Simple mode allows to easily pick functions for protection, adjust options and get the protected file with just a few mouse clicks. Expert mode is for advanced users, it shows assembly code, allows to write scripts, bundle DLLs and much more. It also features more settings on the “Options” tab. Console Version The Professional and Ultimate editions of VMProtect have a console version that supports command line parameters and can be used in automatic building process. It fully supports scripts, watermarks, serial numbers and all the other features of VMProtect.
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值