Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Getting StartedGetting Startedusing vb class in c# class wonusing vb class in c# class won't work
Previous
 
Next
New Post
7/3/2010 6:35 PM
 
Hi Steven,

I've got good news and bad news. The good news - to fix your test project all you need to do is tell it to build A.vb before B.cs - you can do this by adding A as a new codeSubDirectory in web.config above B.

The bad news - I'm really not 100% clear about the ASP.Net build processes that are going on here. The MSDN page that describes the codeSubDirectories element of web.config makes the point that the list of folders added is ordered - therefore order is significant, and it says that the App_Code folder is built last, but it doesn't say when App_Code sub folders not listed get built - my impression is that it is after, rather than before, the listed folders. And I also don't understand the implications of the mixed languages; how can A (VB.Net) reference B (C#) if B is built after A - if both are C# then it doesn't work.

If anyone reading this who really understands the processes going on here can provide any links to a detailed explanation I'd appreciate it.

Oh, and I probably should have mentioned this earlier, but circular references (A uses B, B uses A) are generally considered a bad thing. 

Regards,
Rhys

www.rmjcs.com - Mostly SQL Server Stuff
 
New Post
7/5/2010 4:10 AM
 
Hey Rhys,

Thanks for the follow up.

Adding the A (VB.NET) to the subcodedirectories before B does indeed solve it in the testproject (I only tried adding it after which didn't work.) However as I understood it should only be necessary to put the C# directories in there, since the website is a visual basic site but things seem to be different. I would also love to know how this process works. For the referencing, it should be perfectly possible to reference the A or B class before this project is built I though but I don't see why It only works in one way (for the app_code subdirectories), and it does work perfectly for any directories outside the app_code. I have several c# dotnetnuke modules (in the desktopmodules directory) that can perfectly reference these vb classes. But the classes in the app_code directory can't...

Then the thing about adding the vb directories before the c# directories, it seems to work in the sample project, but if I do this in my dotnetnuke site it becomes hell. It won't compile as all of a sudden, due to the order importance of the subcodedirectories, things can't be found anymore. I have about 50 custom modules and 39 app_code folders mixed c# and vb. If I need to add all folders in a correct order so that all will compile, this will be as hard as french kissing a cobra :p But it looks more and more that that is what needs to happen. Hopefully reflector will be of some aid The problems start when classes use other classes for app_code directory files when one directory is not in the web.config and the other is, and multiple languages are used.

I still don't get why this problem does not occur for the c# DesktopModules files that use (unregistered) vb files from the app_code folder.


Oh yeah and about the circular references, it was to make the sample project simpler. I do try to avoid those, but I have one (utility class from vb using one from c# and vice verca), I'll have to rewrite a bit and move everything from those 2 utility classes to one language.

Any more help and tips appreciated.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting Startedusing vb class in c# class wonusing vb class in c# class won't work


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out