Reputation: 139
when I was using Xamarin.Essentials, I needed to add an assembly reference. What is the difference between them? I though both were references. Thanks!
Upvotes: 0
Views: 51
Reputation: 3629
If an assembly A references an assembly B, then A can use all public types that are contained in B. So it's all about making the contents of another assembly known to your assembly.
The using
keyword is used within source files to conveniently allow you to refer to types within a certain namespace without having to specify their full name.
You can access any type without using
by specifying their full name like
void MyMethod()
{
var myList = new System.Collections.Generic.List<int>();
}
But if you put a using
statement into your source, you can refer to the type more easily like
using System.Collections.Generic;
void MyMethod()
{
var myList = new List<int>();
}
So using
is really only a convenience feature to make your code more easily written and read.
Upvotes: 1