locked
Type exists error in web application (VS bug?) RRS feed

  • Question

  • User-455222853 posted

    I wrote a validator control that overrides the CompareValidator.  I originally had the source in the root souce directory, and compiled the app while it was in there.  Of course the app could not find it, so I then moved it to the App_Code directory.  Now when I run the app I get:

    CS0433: The type 'CustomWebControlsLibrary.NumericValidator' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\4174add5\84dd6438\assembly\dl3\1cc3dd2d\2719ebed_4578ca01\Blue Ribbon 2011 ASPX.DLL' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\4174add5\84dd6438\App_Code.kpebdz_c.dll'

    I have deleted the Temporary ASP.NET Files\root\ directory and recompiled, and I tried rebooting and clearing my browser cache, but I can't seem to make this error go away.

    I have another validator control that has always been in the App_Code directory, and it works fine.

    Has anyone else seen this, or know how to fix it?

    Tuesday, December 8, 2009 4:31 PM

Answers

  • User-455222853 posted

    I fixed it.

    I copied the source out of the control, deleted the control from App_Data, created a new class in App_Data, copied the origingal source into the new control, and all is well...it works fine.  Visual Studio must have had some erroneous metadata somewhere that got deleted when I deleted the original control.

    Thanks to everyone for the suggestions.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 10, 2009 8:53 AM

All replies

  • User-455222853 posted

    Thanks for the suggestion.

    No go.  Xcaclsl seems to have worked (there were no error messages), but the error is still there.


    Tuesday, December 8, 2009 5:01 PM
  • User-16411453 posted

    It stills see's the old compiled code, you have to delete the old code file in the folder in says, or rename the app in the new location, and leave the old stuff behind.

    Tuesday, December 8, 2009 6:34 PM
  • User-455222853 posted

    I renamed the app source code, changed the class name, changed the namespace, and changed the toolboxdata, and still get the same error, with the new name.  The source file only exists in one place, and I only changed the name in one source file and only in those places.  The source file name is not the same as the class name.

    Compiler Error Message: CS0433: The type 'CustomWebControlsLibrary.NumberValidator' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\4174add5\84dd6438\assembly\dl3\1cc3dd2d\6056f7dd_e678ca01\Blue Ribbon 2011 ASPX.DLL' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\4174add5\84dd6438\App_Code.jmhzchs_.dll'

    I searched my hard drive for the name of the duplicate.  It was found in these source files::

    In 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\4174add5\84dd6438'
    as App_Code.psob4z4.1.cs, App_Web_l5qqkddu.2.cs, and App_Web_page1.aspx.cdcab7d2.3896xryi.0.cs.  The page1 file is where it is referenced, the source code is in the App_Code directory, but it is only there once.

    Also in 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\fbe21d13\9b3a366c' as App_Code.fhr4wbzp.1.cs

    I previously deleted the entire 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\'  directory

    Anyone know how Visual Studio manages these?  This is crazy!




    Wednesday, December 9, 2009 12:58 PM
  • User-16411453 posted

    I've had that happen to me before, where I started with app_code, and then moved it into a dll project. You did the right thing, it's just more detailed and harder to find than I anticipated. Break out your magnifying glass, and search harder, use the find word program to list the words below

    It's this type it's shouting about, exclude one of files belowin your project to narrow it down. Don't worry about cleaning up, asp.net will do it for you.

    Find this statement - CustomWebControlsLibrary.NumberValidator

    in

    App_Code.jmhzchs_.dll and Blue Ribbon 2011

    I don't have your project in front of me, be patient, try one more time.


    Wednesday, December 9, 2009 5:19 PM
  • User-455222853 posted

    I'm not sure what you are suggesting I do.  How would I exclude one of the files?


    Thursday, December 10, 2009 8:37 AM
  • User-455222853 posted

    I fixed it.

    I copied the source out of the control, deleted the control from App_Data, created a new class in App_Data, copied the origingal source into the new control, and all is well...it works fine.  Visual Studio must have had some erroneous metadata somewhere that got deleted when I deleted the original control.

    Thanks to everyone for the suggestions.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 10, 2009 8:53 AM