3

I have an error in app's log:

System.Web.HttpCompileException (0x80004005): c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\mywebapp\90904156\99c20f06\App_Web_mysearchctrl.ascx.2c0d06d2.yznxwhzi.0.cs(935): error CS0433: The type 'ASP.searchcontrols_period_ascx' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\mywebapp\90904156\99c20f06\App_Web_yzo1vfgs.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\mywebapp\90904156\99c20f06\App_Web_hzenlbp0.dll'
   at System.Web.Compilation.AssemblyBuilder.Compile()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()

It solves by deleting all from Temporary ASP.NET files, but after a time it appears again, so I need to find out where it comes from and prevent it in future. Please, help me.

Both controls are directly in web app.

P.S. I have no classes with the same names in my app. And error appears when app built in Release mode. And I always clean and rebuild solution before publishing

mike_grinin
  • 167
  • 1
  • 3
  • 13
  • Try to remove all files/dirs in: c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\mywebapp, stop your iis before you delete the files and than restart iis. – Peter Jun 04 '13 at 11:11
  • possible duplicate of [InvalidCastException for Object of the same type - Custom Control Load](http://stackoverflow.com/questions/14796546/invalidcastexception-for-object-of-the-same-type-custom-control-load) The two questions are similar - almost the same, from `David Ebbo` answer `This can happen when you have batching turned on and have some form of circular references at the directory level.` – Aristos Jun 04 '13 at 11:21
  • Yes, it helps but then (I think after redeploy) it appears again so I'd like to resolve it at all. Thank you nevertheless. – mike_grinin Jun 04 '13 at 11:21

0 Answers0