Circular File References are not allowed!
-
Tuesday, February 07, 2012 8:59 PM
This one is really starting to BUG ME!
I have a fairly large website written in both classic ASP and ASP.Net with
VB.Net being the main language. We use Visual Studio 2010 for the IDE.Usually, the website compiles without much trouble, but every once it a while
VS2010 decides on its own that there is a circular file reference (where there
wasn't one the last time it compiled!) and refuses to compile the site.SOMETIMES we can clear this up by telling VS2010 to REBUILD the whole
website.
SOMETIMES we can clear this up by deleting all of the IIS temporary
files.However, right now I can't get VS2010 to compile the site no matter what I
do. I've re-booted my machine several times (to great consternation, the number
of circular file references seems to change with every reboot!).Of course, this never happens on the simple one or two page demo
websites..
Anyone have any ideas of what I can try. I'm pretty sure there is no
circular file reference (in the current case, it's just an ascx page that
includes another ascx page on it). I wish VS2010 would tell me the FREAKIN'
PATH that it THINKS has the circular file reference!!!!SHEESH.
Wait!
AAAAAAAARRRRRRGGGGHHH!
TWO MORE RECOMPILES and the STUPID Circular File Reference errors WENT AWAY!
No, I did not change ANY CODE or anything else. Just hit the BUILD SOLUTION menu
item two or three more times!WHAT THE FREAK?!?!?!?!
Oh, now when I try to debug the solution, the circular file references are back!
Ok, so "Build/Rebuild Solution" followed immediately by "Build/Build Solution" gets rid of the circular file references! (But NOT EVERY TIME, only works 1 out of 3 or 4 times).
But then hit F5 to debug, and they are back.
So, "Build/Rebuid Solution" followed immediately by F5 to debug and -- Nope, always gets circular file references.
Very frustrating.
TIA,
Owen
All Replies
-
Tuesday, February 07, 2012 9:16 PM
I just added batch="false" to the compiler section of web.config and hit F5. NO CIRCULAR REFERENCE ERRORS! Woot!
Shouldn't be this hard though... Why does it sometimes work and sometimes not when batch is not set to false?
- Marked As Answer by Yi Feng LiModerator Wednesday, February 29, 2012 9:20 AM
-
Wednesday, February 08, 2012 1:57 AMModerator
Hi
Glod to know you have a workaround for this issue. Update: I mark your last reply as answer to close this issue.
As this is a ASP related issue, I recommend you post the follow up question to our ASP.net forum for better support.http://forums.asp.net/
Regards,
Yi
Yi Feng Li [MSFT]
MSDN Community Support | Feedback to us
- Edited by Yi Feng LiModerator Wednesday, February 29, 2012 9:20 AM
-
Wednesday, February 08, 2012 9:22 AM
I just added batch="false" to the compiler section of web.config and hit F5. NO CIRCULAR REFERENCE ERRORS! Woot!
Shouldn't be this hard though... Why does it sometimes work and sometimes not when batch is not set to false?
Could you provide a snippet of the area in web.config please. I can't find a "compiler" section or "batch".
Thanks.
-
Wednesday, April 18, 2012 12:47 PM
Setting <compilation batch="false" may not be a good solution. There is an impact on performance and doesn't apply when publishing the site. Normally, VS creates a DLL for each subfolder in the web application. With batch="false", a DLL is created for EACH file. The preferred fix is to rearrange the files in different folders, but I'm still looking for a better solution. I'd rather not break the logical grouping created by subfolders in order to workaround a stupid VS limitation.
See Fixing the “circular file references are not allowed” Error in ASP.net.
- Proposed As Answer by Doug Domeny Wednesday, April 18, 2012 12:48 PM
- Unproposed As Answer by Owen37 Wednesday, April 18, 2012 2:34 PM
-
Wednesday, April 18, 2012 2:53 PM
I have no choice but to set batch="false". I can't find a way to rearrange the folders, etc. to get it to compile. The WORST PROBLEM with the circular file reference error is that IT DOESN'T TELL YOU WHAT FILES ARE INVOLVED (just a hint that seems to be misleading)! Looking through the code, I can't find a circular file reference. Setting the batch="false" is the only way I can get the code to compile...
--
-
Wednesday, April 18, 2012 2:58 PM
I just added batch="false" to the compiler section of web.config and hit F5. NO CIRCULAR REFERENCE ERRORS! Woot!
Shouldn't be this hard though... Why does it sometimes work and sometimes not when batch is not set to false?
Could you provide a snippet of the area in web.config please. I can't find a "compiler" section or "batch".
Thanks.
The section is in <system.web><compilation... For vb.net, it looks like this:
<compilation debug="false" strict="true" explicit="true" batch="false" targetFramework="4.0" defaultLanguage="vb">
<compilers>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</compilers>
<assemblies>...
</assemblies>
<codeSubDirectories>...
</codeSubDirectories>
</compilation>This is from my debug area, so some settings may not apply to production (I changed it to debug="false" anyway)...
Hope this helps

