views:

485

answers:

2

We currently have a asp.net website with some modules developed in VB.Net & some in C# (not just classes but also individual aspx pages and code behind). We figured we wanted to move to web application model as we need to implement CI with TFS.

The problem :

When we create a C# web application, copy the files from website & say convert to web application it gives Could not Parse errors (probably because files are vb.net files)

When we create a VB.NET web application, copy the files & say convert to web application it converts only vb.net pages & on publishing throws error on all c# pages saying Could not load type

The asp.net website would work properly with multiple codebehind language support.

Help would be highly appreciated!

A: 

Put all the App_Code folder names what contain C# code into CodeSubDirectories section in your web.config

p.s. this is how it's done in DotNetNuke

roman m
hadi
wow ... you would have to fix that, you can't just swap languages like that
roman m
It works fine when it was a asp.net web site. Doesnt work in asp.net web application. Any way by which I can make it to work without recoding my entire code to match the language?
hadi
A: 

Can you break the app into 2 separate web applications that run from the same root directory? Just put the complied C# dll in the bin with the compiled VB.net dll and place all of the aspx pages wherever they would need to be for your site structure.

I haven't tried this myself, but it should work. You'll have to create a separate project and reference any data layers, etc. Just move the C# code to the new app and see how that goes. Not the best solution, but it beats converting from one language to another.

brentkeller