简体   繁体   中英

How to use C# namespaces

I am pretty new to C# but I have worked a little bit for my classes. When I worked in C#for classes, our teacher used to tell us the namespaces that we needed for completing the assignment.

I wanted to know where do I find all the collection of the namespace for C#. One of my friends directed me to this site https://docs.microsoft.com/en-us/dotnet/api/index?view=netframework-4.0

but some of the namespaces did not work for example,

enter image description here

I am working on a small project with ASP.NET MVC and wanted to try different namespaces

I think you may be a little confused, or are possibly not asking the question correctly. The link you provided does contain a list of the different libraries (namespaces) available in the C# API.

If you try to use a namespace in your own code, and it does not resolve, you may need to add an assembly reference to bring that namespace into your project. VS usually does a pretty decent job of guessing what assembly, or missing using statement is required if you either press alt+enter, or click the context drop down under the missing library (denoted by the red squiggly).

Either way, you should just start coding your MVC project, and then google the issues you come up with directly. Asking for all the namespaces is very very vague.

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