开发者

can you easily mix in one project C# and VB.aspx

you should be able to merge the assemblies.开发者_StackOverflow中文版.. but just wondering if you had a VB.net web app, and then had a C# project, how would you merge the aspx pages?

can it be done?


For Web Site projects, you can place your C# source code files in App_Code\CS and your VB.NET files in App_Code\VB. Your ASPX files can be either language, as stated in the @Page directive.

For Web Application projects, you are limited to one language per project. You can deploy as many projects of different languages as needed.


You can easily mix VB and CS projects in the same solution. Suposedly (see link below) you are able to mix them within the same project. I have never tried the method specified below though so I can't tell you if it actually works. There is no IDE support for it though:

Mixing C# and VB.NET in one assembly


You might be able to take two projects, built independently into aspx files and a dll, and deploy the aspx files and the two dlls to the bin directory. It might work,but I don't know how well something like Global.asax will handle that, since those methods would be in both dlls.


If they're both deployed to the same folder in IIS, there is nothing stopping you from having some .aspx files in C# and some in VB.NET. Obviously, in one Visual Studio project, you can only have all-VB.NEt or all C#, but you can still deploy two projects to the same web application.

I would question the value of this in general, though, since it means your developers will need to be familiar with both languages. We have done this in the past, though, when writing DotNetNuke modules - DotNetNuke itself is written in VB.NET (for some bizarre reason), and we developed our custom modules in C#.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜