tags:

views:

118

answers:

2

Hi All,

I've got an existing asp.net project written in vb.net need to merge into C# ASP.NET MVC 1.0 application. I couldn't find a good article on this. I have successfully created a sample project and merge it. It works successfully. But when merge it into my real project it does not work. I've used C#.csproj project file and deleted VB project file. for the merging i could find a good article this link successful on sample project not with the real project.

good one: http://www.packtpub.com/article/mixing-asp.net-webforms-and-asp.net-mvc

how it is possible to merge VB Default.aspx, C# Default.aspx and VB Global.asax, C# Global.asax. Can I used VB.vbproj file insted of csproj

Thanks

Thushara Perera

+1  A: 

It's not possible to mix languages in the same ASP.NET project. I recommend either using one language or the other in the same project.

Haacked
Thanks Haacked.
Thushara Perera
A: 

It is possible at least in VS2005. Not certain about 2008 and beyond, or how that would work with MVC without using assemblies or referencing another classes in another project.

  1. Create two subdirectories in App_Code folder one for C# and one for VB.Net.
  2. Modify the web.config file as follows

    <compilation debug="true" targetFramework="4.0">
    <codeSubDirectories>
        <add directoryName="VBCode"/>
        <add directoryName="CSCode"/>
    </codeSubDirectories>
    

see:here

Art