Solved

C# class in App_code

Posted on 2011-02-24
7
516 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
  • 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:agarwalrahul
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 84 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 84 total points
ID: 34984650
0
 
LVL 29

Assisted Solution

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
what technologies offer Authentication over Web Services? 4 105
Asp.net mvc 5 5 43
Code works but I need to redo it and assign values to Model 7 33
ASP.NET MVC 2 0
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

867 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now