C# class in App_code

Is it ok to add C# class to my existing web project - VB , under App_code and use it?  Will it runs?
VBdotnet2005Asked:
Who is Participating?
 
rawinnlnx9Connect With a Mentor Commented:
This shouldn't be a problem at all. I'm doing in in DotNetNuke programming right now. No issues at all.
0
 
Paul JacksonSoftware EngineerCommented:
Source code in the app folder is compiled as one assenbly so you cannot mix languages.
You can configure your web application to treat different sub folders in the app folder as different assemblies.

Each folder can then contain source code in a different programming language. The configuration is specified by creating a codeSubDirectories element in the compilation element of the Web.config file and adding a reference to the subfolder. The following example illustrates how you would configure subfolders named VBCode and CSCode to compile into separate assemblies:

<compilation debug="false">    
    <codeSubDirectories>        
        <add directoryName="VBCode" />        
        <add directoryName="CSCode" />    
    </codeSubDirectories> </compilation>

0
 
Rahul AgarwalTeam LeaderCommented:
Create the Two separate sub folders in App_code named VBCode (contains VB Class files *.vb) and CSCode (Contains CS Class files *.cs) then modify the web.config like this

<compilation debug="false">    
    <codeSubDirectories>        
        <add directoryName="VBCode" />        
        <add directoryName="CSCode" />    
    </codeSubDirectories> </compilation>
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
VBdotnet2005Author Commented:
One thing, can I call methods from C# classes in VB or the other way around?
0
 
VBdotnet2005Author Commented:
How can I call C# class in VB page? Is it possbile?
0
 
Paul JacksonConnect With a Mentor Software EngineerCommented:
Yes you can do that it won't be a problem.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.