- Never introduce casts for ldobj-address-chains
- Add special-case to TransformExpressionTrees: transform addressof(ldloc) to ldloca
- Classify foreach and using variables as readonly lvalues
With the built-in support for long paths in .NET 6.0, we no longer need to check for the registry key. The only limitation that remains is maxSegmentLength, which seems to be 255 on all commonly used file systems/all platforms. Also there is no need to differentiate between Windows and other platforms.
- Windows Explorer in Windows 10 seems to be fine with files generated by ILSpy that have names longer than 260 characters.
- Notepad++ and other applications seem to use 8.3 path syntax to access the file.
- Visual Studio 2022 does not like the long path names, affected users should raise an issue with MS. ILSpy generates proper paths.
When C++/CLI project produce assembly it generates target attribute like this
```
[assembly: TargetFramework(".NETCoreApp,Version=7.0", FrameworkDisplayName = "")]
```
when C# generates `TargetFrameworkAttribute` it produce slightly different format
```
[assembly: TargetFramework(".NETCoreApp,Version=v7.0", FrameworkDisplayName = "")]
```
This fails in culture-invariant mode (ilspycmd) when trying to work with satellite assemblies, because System.Reflection.AssemblyName tries to retrieve CultureInfo of the assembly culture.
This commit adds a new parameter to PortablePdbWriter.WritePdb that
allows the caller to specify the exact Guid and timestamp that should be
used in the generated PDB. This will be useful for several scenarios
that are interesting for the Visual Studio debugger's integration:
1. Generating a PDB for an assembly that was built without debug info.
The PDB writer currently fails in this case, since the input assembly
has no debug directory from which to extract the relevant info. The
debugger can provide values that will allow us to load the generated
PDB.
2. Generating a PDB for an assembly that has multiple debug directories.
The PDB writer currently uses the first debug directory it finds, but
this isn't necessarily the correct one. The debugger can provide the
correct values.