We encountered the problem described here: field-not-found-exception-with-net-4-4-5-compiled-regexes
In short: I tried to create a .Net 4.0 assembly on a machine that was upgraded to .Net 4.5. Therefore, I am targeting .Net 4.0. When trying to run this assembly on a machine that has .Net 4.0 installed, the following exception appears: Field not found: "System.Text.RegularExpressions.Regex.internalMatchTimeout.
If I create the same assembly on a machine that has not been upgraded to .Net 4.5, I can run the generated assembly on a .NET 4.0 machine without any problems. In other words: the .Net 4.0 assembly created on the .Net 4.5 machine does not match the one created on the .NET 4.0 machine.
The assembly contains precompiled regular expressions.
I can solve this problem:
- Build an assembly on a .NET 4.0 system.
- Upgrading the target machine to .Net 4.5.
However, there are problems with both solutions:
- We collect assemblies for various purposes, including WinRT. Now we are faced with the problem that we cannot use one machine to create them, which complicates the assembly / testing process.
- Produced assemblies are sent to customers. They will not like everything if we tell them to switch to .Net 4.5 in order to use assembly 4.0.
Do any of you know of a better solution than getting rid of precompiled regular expressions?
source share