Вопрос

We have created our website on ASP.NET with C#. But another developer has created her code on VB.NET. Now we have to integrate her pages and code with our existing application.

Это было полезно?

Решение

You can't use VB and C# together within the same Web Application project. What I would recommend is that you convert the VB to C# (or vice-versa) using one of the many automated conversion tools that are available (Telerik has one, for example). Barring that, your next best bet would be to keep them as separate projects and deploy them together to the same site, if that's an option (for example, if each project will be able to have its own set of URLs). If that isn't an option, then you will simply have to bite the bullet and convert one language to the other.

Другие советы

For web application project:

asp.net web application with c# & vb.net both in codebehind

As mentioned by OP in comments, s/he is asking for Web Application projects; so the below is only for website projects:

You don't need to do anything. Just add those .aspx and .aspx.vb pages in your website project. If you are using .NET Framework 2.0 or above, they will compile and the complete website will work.

By the way, if you see, every .aspx page contains the Language attribute in @Page directive which specify the language of the code beside file.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top