locked
How do you clear temporary files in an ASP.NET website project? RRS feed

  • Question

  • How do you clear temporary files in an ASP.NET website project?

    I have been building and rebuilding an ASP.NET program.

    I made the horrible mistake, I think, of recently copying the published content back to the folder I was developing.

    So now I have an unusual error when I build the code. It says That there is a duplicate definition in one file in a temporary directory with anohter file in a temporary directory.

    Error 3 The type 'ChildEventHandler' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files...\b90cc7a4\28d266b\assembly\dl3\c4cf1ea3\b6e4b808_ef7cce01\App_Code.DLL' and 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files...\b90cc7a4\28d266b\App_Code.asx5jp5d.dll' C:\inetpub\wwwroot...\Resources\usercontrols....ascx.cs 11 18 C:......\

    I removed project and file names, of course, but this is basically what the error says.

    Since the error is with temporary files, what should I do?

    I do not see a "clear" option in visual studio to clear out the files of a compile.

     

    http://i.stack.imgur.com/VgT2J.png

    • Moved by Jason Dot Wang Friday, July 26, 2013 9:12 AM This thread is about ASP.NET
    Monday, July 15, 2013 12:13 PM

Answers

  • ASP has it's own forum and you are a lot more likely to find answers there:

    http://forums.asp.net/


    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.

    • Proposed as answer by Just Karl Friday, September 20, 2013 12:59 AM
    • Marked as answer by Just Karl Sunday, September 22, 2013 3:00 PM
    Monday, July 15, 2013 3:37 PM

All replies

  • Have you tried to manually delete all files in ''c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\'?

    Plese note that if do this operation in a production server, each first user that visits a page will experience a short delay in receiving the page since the server has to re-created all files it needs.


    • Edited by dsmwb Monday, July 15, 2013 1:12 PM typo
    • Proposed as answer by Jason Dot Wang Wednesday, July 24, 2013 7:48 AM
    • Marked as answer by Jason Dot Wang Friday, July 26, 2013 9:11 AM
    • Unmarked as answer by Jason Dot Wang Friday, July 26, 2013 9:11 AM
    Monday, July 15, 2013 1:09 PM
  • Hi

    When you add new DLLs to the bin folder, they should immediately overwrite the files in the ASP.NET temp folders. I have myself noticed that sometimes (I assume that happend becuase of concurrency issues) the dlls are not loaded into memory.

    If you have access to IIS management console, you could recycle the worker process. That should ensure that new temp assemblies are loaded.

    Also if you change aspx oder ascx files, the resulting assemblies should be automatically replaced in the temp folder.


    If you think it is helpful, click "Vote As Helpful"! .If it is answered to the question of the thread, click "Mark As Answer".

    • Proposed as answer by Jason Dot Wang Wednesday, July 24, 2013 7:48 AM
    • Marked as answer by Jason Dot Wang Friday, July 26, 2013 9:11 AM
    • Unmarked as answer by Jason Dot Wang Friday, July 26, 2013 9:11 AM
    • Unproposed as answer by Just Karl Friday, September 20, 2013 12:59 AM
    Monday, July 15, 2013 2:29 PM
  • ASP has it's own forum and you are a lot more likely to find answers there:

    http://forums.asp.net/


    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.

    • Proposed as answer by Just Karl Friday, September 20, 2013 12:59 AM
    • Marked as answer by Just Karl Sunday, September 22, 2013 3:00 PM
    Monday, July 15, 2013 3:37 PM
  • Hi Bobby,

      You are more likely to get more efficient responses to ASP.NET issues at http://forums.asp.net where you can contact ASP.NET experts.

      Sincerely,

      Jason Wang


    Jason Wang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, July 26, 2013 9:12 AM