Problem: The type 'typename' exists in both 'dll-name-1' and 'dll-name-2'

Last post 07-02-2009 2:54 AM by imran_ku07. 6 replies.

Sort Posts:

  • Problem: The type 'typename' exists in both 'dll-name-1' and 'dll-name-2'

    05-21-2008, 10:19 AM
    • Member
      2 point Member
    • kito
    • Member since 05-21-2008, 2:11 PM
    • Posts 12

    Hi at all!

    For some strange reason I sometimes (not always) get the following compilation error when starting my ASP.net project:

    Server Error in '/' Application.

    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.formscontrols_worker_it_ascx' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\eda066a2\8bd7b761\App_Web_5w8zybux.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\eda066a2\8bd7b761\App_Web_worker_it.ascx.fd9ce2d7.k5uteqwr.dll'

     

    The problem happens both, when I'm starting in debug-mode or without debug-mode. The error message is actually true, the control exists in both of the dll's. The strange thing however is first that the error doesn't happen every time I compile and run the project and moreover it doesn't happen on any other PC of my team colleagues.

    Can someone give me a hint of what I could do to avoid the problem? Often a clean and rebuild of the solution helps, but not always Sad

    Thanks for any help, since the problem is really disturbing me!!
     

    Filed under: ,
  • Re: Problem: The type 'typename' exists in both 'dll-name-1' and 'dll-name-2'

    05-23-2008, 3:47 AM

    Hi,

    Please try to close your solution and delete the subfolder of 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files', and then rebuild your website.

    You also can try to copy your website files to new clean project.

     


    I hope this helps.

    Thomas Sun
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
  • Re: Problem: The type 'typename' exists in both 'dll-name-1' and 'dll-name-2'

    05-23-2008, 4:02 AM
    • Member
      2 point Member
    • kito
    • Member since 05-21-2008, 2:11 PM
    • Posts 12

    Hi,

    that's actually what I'm doing all the time. Just two minutes ago the compiler error showed up again. I then usually first try to just to a full rebuild of the solution. Often that already solves it, if not, I terminate the VS Development server, I do a clean of the solution, I clean the subfolders of the Temporary ASP.NET files and then I do a rebuild of the solution. Normally it works then, but not always. If it still doesn't work, I close VS and repeat all the steps of deleting the Temporary ASP.NET subfolders etc...

    The problem is just that this error appears on average 5-8 times during a day and it costs a lot of time, so I wanted to try to identify the root of the problem and not just a workaround.
    Could it be a computer-speed problem, meaning could a slow hard-drive cause it? I don't know why, but I have the feeling that certain files may be blocked during compilation and therefore things are compiled again in separate dll's...but as I said, it's just a feeling...
     

  • Re: Problem: The type 'typename' exists in both 'dll-name-1' and 'dll-name-2'

    05-25-2008, 10:43 PM

    Hi,

    Thanks for your response.

    If two different assemblies referenced in your application contain the same namespace and type, the compiler will throw this exception.

    Please make sure that there is not multiple Pages or User Controls which have same namespace or class.

    For more information, see http://blogs.msdn.com/carloc/archive/2007/06/12/compiler-error-message-cs0433-in-asp-net-2-0.aspx

     

    I hope this helps.

    Thomas Sun
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
  • Re: Problem: The type 'typename' exists in both 'dll-name-1' and 'dll-name-2'

    05-27-2008, 2:46 AM
    • Member
      2 point Member
    • kito
    • Member since 05-21-2008, 2:11 PM
    • Posts 12

    Hi, thanks for the link and the information.
    I've already checked before that there is no multiple page or user control in the same namespace or with the same class because that was also what I expected to be the problem. There isn't however any such problem. I already used the "Reflector" from Lutz Roeder and there are actually two dll's of the same type, so the compiler error is ok. My main problem is that there is no clear scheme when the error pops up. Often I work a whole afternoon without any error message and then there are days where it pops up on every start of the application. Or for instance the compiler error may appear on the first build and if I do a rebuild just immediately after the error popped up, everything may work fine. Therefore I'm no able to understand how to avoid the problem and furthermore - as already mentioned - my team colleagues work on the same code base and they have no such problems.

     

  • Re: Problem: The type 'typename' exists in both 'dll-name-1' and 'dll-name-2'

    06-18-2008, 2:51 AM
    Answer
    • Member
      2 point Member
    • kito
    • Member since 05-21-2008, 2:11 PM
    • Posts 12

    The problem is solved!!
    I'm posting the URL to my blog since I've already written a post there: http://blog.js-development.com/2008/06/type-x-exists-in-both.html

  • Re: Problem: The type 'typename' exists in both 'dll-name-1' and 'dll-name-2'

    07-02-2009, 2:54 AM
    • All-Star
      17,207 point All-Star
    • imran_ku07
    • Member since 06-04-2008, 9:21 AM
    • KARACHI, PAKISTAN
    • Posts 3,144

    Here is one solution and regenration of error.

    http://forums.asp.net/p/1441882/3270451.aspx#3270451


Page 1 of 1 (7 items)