6

Class file Conflicts in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ is preventing me from building the solution. Even though I try emptying out the folder, each time Visual Studio starts the build process, it brings in the class file in to the temp folder with the same folder name. If I restart the machine or leave it overnight, project build without error. Is there anyway to tell Visual studio to delete/ignore/clean any lingering class files that could be in the temp folder?

Clean solution option in VS doesn't work either. Class file in conflict are from the App_Code folder.

Deepfreezed
  • 567
  • 2
  • 10
  • 18
  • related http://stackoverflow.com/questions/3932677/what-is-the-shortcut-to-clear-temporary-asp-net-files-folder-before-runing-appl – Maslow Sep 27 '11 at 20:23
  • also related with some very good info http://stackoverflow.com/questions/586790/eliminating-temporary-asp-net-files/592673#592673 – Maslow Sep 27 '11 at 20:24

7 Answers7

10

Adding this as an answer here directly: move the temp location for easier cleaning or a pre-build event

<system.web>

   <compilation tempDirectory="d:\TempASP.NETFiles\">

      ...

   </compilation>

</system.web>

Source was the SO answer, which lead to this: http://blog.cwa.me.uk/2007/10/15/relocating-temporary-aspnet-files/

Community
  • 1
  • 1
Maslow
  • 18,464
  • 20
  • 106
  • 193
5

Clean, Close all instance of VS, delete the temp files, empty recycle bin, throw pinch of salt over left shoulder. start VS and rebuild all.

works for me at the odd times this happens

Sky Sanders
  • 36,396
  • 8
  • 69
  • 90
0

Check that you have not compiled DLL file and not compiled equal class in a project.

Anton
  • 9,682
  • 11
  • 38
  • 68
0

Use a pre-build operation on the project to make sure the folder is cleared, it's possibly IIS auto-compiling your app before serving it.

Aren
  • 54,668
  • 9
  • 68
  • 101
0

I think it's that you have two class names that are the same: One in your APP_Code and another class as the name of a user control or page.

Saturn K
  • 2,705
  • 4
  • 26
  • 38
  • This was correct the first time I tried to compile. But then I deleted the conflicting class but the problem did not go away. – Deepfreezed Apr 22 '10 at 13:36
0

I have faced the similar kind of issue in my project. The files were facing infliction between the files having same name from the current project and an another project. I have resolved it by deleting the files from my project's bin directory whichever i don't wanted.(Still if the problem is not resolved, delete the unwanted files & temporary files from "Debug" and "Release" folders.). This worked 100% in my case.

Praveen Patel G
  • 342
  • 4
  • 13
0

My problem was that this error was popping up when deploying in Azure using pipelines. Looked into the "Temporary ASP.NET folder" to clean it up, but it was empty. To fix the issue I packed the class into a namespace and updated the references to use the full Namespace.Class type.

Jonathan Ramos
  • 1,921
  • 18
  • 21