Märkus.
Juurdepääs sellele lehele nõuab autoriseerimist. Võite proovida sisse logida või kausta vahetada.
Juurdepääs sellele lehele nõuab autoriseerimist. Võite proovida kausta vahetada.
The expression must be of type because it is being assigned by reference
When assigning a reference to a variable, the type of the variables must match to be referenceable.
Example
The following sample generates CS8173:
// CS8173.cs (12,18)
class C
{
void M()
{
string s = "s";
object o = s;
ref string rs = ref s;
ref object ro = ref o;
ro = ref s;
}
}
To correct this error
Assigning the reference to a variable of the correct type will correct this error:
rs = ref s;
Tehke meiega GitHubis koostööd
Selle sisu allika leiate GitHubist, kus saate ka probleeme luua ja läbi vaadata ning päringuid teha. Lisateavet leiate meie kaasautorite juhendist.