?
Solved

C# class in App_code

Posted on 2011-02-24
7
Medium Priority
?
521 Views
Last Modified: 2012-08-13
Is it ok to add C# class to my existing web project - VB , under App_code and use it?  Will it runs?
0
Comment
Question by:VBdotnet2005
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 34975946
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
 
LVL 13

Expert Comment

by:Rahul Agarwal
ID: 34976495
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
 

Author Comment

by:VBdotnet2005
ID: 34983329
One thing, can I call methods from C# classes in VB or the other way around?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:VBdotnet2005
ID: 34984419
How can I call C# class in VB page? Is it possbile?
0
 
LVL 9

Accepted Solution

by:
rawinnlnx9 earned 336 total points
ID: 34984528
This shouldn't be a problem at all. I'm doing in in DotNetNuke programming right now. No issues at all.
0
 
LVL 9

Assisted Solution

by:rawinnlnx9
rawinnlnx9 earned 336 total points
ID: 34984650
0
 
LVL 29

Assisted Solution

by:Paul Jackson
Paul Jackson earned 164 total points
ID: 34986069
Yes you can do that it won't be a problem.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question