ali raza

C#, .Net ,Asp.net and my thoughts

c# and vb classes can be used in same asp.net 2 application

It is possible in asp.net 2 that c# an vb.net classes can be used in same project

All class files are contained in \app_Code folder which is compiled into single assembly.

It is possible that classes placed in same folder causes error. So make different folders in \app_data such as “vbclasses” and “c#classes”

    

\ App_Code              

                         \ vbclasses

                          \ c#classes

  

            

 now places  vb and c# classes in their respective folders as

\ App_Code              

                         \ vbclasses

                              someClass.vb

                          \ c#classes

                                 otherClass.cs

   

now we have to add some lines in web.config under the compilation key

<compilation>

   <codeSubDirectories>

      <add directoryName=”vbclasses”></add>

      <add directoryName=”c#classes”></add>

   </codeSubDirectories>

</compilation> 

now asp.net compile the code in single assembly and we can use the implementation of code placed in vb or c# class in our application without specifying their extensions

 

One response to “c# and vb classes can be used in same asp.net 2 application

  1. Earl March 4, 2008 at 9:21 pm

    FYI: Server Intellect is one of the first Windows Web Hosts and Microsoft Gold Certified Partners to offer Windows Server 2008 ‘Longhorn’ on all Dedicated Servers. The Windows Server 2008 is the most substantial upgrade to the Windows Server product line since Windows 2000, including many upgrades and additions to Windows Server including new web, security and virtualization technologies.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: