Nana
Nana

Reputation: 31

asp.net error “The type 'typeName' exists in both ”temp1.dll“ and ”temp2.dll"

When I build a web site I haven't got errors, but when I try to publish site the error appears:

Type 'AttachmentsControl' exists in both в 'c:\Users\userName\AppData\Local\Temp\Temporary ASP.NET Files\web.ui.application\8c85983a\5425041a\App_Web_mivbsgll.dll' and  'c:\Users\userName\AppData\Local\Temp\Temporary ASP.NET Files\web.ui.application\8c85983a\5425041a\App_Web_dhvduebi.dll'

I tried to add the batch="false" attribute to the "compilation" element of the web.config file, but this didn't help.

Also I tried to rename one class, but in this case another error appears:

Server Error in '/projectName' Application.
Thread was being aborted.

Can anybody help me? P.S.: the most strangest thing is that I get this project from MS TFS, my colleague who add this project to TFS publish this site without errors.

Upvotes: 1

Views: 1422

Answers (1)

Murtuza Kabul
Murtuza Kabul

Reputation: 6514

Most probably the reason could be you are uploading the source files along with compiled published output and at the same time the source files are modified.

When you see this error, what asp.net is trying to do is, compile the files and create the application and the result is, you have two type declaration of same name, one in the dll and one in the source.

Try to delete the dll file you have uploaded (from the bin directory), it should resolve the issue.

Upvotes: 1

Related Questions