Categories
Geeky/Programming

VS2005 ASP.NET 2.0 "Ambiguous Match Found"

Sounds like some dating gameshow, where you are of the winner..and the date you get is someone you just aren’t sure of. Anyways, if you see this error in VS2005 (asp.net), what I have seen it means is: you have some control variables decalred in your codebehind file, and they are also declared in the designer.cs file. To fix, just remove them from the codebehind file and it should build. If you are using Web Application Projects, I have also seen that using “CodeFile=” instead of “CodeBehind=” doesn’t work when you goto deploy. It seems that CodeFile wants the .cs file to be present, and I am guessing most people dont want to deploy their source code along with their aspx files. Happy Coding πŸ™‚

By Steve Novoselac

Director of Digital Technology @TrekBikes, Father, Musician, Cyclist, Homebrewer

18 replies on “VS2005 ASP.NET 2.0 "Ambiguous Match Found"”

[…] VS2005 ASP.NET Web Application Project RC1 I’ve been following Scott’s progress with the Web Application Project (coined WAP) for some time now and after converting my pet project over to ASP.NET 2.0 and finding the problems with the new VS2005 IDE I was greatful for his work! The download is on MSDN.The biggest one for me was definately the locking of .aspx files when in debug mode and the batch compilation it does without the new .designer.cs files that are in this new project.I’ve found a few errors mainly regarding where .cs files have to sit. The main ones were ‘ambiguous match found’ where a control was defined in multiple places in the .cs and the designer.cs files…thanks to stevienova.com for the resolution of this one. For some reason though ti appears that one of my class files is being included in the WAP .dll file as well ans when it compiles the app_code at runtime.error CS0433: The type ‘inlinehockey._common’ exists in both ‘c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesroot253216389b5c4b00assemblydl33657f4e6cd91aef5_4d5cc601inlinehockey.DLL’ and ‘c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesroot253216389b5c4b00App_Code.xad_ajc1.dll’  The error was not knowing what dll to use for the type when you get the CS0433 error. I found out how to get round this from the microsoft.com upgrade experience, but it didn’t solve it for me. Published Monday, April 10, 2006 4:08 AM by JeremyThake Filed Under: ASP.NET […]

Like

Thanks for this post. We had issues with the “Ambiguous Match Found” error when first deploying our application after upgrading to 2.0 from 1.1. There were lots of references on the web to this issue with case-sensitive naming discrepancies, but that was not the case with us, nor did it seem to solve the problems of other desparate coders seeking help.

I almost didn’t find this post, but it cleared the issue right up. It seems that the conversion wizard chose to leave some of the declarations in our .cs file on the problematic page.

Thanks again!

Like

Hi Stevie,

I was wondering could you help me further on this. I have been paining over this for the last 3 days. I changed a version of a dll in my project and ever since I did, I have gotten this error. Its driving me mad. It seems to occur on the compliation of the markup. I have removed control variables from the designer.vb but it still errors out on me. Do you have any further insight into this. I can provide a code sample if you need it!! Any help would be marvellous. Thanks !!!

Like

πŸ™‚ Oh best of luck with that. Thanks anyhow though. I was so excited when I read your blog entry as there seems to be a vagueness on the net about this. Shame it didn’t work out for me, but fair play for sharing your knowledge. Best of luck with the move Steve πŸ™‚

Like

[…] 4/9/2006 VS2005 ASP.NET Web Application Project RC1I’ve been following Scott’s progress with the Web Application Project (coined WAP) for some time now and after converting my pet project over to ASP.NET 2.0 and finding the problems with the new VS2005 IDE I was greatful for his work! The download is on MSDN.The biggest one for me was definately the locking of .aspx files when in debug mode and the batch compilation it does without the new .designer.cs files that are in this new project.I’ve found a few errors mainly regarding where .cs files have to sit. The main ones were ‘ambiguous match found’ where a control was defined in multiple places in the .cs and the designer.cs files…thanks to stevienova.com for the resolution of this one. For some reason though ti appears that one of my class files is being included in the WAP .dll file as well ans when it compiles the app_code at runtime.error CS0433: The type ‘inlinehockey._common’ exists in both ‘c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesroot253216389b5c4b00assemblydl33657f4e6cd91aef5_4d5cc601inlinehockey.DLL’ and ‘c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesroot253216389b5c4b00App_Code.xad_ajc1.dll’  The error was not knowing what dll to use for the type when you get the CS0433 error. I found out how to get round this from the microsoft.com upgrade experience, but it didn’t solve it for me. I’ve posted this up in the forums…hopefully I’ll get an answer!Posted at 12:00 AM by Jeremy Thake | Category: Microsoft .Net Development | Permalink | Email this Post | Comments (0) […]

Like

I too am getting the EXISTS IN BOTH places error. I can’t get rid of it. I had this site running fine in VS2003 ASP.NET v1.1 but needed to update it to VS2005 ASP.NET 2.x so I could use a new control. I cannot get it to work now. This EXISTS IN BOTH paces thing is maddening. I removed all references to the control in question and then referenced them from scratch for the Toolbox but it still SEES the old version of the dll some how and puts it in the Temporary ASP.NET dir. If you have solved this could you please email me and enlighten me? Refards! howzilla at everestkc dot net

Like

I had this problem in a file .aspx which was because I had .aspx.cs but not .aspx.designer.cs. Right click .aspx in the Solution Explorer and click “Convert to Web Application”. A .aspx.designer.cs file will be created. This fixed the problem for me.

Like

I faced the same problem
The reason was that I have a TextBox with ID= ‘find’
and a string called ‘Find’
although C# is case senstive but when I changed the string to be ‘_Find’ it solved the problem

Like

I also had similar issue, parser error “Ambiguous match found”

the solution to the problem was that in the file where parser error(Ambiguous match) was occurring.. I expanded the drop down for controls/methods in the page.. I found two controls with similar names only their cases were different. One was RegularExpressionValidator1 and other was RegularexpressionValidator1, I rename one to be different from the other and the problem was solved.

Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.