Here is an ASP.NET Core nuget package decompiled by JustDecompile, I can't understand the usage of <>c.<>9
. I found that they have no declaration, it's very strange, the Nuget package name is Microsoft.Extensions.FileProviders.Physical
and the class file name is PhysicalFilesWatcher
.
Asked
Active
Viewed 870 times
3
-
Please edit your question to be clearer about what you mean. You're seeing these declarations in source code? Or a decompiler like ILSpy? – Joe Sewell Jun 07 '20 at 00:34
-
it's decompiled by JustDecompile. – QuinVon Jun 07 '20 at 00:38
-
1heres the real source: https://github.com/dotnet/runtime/blob/master/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs – Daniel A. White Jun 07 '20 at 00:56
1 Answers
5
This is a part of some identifier in some compiler generated code (C# does not allow developer to use <
and >
in identifier names, while the IL does). There are multiple language features in C# which are expanded by compiler into code, for example await
's, auto-properties, yield return
's, closures and others.
UPD
In this case based on my decompilation it seems that it is compiler generated code for this Action
lambda:
private static readonly Action<object> _cancelTokenSource = state => ((CancellationTokenSource)state).Cancel();
Which is initialized in generated static constructor via something like this:
PhysicalFilesWatcher._cancelTokenSource = new Action<object>((object) PhysicalFilesWatcher.'<>c.<>9, __methodptr(<. cctor>b__43_0));
[CompilerGenerated]
[Serializable]
private sealed class <>c
{
public static readonly PhysicalFilesWatcher.<>c <>9;
static <>c()
{
PhysicalFilesWatcher.<>c <>9 = new PhysicalFilesWatcher.<>c();
}
public <>c()
{
base..ctor();
}
internal void <. cctor>b__43_0(object state)
{
((CancellationTokenSource) state).Cancel();
}
}

Guru Stron
- 102,774
- 10
- 95
- 132
-
-
1@wulikunkun From just `'<>c.<>9'` - nope. What package? What class in that package? – Guru Stron Jun 07 '20 at 00:44
-
it's 'Microsoft.Extensions.FileProviders.Physical' package,and I found these code in PhysicalFilesWatcher class file. – QuinVon Jun 07 '20 at 00:49
-
1