I have been building and rebuilding an ASP.NET program.
我一直在构建和重建ASP.NET程序。
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.
所以现在我在构建代码时遇到了一个不寻常的错误。它表示临时目录中的一个文件中存在重复的定义,并且临时目录中包含anohter文件。
Error 3
错误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:......\
类型'ChildEventHandler'存在于'c:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP.NET Files ... \ b90cc7a4 \ 28d266b \ assembly \ dl3 \ c4cf1ea3 \ b6e4b808_ef7cce01 \ App_Code.DLL'和'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.
我没有在visual studio中看到一个“清除”选项来清除编译文件。
3 个解决方案
#1
20
This problem I faced sometimes back while compiling. Go to this folder c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
and delete all the files and folder under it. When you build an application which is not hosted under IIS, temporary debug files and folder get created under this folder.
在编译时我有时会遇到这个问题。转到此文件夹c:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP.NET Files并删除其下的所有文件和文件夹。当您构建不在IIS下托管的应用程序时,将在此文件夹下创建临时调试文件和文件夹。
It may happen that you get an access denied error while deleting them. Close your Visual Studio solution and delete everything under this folder. It will resolve the compilation error.
删除时可能会出现拒绝访问错误。关闭Visual Studio解决方案并删除此文件夹下的所有内容。它将解决编译错误。
#2
6
For those using Visual Studio 2015 in Windows 8 or Windows 10, the solution is to remove all temp files from the following location:
对于在Windows 8或Windows 10中使用Visual Studio 2015的用户,解决方案是从以下位置删除所有临时文件:
%AppData%\Local\Temp\Temporary ASP.NET Files
%AppData%\ Local \ Temp \ Temporary ASP.NET Files
and then rebuild your Solution.
然后重建您的解决方案。
#3
1
If you haven't got the option of "Clean Solution" (maybe Express verions, or pre-2010 don't have this?) then, to fix this error, simply go to the /bin folder of your solution and delete all items, then Build again.
如果您还没有选择“Clean Solution”(可能是Express版本,或者2010年之前没有这个?)那么,要修复此错误,只需转到解决方案的/ bin文件夹并删除所有项目,然后再次构建。
This will recompile all the DLL files.
这将重新编译所有DLL文件。
#1
20
This problem I faced sometimes back while compiling. Go to this folder c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
and delete all the files and folder under it. When you build an application which is not hosted under IIS, temporary debug files and folder get created under this folder.
在编译时我有时会遇到这个问题。转到此文件夹c:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP.NET Files并删除其下的所有文件和文件夹。当您构建不在IIS下托管的应用程序时,将在此文件夹下创建临时调试文件和文件夹。
It may happen that you get an access denied error while deleting them. Close your Visual Studio solution and delete everything under this folder. It will resolve the compilation error.
删除时可能会出现拒绝访问错误。关闭Visual Studio解决方案并删除此文件夹下的所有内容。它将解决编译错误。
#2
6
For those using Visual Studio 2015 in Windows 8 or Windows 10, the solution is to remove all temp files from the following location:
对于在Windows 8或Windows 10中使用Visual Studio 2015的用户,解决方案是从以下位置删除所有临时文件:
%AppData%\Local\Temp\Temporary ASP.NET Files
%AppData%\ Local \ Temp \ Temporary ASP.NET Files
and then rebuild your Solution.
然后重建您的解决方案。
#3
1
If you haven't got the option of "Clean Solution" (maybe Express verions, or pre-2010 don't have this?) then, to fix this error, simply go to the /bin folder of your solution and delete all items, then Build again.
如果您还没有选择“Clean Solution”(可能是Express版本,或者2010年之前没有这个?)那么,要修复此错误,只需转到解决方案的/ bin文件夹并删除所有项目,然后再次构建。
This will recompile all the DLL files.
这将重新编译所有DLL文件。