为什么我不需要引用“System.dll"?使用“系统"命名空间? [英] How come I don't need to reference "System.dll" to use the "System" namespace?

查看:28
本文介绍了为什么我不需要引用“System.dll"?使用“系统"命名空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一项指定不使用任何外部库"的作业.所以我创建了一个 c# 应用程序,我做的第一件事就是默认删除所有 dll 的引用......包括System.dll".

I am working on an assignment that specified "Do not use any external libraries". So I created a c# application, and the first thing I did was remove all the dll's references by default... including "System.dll".

但是,我仍然可以将其添加到我的代码中:

However, I can still add this to my code:

using System;
using System.IO;

我只是很好奇我为什么不需要在我的项目中使用 System.dll 作为参考来执行此操作.谢谢!

I was just curious as to how come I do not need to have System.dll as a reference in my project to do this. Thanks!

推荐答案

mscorlib.dll 包括这两个命名空间中的项目.

mscorlib.dll includes items in both those namespaces.

您需要右键单击您的项目 > 属性 > 构建 > 高级...并选中不引用 mscorlib.dll"以删除此引用.

You need to right-click your project > Properties > Build > Advanced... and check "Do not reference mscorlib.dll" to remove this reference.

这篇关于为什么我不需要引用“System.dll"?使用“系统"命名空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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