简体   繁体   中英

Why the reference of System.Design.dll not added already in Visual Studio?

When I trying to use "System.Windows.Form.Design" namespace, I have to add reference all the time in new project. Can any tell me about it?

When you create different projects in Visual Studio it adds by default different BCL assemblies as references. System.Design.dll is not one of them as it is not commonly used by standard apps / developers. That's how the designers decided. You could create your own project type which will already contain the reference and then export it as project template .

There are masses of dlls available just in regular .NET, with tools to cover a wide range of technology niches - and that is before you add any external libraries. You wouldn't want all the available .NET framework dlls in your project - it would, frankly, make your eyes blister. The IDE adds a small set designed to cover:

  • allowing the default application template to build
  • some core / heavily-used .NET features
  • in the case of 4.0, supporting libraries for certain language features ( dynamic etc)

It is entirely likely that you will need more references - but which references depends on what you are going to write - for example, you might need EF, or you might need RSS-handling, etc. You might also choose to remove a few of the default ones, if you aren't actually using them (although note that this doesn't affect the result, as the C# compiler will drop unused references automatically - this is just to be tidy).

Tools like resharper can help here, by offering to add both the using directive and the reference when you enter a type-name that it recognises (but which doesn't currently resolve).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM