从临时 ASP.NET 文件中清除冲突的类文件

发布于 2024-08-30 03:43:14 字数 297 浏览 5 评论 0原文

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ 中的类文件冲突阻止我构建解决方案。即使我尝试清空该文件夹,每次 Visual Studio 启动构建过程时,它都会将类文件引入到具有相同文件夹名称的临时文件夹中。如果我重新启动机器或将其放置过夜,项目构建不会出现错误。是否有办法告诉 Visual Studio 删除/忽略/清理临时文件夹中可能存在的任何残留类文件?

VS 中的 Clean Solution 选项也不起作用。冲突的类文件来自 App_Code 文件夹。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

心的憧憬 2024-09-06 03:43:14

直接在此处添加作为答案:移动临时位置以方便使用清洁或预构建事件

<system.web>

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

      ...

   </compilation>

</system.web>

来源是 SO 答案,这导致了这一点:
http://blog.cwa.me.uk /2007/10/15/重新定位临时aspnet-文件/

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/

山色无中 2024-09-06 03:43:14

清理,关闭 VS 的所有实例,删除临时文件,清空回收站,在左肩上撒一撮盐。启动VS并重建所有。

在这种情况发生的奇怪时刻对我有用

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

烟沫凡尘 2024-09-06 03:43:14

检查您是否没有编译DLL文件,也没有在项目中编译相同的类。

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

GRAY°灰色天空 2024-09-06 03:43:14

对项目使用预构建操作以确保清除文件夹,IIS 可能会在提供应用程序之前自动编译您的应用程序。

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.

丿*梦醉红颜 2024-09-06 03:43:14

我认为您有两个相同的类名:一个在 APP_Code 中,另一个类作为用户控件或页面的名称。

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.

酒解孤独 2024-09-06 03:43:14

我在我的项目中也遇到过类似的问题。这些文件面临当前项目和另一个项目的同名文件之间的冲突。我已经通过从项目的 bin 目录中删除我不需要的文件来解决这个问题。(如果问题没有解决,请从“调试”和“发布”文件夹中删除不需要的文件和临时文件。)。这对我来说100%有效。

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.

心房的律动 2024-09-06 03:43:14

我的问题是,使用管道在 Azure 中部署时会弹出此错误。查看“临时 ASP.NET 文件夹”以清理它,但它是空的。
为了解决这个问题,我将类打包到命名空间中,并更新了引用以使用完整的 Namespace.Class 类型。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文