Posts filed under 'ASP.Net'

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.

2 comments Permalink March 5th, 2007 Adrian Banks
Subscribe to this feed Bookmark this post on del.icio.us Digg this post on digg.com Share this post

Guidance Explorer

Microsoft recently released Guidance Explorer, a tool that contains a browsable collection of best-practice patterns for developing .Net and ASP.Net applications.

Guidance Explorer

Both the tool and its guidance library have regular updates, containing best-practices for performance and security related issues.

The tool also has the ability to add custom sets of guidance to allow corporate/team standards to be included.

Add comment Permalink July 19th, 2006 Adrian Banks
Subscribe to this feed Bookmark this post on del.icio.us Digg this post on digg.com Share this post

ASP.Net Web Development Helper For IE

Nikhil Kothari has made a nice little Web Development Helper for ASP.Net. It works as a plugin for Internet Explorer and is similar to the Internet Explorer Development Toolbar, but with more of an ASP.Net twist.

Some of its most useful features are:

  • Rich error information for script errors, including call stack, script url and line number.
  • A DOM inspector with filtering to enable easy viewing of particular items.
  • A view state browser.
  • Trace information can be shown in a separate dialog instead of in the page itself.
  • A full HTTP/HTTPS logger showing all traffic between the browser and the server.

The Web Development Helper requires .Net 2.0 to run and can only work on the same machine as the server, but this should not be a problem during development.

After installation, I had the same problem that lots of other people seem to have in that clicking the newly installed toolbar button did nothing. The suggested fix of installing the Internet Explorer Development Toolbar solved the problem though. Nikhil also suggested that a reboot (or killing explorer.exe) may also work because information about plugins is cached on startup.

Add comment Permalink July 10th, 2006 Adrian Banks
Subscribe to this feed Bookmark this post on del.icio.us Digg this post on digg.com Share this post

ASP.Net 2.0 Web Application Project Error

Chris Sells posted a useful tip (courtesy of Scott Guthrie) about duplicate types when compiling using the web application project model in VS2005.

The error displays as:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request.
Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0433: The type 'ASP.clientredirector_ascx' exists
in both 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\sb2\4d76034e\bec2c8d0\App_Web_clientredirector.ascx.cdcab7d2.zmdrab5k.dll'
and 'C:\Windows\Microsoft.NET\v2.0.50727\Temporary ASP.NET Files\sb2\4d76034e\bec2c8d0\App_Web_axhgbqrn.dll'



The solution is simply (although not obviously) to add the batch="false" attribute to the compilation element in the web.config file:

<configuration ...>
    <system.web>
        <compilation batch="false"/>

This generates a lot fewer assemblies and avoids the problem.


Update: According to Mike Harder (a Software Design Engineer on the ASP.NET team) in his recent post on the ASP.Net forums, this is a known bug in the ASP.Net compiler involving directory level circular references. An alternative fix to the batch="false" option is to reorganise the files in the web application to avoid a circular reference.

Add comment Permalink June 9th, 2006 Adrian Banks
Subscribe to this feed Bookmark this post on del.icio.us Digg this post on digg.com Share this post


Calendar

March 2017
M T W T F S S
« Oct    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Posts by Month

Posts by Category

RSS Feeds Feeds

Visitors

Visitor Map