codeSubDirectories and build order

N

Nick

So, this link:
http://msdn2.microsoft.com/en-us/library/54dwfbb7.aspx

says, "The build order is inferred from the top-down order of the codeSubDirectories collection. The App_Code directory is built last. However, there are no build order dependencies, which means that the build order is not significant."

Yet, if I have two subfolders in my project and have the web.config set like this:
<codeSubDirectories>
<add directoryName="SalesOrderViewer" />
<add directoryName="InterCoInvoices" />
</codeSubDirectories>

.... then classes inside SalesOrderViewer cannot see classes inside InterCoInvoices.... but InterCoInvoices can see SalesOrderViewer. Neither of these subfolders of classes can see anything in the App_Code root directory.

So is the documentation lying to me? or am I doing something wrong?

Thanks in advance!
-Nick Franceschina
 
M

Mark Fitzpatrick

Nick,
It looks correct to me actually. Since App_Code is built last, none of the code should have access to the App_Code directory since it hasn't been built yet. I think it's basically just a mis-interpretation. By dependencies you can think of it as projects. In solutions that would have numerous projects to build into something like a desktop app, the order that the projects are built becomes important and the compiler determines a best order to build them in to ensure that project b, which includes project a, is built after project a so it (project b) can then be compiled with project c. The docs here are basically saying that they don't care about this build dependency and pretty much just build in top down order of the directory list.

With the standard VS web project you really don't want code that depends upon code in other directories. You might try the Web Application Project instead (it's an add-on at: http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx) This is very similar to the old VS.Net 2003 web project and compiles everything into a binary, thus you're not limited to only code in your directory. It also has better performance in the fact that, since each directory and/or file can be compiled into it's own dll, to call code in another directory you end up having to call outside the dll. Doing this a lot will slow things down when you don't need them to.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
So, this link:
http://msdn2.microsoft.com/en-us/library/54dwfbb7.aspx

says, "The build order is inferred from the top-down order of the codeSubDirectories collection. The App_Code directory is built last. However, there are no build order dependencies, which means that the build order is not significant."

Yet, if I have two subfolders in my project and have the web.config set like this:
<codeSubDirectories>
<add directoryName="SalesOrderViewer" />
<add directoryName="InterCoInvoices" />
</codeSubDirectories>

... then classes inside SalesOrderViewer cannot see classes inside InterCoInvoices.... but InterCoInvoices can see SalesOrderViewer. Neither of these subfolders of classes can see anything in the App_Code root directory.

So is the documentation lying to me? or am I doing something wrong?

Thanks in advance!
-Nick Franceschina
 
N

Nick

Thanks Mark. I guess the wording was just tripping me up. I just created a new codeSubDirectory entry for the stuff that all other App_Code classes need to access... and put that first in the list. So it gets built first, and everyone can then see it.

I am aware of the WAP model, but I really like the benefits of the website model and thus I'm moving everything over to it.

Thanks again,
-Nick

Nick,
It looks correct to me actually. Since App_Code is built last, none of the code should have access to the App_Code directory since it hasn't been built yet. I think it's basically just a mis-interpretation. By dependencies you can think of it as projects. In solutions that would have numerous projects to build into something like a desktop app, the order that the projects are built becomes important and the compiler determines a best order to build them in to ensure that project b, which includes project a, is built after project a so it (project b) can then be compiled with project c. The docs here are basically saying that they don't care about this build dependency and pretty much just build in top down order of the directory list.

With the standard VS web project you really don't want code that depends upon code in other directories. You might try the Web Application Project instead (it's an add-on at: http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx) This is very similar to the old VS.Net 2003 web project and compiles everything into a binary, thus you're not limited to only code in your directory. It also has better performance in the fact that, since each directory and/or file can be compiled into it's own dll, to call code in another directory you end up having to call outside the dll. Doing this a lot will slow things down when you don't need them to.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
So, this link:
http://msdn2.microsoft.com/en-us/library/54dwfbb7.aspx

says, "The build order is inferred from the top-down order of the codeSubDirectories collection. The App_Code directory is built last. However, there are no build order dependencies, which means that the build order is not significant."

Yet, if I have two subfolders in my project and have the web.config set like this:
<codeSubDirectories>
<add directoryName="SalesOrderViewer" />
<add directoryName="InterCoInvoices" />
</codeSubDirectories>

... then classes inside SalesOrderViewer cannot see classes inside InterCoInvoices.... but InterCoInvoices can see SalesOrderViewer. Neither of these subfolders of classes can see anything in the App_Code root directory.

So is the documentation lying to me? or am I doing something wrong?

Thanks in advance!
-Nick Franceschina
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top