开发者

How to merge VB.NET WEB Project with C#.NET MVC project

开发者 https://www.devze.com 2022-12-23 17:53 出处:网络
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 mer

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 f开发者_开发百科ile 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


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号