Add multiple languages in app_code folder
I had a web page on asp.net platform. I want to add a multiple programming language in the app_code folder. Is there a a way to place more than a one language in the app_code folder. Is there any restriction on adding more languages. I want the way by which i can add more languages and it should work fine also. If i placed the more than one language in the app_code folder, it must not messed up with my other classes also. Reply me some information on app_code folder and adding extra programming languages.
Re: Add multiple languages in app_code folder
The answer for your query is yes. You put more than one programming language in the app_code folder. It is also known as web.config file. You can store source code in the app_code folder and it will be compiled automatically at run time. The resulting assembly is access to any other code in the web application. It work much like an Bin folder. The app_folder's speciality is that in asp.net web application it can create custom classes and other source code files. This can be used in your web application without having them to compile independently. It can contain many files and subfolders you need. You can organize your source code in such a way that you find easy, access to other code anywhere in the web application.
Re: Add multiple languages in app_code folder
Maximum .NET services either develop in C or Visual Basic. Normally it depends on your requirement. As C is the most preferred programming language. It is important to note down that the source code in the App_code folder is compiled into a single assembky. That means the files in the App_folder must written in a single language. Just by creating a sub folders under the App_code folder can resolver your issue. Create VBCode for VB classes and CSCode for C# classes. Asp.net will treat the sub-folders as a separate compile units. Now create a code sub directories element in the compilation of the web.config file. And add subfolders. See an view below :
PHP Code:
<configuration>
...
<system.web>
...
<compilation debug="false">
<codeSubDirectories>
<add directoryName="VBCode" />
<add directoryName="CSCode" />
</codeSubDirectories>
</compilation>
...
</system.web>
...
</configuration>
Each sub folder stands for a different language.
Re: Add multiple languages in app_code folder
To add multiple programming language in the app_code folder do the following steps :
1). Add this in the web.config
PHP Code:
<configuration>
<system.web>
<compilation>
<codeSubDirectories>
<add directoryName="VB_Code"/>
<add directoryName="CS_Code"/>
</codeSubDirectories>
</compilation>
</system.web>
</configuration>
2). Create different sub folders for each language.
PHP Code:
/App_Code/VB_Code
/App_Code/CS_Code
3). Put your C# language code in cs_code folder and place vb.net language code in vb_code folder.