Clean conflicting class files from Temporary ASP.NET Files

99封情书 提交于 2019-11-29 15:05:09

问题


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.


回答1:


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/




回答2:


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




回答3:


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




回答4:


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.




回答5:


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.




回答6:


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.



来源:https://stackoverflow.com/questions/2686667/clean-conflicting-class-files-from-temporary-asp-net-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!