Compiled regex in beta 2

In 1.1, when you create a compiled Regex, AppDomain.CurrentDomain.GetAssemblies will include an Assembly with a name like RegexAssembly12_0. In 2.0, this doesn't seem to happen.

Is this a change in the way GetAssemblies works, or in the way compiled regexes work?

[288 byte] By [JonShemitz] at [2007-12-16]
# 1
Good question. GetAssemblies should be the same as before.

This is a change in the way compiled regexes work since Whidbey Beta2.
Regular expressions have been switched to use lightweight code generation.

This does not change the contract functionality of regular expressions, but enables better performance when creating Regex objects which are compiled to in-memory IL. The main code path won't actually generate a dynamic assembly anymore, so your call to GetAssembles won't display a new assembly.

The new Regex.CompileToAssembly member will compile a regex into a dynamic assembly visibly to AppDomain.GetAssemblies, however.

Thanks.

DaveFetterman at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified