Ambiguous match found
Whilst porting an ASP.Net application to the .Net 2.0 framework, I came across a spurious error when viewing a few specific pages. The error was occurring during the runtime compilation of these specific aspx pages.
Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Ambiguous match found.
To make this error more confusing, the error was reported on line 1 of the aspx page which contained nothing more than the page directive tag.
After a bit of searching, I found the cause of the problem. The cause was that there were two member variables declared with names that differed only by case (one was an ASP.Net PlaceHolder control, the other an int). Simply renaming one of the variables solved the compilation error.
Eran Sandler has also encountered this problem, but delves a lot deeper into what is going on.
Testing applications in different cultures
Having worked on an application that required localising so that it can be translated into different languages, I know how hard it can be to test the different possibilities while still developing the code. This is especially so if the language is automatically detected from the current culture of the operating system.
Shawn Farkas came up with a simple solution for quickly testing code under different cultures that involves creating a bootstrap application to first set the required culture on the current thread and then launch the application to be tested.
One downside is that only the culture of the main thread is set, but for simple GUI testing this should be adequate in most cases.
Selecting 'No to all' in a confirm file replace dialog box
When copying files in Windows, you are sometimes prompted about replacing an existing file.
The available options are Yes, Yes To All, No and Cancel. But what if you are copying a large number of files and want to choose the non-existent ‘No To All’ option? Well simply hold in the shift key while clicking the No option and it will apply that choice to all subsequent dialogs within the current operation.
Running applications on different versions of the .Net framework
Peter Laudati posted about migrating applications from .Net 1.1 to .Net 2.0. In doing so, he listed the different behaviours of .Net applications when running on computers with different versions of the .Net Framework installed:
| Application type | Computer with 1.1 | Computer with 2.0 | Computer with 1.1 and 2.0 |
|---|---|---|---|
| 1.1 stand-alone application (Web or Microsoft Windows client) | Loads with 1.1 | Loads with 2.0 | Loads with 1.1 |
| 2.0 stand-alone application (Web or Microsoft Windows client) | Fails | Loads with 2.0 | Loads with 2.0 |
| 1.1 add-in to a native application (such as Office or Internet Explorer) | Loads with 1.1 | Loads with 2.0 | Loads with 2.0 unless the process is configured to run against 1.1 |
| 2.0 add-in to a native application (such as Office or Internet Explorer) | Fails | Loads with 2.0 | Loads with 2.0 |
Managed stack explorer
A neat little project on CodePlex called Managed Stack Explorer enables you to monitor running .Net applications.
Using this tool, you can view all currently running managed applications, monitor all of their threads, and even collect stack traces at regular intervals. Very useful for getting information about applications whilst running outside of a debugger.
