It seems as though I posted this in the wrong forum (VS 2005) yesterday, so here it is in the correct one.
After running my site through the VS2005 RC Upgrade Wizard, I now have a ton of "Circular file references are not allowed" errors relating to my User Controls. Any idea on how to solve this as the circular reference isn't obvious at all?
A circular reference can be introduced when adding the Reference directive to tell the compiler where to find another page's class. For example, you could have Control1 refer to Control2, Control2 refer to Control3, and then Control3 refers back to Control1.
The only way to break a circular reference is to take one of the controls and use the Abstract Base Class design pattern (see the
Common Migration Issues and Solutions white paper as http://msdn.microsoft.com/asp.net/migration/upgrade/default.aspx for more detail).
The migration wizard should be smart enough to detect this situation, but obviously it did not work on your code. We would love to take a look at your project and see if we can fix the wizard in a post-Whidbey release. If you are willing, please send your web
app to m b u n d @ m i c r o s o f t . c o m and we'll take a look.
One additional note on batch=false -- this tells the ASP.NET compiler to not batch assemblies, and create an assembly for each web form and user control. When it is set to true, then the compiler will batch assemblies (in a non-deterministic way, but usually
one per folder) which may hide broken references, including circular references. We recommend during development you run with batch=false, but for deployment set batch=true. This flag is set web.config, e.g.
For deploy ment you cando two things to fix this.
1. If you precompiling you should be OK
2. Identfy where the circular reference is coming from, normally when a file in Folder1 referring to a file in folder2 and totally different file in folder2 referring back to another file in folder1 you may see this. This is because by default all files in
a folders tends to get built into single assembly. You can split some files into another folder to avoid this.
"This posting is provided "AS IS" with no warranties, and confers no rights"
Forgive me but I am not sure what you mean by pre-compilling ?
It's building without errors when "batch=false" is on ..... However its riddled with errors otherwise. Am I ok to use "batch=false" for a live website? I don't exactly understand what this is doing.
During compilation asp.net compiler try to batch some pages together to prduce a single assembly, By default all pages in a folder is built into a single assembly. so if file1 in folder1 refer to another file2 in folder2 and file1 in folder2 referring
to file2 in folder1 can cause circular refernce issue.
There are couple of way you can deploy the web to production server.
1. Source deployment, you can copy your entire site to the production machine.
2. Precompile, Use menu build->Publish website built assemblies are deployed in this case.
If you have batch=false build process will be slower. Thats why if you use second method in this case.
"This posting is provided "AS IS" with no warranties, and confers no rights"
BBuff
Member
10 Points
2 Posts
"Circular file references are not allowed" after running RC Upgrade Wizard
Sep 26, 2005 12:07 PM|LINK
After running my site through the VS2005 RC Upgrade Wizard, I now have a ton of "Circular file references are not allowed" errors relating to my User Controls. Any idea on how to solve this as the circular reference isn't obvious at all?
Thanks in advance,
Brian
mbund
Member
630 Points
126 Posts
Microsoft
Re: "Circular file references are not allowed" after running RC Upgrade Wizard
Oct 07, 2005 01:06 AM|LINK
The only way to break a circular reference is to take one of the controls and use the Abstract Base Class design pattern (see the Common Migration Issues and Solutions white paper as http://msdn.microsoft.com/asp.net/migration/upgrade/default.aspx for more detail).
The migration wizard should be smart enough to detect this situation, but obviously it did not work on your code. We would love to take a look at your project and see if we can fix the wizard in a post-Whidbey release. If you are willing, please send your web app to
m b u n d @ m i c r o s o f t . c o m and we'll take a look.
Thanks,
Baiju
Participant
990 Points
198 Posts
Microsoft
Re: "Circular file references are not allowed" after running RC Upgrade Wizard
Oct 14, 2005 05:26 PM|LINK
mbund
Member
630 Points
126 Posts
Microsoft
Re: "Circular file references are not allowed" after running RC Upgrade Wizard
Oct 14, 2005 06:49 PM|LINK
<system.web>
<compilation defaultLanguage="c#" debug="true" batch="false">
</compilation>
</system.web>
mike123
Contributor
2068 Points
728 Posts
Re: "Circular file references are not allowed" after running RC Upgrade Wizard
Nov 07, 2005 05:22 AM|LINK
mike123
mbund
Member
630 Points
126 Posts
Microsoft
Re: "Circular file references are not allowed" after running RC Upgrade Wizard
Nov 07, 2005 06:45 AM|LINK
Are you getting it when batch=false?
mike123
Contributor
2068 Points
728 Posts
Re: "Circular file references are not allowed" after running RC Upgrade Wizard
Nov 07, 2005 11:33 PM|LINK
Baiju
Participant
990 Points
198 Posts
Microsoft
Re: "Circular file references are not allowed" after running RC Upgrade Wizard
Nov 08, 2005 05:04 PM|LINK
For deploy ment you cando two things to fix this.
1. If you precompiling you should be OK
2. Identfy where the circular reference is coming from, normally when a file in Folder1 referring to a file in folder2 and totally different file in folder2 referring back to another file in folder1 you may see this. This is because by default all files in a folders tends to get built into single assembly. You can split some files into another folder to avoid this.
mike123
Contributor
2068 Points
728 Posts
Re: "Circular file references are not allowed" after running RC Upgrade Wizard
Nov 09, 2005 03:32 AM|LINK
Forgive me but I am not sure what you mean by pre-compilling ?
It's building without errors when "batch=false" is on ..... However its riddled with errors otherwise. Am I ok to use "batch=false" for a live website? I don't exactly understand what this is doing.
Thanks!
mike123
Baiju
Participant
990 Points
198 Posts
Microsoft
Re: "Circular file references are not allowed" after running RC Upgrade Wizard
Nov 09, 2005 06:59 PM|LINK
During compilation asp.net compiler try to batch some pages together to prduce a single assembly, By default all pages in a folder is built into a single assembly. so if file1 in folder1 refer to another file2 in folder2 and file1 in folder2 referring to file2 in folder1 can cause circular refernce issue.
There are couple of way you can deploy the web to production server.
1. Source deployment, you can copy your entire site to the production machine.
2. Precompile, Use menu build->Publish website built assemblies are deployed in this case.
If you have batch=false build process will be slower. Thats why if you use second method in this case.