Saturday, June 24, 2006
« Office 2007 MSDN evening chapter | Main | Adding a dynamic control to a placeholde... »

You know that your collegue has created a class with interesting method that you like to reuse in your ASP.NET 2.0 web project but your project is in C#. Instead of waisting time to rewriting the whole chunk of code that your collegue wrote you can simply reuse the code. The only need is to create a couple of subfolders, putting your classes, C# and VB.NET, in these separate subfolders and put some extra configuration in the web.config file.

So for example you add these subfolders to the App_Code folder: CSharp and VB.

In the web.config you put these lines in the <compilation> element:

  <system.web>

    <compilation debug="true">

      <codeSubDirectories>

        <add directoryName="CSharp"/>

        <add directoryName="VB"/>

      </codeSubDirectories>

    </compilation>



  </
system.web>

Another nice thing about this is that you could also use it to organise your classes somewhat better. For example you can create several subdirectories which hold business classes that belong together and make them known in the <codeSubDirectories> element.

Grz, Kris.

Thursday, July 13, 2006 3:53:13 PM (GMT Standard Time, UTC+00:00)
Hi,
This is indeed a wonderful way to use more than one language in our web application. However, according to the configuration you have shown, your VB folder would be able to access all classes in CSharp folder. However, vice-versa wont be possible. All the directories mentioned later would be able to access classes in the ones mentioned above them.

I am facing major issue due to this. I have DataAccessLayer mentioned below BusinessLogiLayer folder. Hence BAL is able to access DAL classes, and not vice-versa.

Help is most wanted. Thanks in advance.
Ahmad
Sunday, July 16, 2006 7:17:17 AM (GMT Standard Time, UTC+00:00)
Hi,

a 3-tier architecture works so that the DAL is only there to handle the database stuff while the BL can ask the DAL to peform some data access logic. The DAL isn't supposed to call methods from the BL layer.

Grz, Kris.
Comments are closed.