When deplpying ASP.Net web site, you might get a CS0433 error with the following message:
Type [TypeName] already exists in both %ASP.Net Temp Folder%\[AssemblyName.dll] and %ASP.Net Temp Folder%\[AssemblyName.dll]%
This is confirmed a well known bug in ASP.Net.
The reason you got this error is that some of your ASP.Net pages/controls are cross referenced.
Say we have a ASP.Net web application with the following file structure:
If in PageA.aspx references ControlB.ascx in folder Dir_b, and PageB.aspx references ControlA.ascx in folder Dir_a then CS0433 error well be reported.
There are 2 ways to avoid this kind of error, one is to re-structure your file structure to prevent the cross reference. The other one is to add the following configuration setting in your web.config:
The reason we have to disable batch compilation is that when batch compile is enabled (ASP.Net default), ASP.Net compile each folder to an individual dll. So in our case, Dir_A/Dir_B will be compiled into 2 dlls, and it's clearly that they do cross reference.
訂閱： 張貼留言 (Atom)
- ► 2016 (19)
- ► 2008 (30)
- Michael Chi
- Taipei, Taipei, Taiwan